File: configure.in

package info (click to toggle)
xenophilia 0.8-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 840 kB
  • ctags: 1,202
  • sloc: ansic: 11,181; makefile: 188; python: 47
file content (115 lines) | stat: -rw-r--r-- 3,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
dnl Process this file with autoconf to produce a configure script.

AC_INIT(README)
AC_PREFIX_DEFAULT("/usr/local")

# Test for C compiler

AC_PROG_CC
AC_HEADER_STDC
AC_C_CONST
AC_PROG_MAKE_SET

AC_ARG_ENABLE(checks, [  --disable-checks        make en even slimmer binary], checks=$enableval, checks="yes")
if test $checks != "yes"; then
  CFLAGS="-O2 -fomit-frame-pointer -DG_DISABLE_CHECKS"
  LDFLAGS="$LDFLAGS -s"
fi
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)

# X Font installation path

AC_PATH_X
if test -d $x_libraries/X11/fonts/local; then
  X_FONT_DIR=$x_libraries/X11/fonts/local
elif test -d $x_libraries/X11/fonts/misc; then
  X_FONT_DIR=$x_libraries/X11/fonts/misc
else
  AC_MSG_WARN(Could not find X font directory. You will have to install fonts manually)
fi
AC_SUBST(X_FONT_DIR)

# Test for GTK+

AC_ARG_ENABLE(gtk-2, [  --enable-gtk-2          compile for GTK+ 2.0 (experimental)], gtk_2=$enableval, gtk_2="no")
AC_ARG_WITH(gtk, [  --with-gtk=DIR          where to find GTK+], prefix=$withval)

if test $gtk_2 = "yes"; then
  gtk_config_progs="pkg-config"
else
  gtk_config_progs="gtk-config gtk12-config"
fi
AC_PATH_PROGS(gtk_config, $gtk_config_progs, no, $prefix/bin)
if test $gtk_config = "no"; then
  AC_MSG_ERROR(Could not find installation of GTK+. Try ./configure --help)
fi

if test $gtk_2 = "yes"; then
  gtk_config="$gtk_config gtk+-x11-2.0"
  AC_MSG_CHECKING(for GTK+ 2.0)
  if $gtk_config --exists; then
    :
  else
    AC_MSG_ERROR(Could not find installation of GTK+ 2.0)
  fi
  if $gtk_config --max-version=1.3.5; then
	AC_MSG_ERROR(Your development version of GTK+ is too old)
  fi
  
  GTK_VERSION=`$gtk_config --modversion`
  GTK_PREFIX=`$gtk_config --variable=prefix`
  GTK_EXEC_PREFIX=`$gtk_config --variable=exec_prefix`
  if $gtk_config --atleast-version=2.0; then
    AC_MSG_RESULT(found version $GTK_VERSION)
    GTK_ENGINE_DIR=$GTK_EXEC_PREFIX/lib/gtk-2.0/engines
  else
    AC_MSG_RESULT(found version $GTK_VERSION (development version))
    GTK_ENGINE_DIR=$GTK_EXEC_PREFIX/lib/gtk-2.0/$GTK_VERSION/engines
  fi
else
  GTK_VERSION=`$gtk_config --version`
  GTK_PREFIX=`$gtk_config --prefix`
  GTK_EXEC_PREFIX=`$gtk_config --exec-prefix`
  GTK_ENGINE_DIR=$GTK_EXEC_PREFIX/lib/gtk/themes/engines
fi
GTK_CFLAGS=`$gtk_config --cflags`
GTK_LIBS=`$gtk_config --libs`
GTK_THEME_DIR=$GTK_PREFIX/share/themes
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_THEME_DIR)
AC_SUBST(GTK_ENGINE_DIR)

# checks for header files
# checks for library functions
# checks for system services

# Final

MAJOR=0
MINOR=8
VERSION=$MAJOR.$MINOR
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(VERSION)

# Done

AC_OUTPUT(Makefile gtk-src/Makefile themes/Makefile fonts/Makefile)

echo
echo Summary of configuration:
echo
echo "GTK+ version:      $GTK_VERSION"
echo "install engine in: $GTK_ENGINE_DIR"
echo "install themes in: $GTK_THEME_DIR"
echo "install fonts in:  $X_FONT_DIR"

if test $checks != "yes" ; then
  echo
  echo Warning: You have disabled runtime checks.
  echo Badly written software will crash more often and you will not
  echo be able to write me any meaningful bug reports ...
  echo You have been warned!
fi