]> Pileus Git - ~andy/gtk/blob - glib/configure.in
Released GTK+ 0.99.8
[~andy/gtk] / glib / configure.in
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(glist.c)
3
4 # Save this value here, since automake will set cflags later
5 cflags_set=${CFLAGS+set}
6
7 dnl Initialize automake stuff
8 AM_INIT_AUTOMAKE(glib, 0.99.8)
9
10 # Specify a configuration file
11 AM_CONFIG_HEADER(glibconfig.h)
12
13 dnl Initialize libtool
14 AM_PROG_LIBTOOL
15
16 dnl Initialize maintainer mode
17 AM_MAINTAINER_MODE
18
19 AC_CANONICAL_HOST
20
21 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
22
23 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
24                     , enable_ansi=no)
25
26 if test "x$enable_debug" = "xyes"; then
27   test "$cflags_set" = set || CFLAGS="-g"
28   CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
29 else
30   if test "x$enable_debug" = "xno"; then
31     CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
32   fi
33 fi
34
35 AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, "${enable_debug}")
36
37 # Checks for programs.
38 AC_PROG_CC
39 AM_PROG_CC_STDC
40 AC_PROG_INSTALL
41
42 if eval "test x$GCC = xyes"; then
43   if eval test -z \"`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`\" ; then
44     CFLAGS="$CFLAGS -Wall"
45   fi
46
47   if eval "test x$enable_ansi = xyes"; then
48     if eval test -z \"`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`\" ; then
49       CFLAGS="$CFLAGS -ansi"
50     fi
51
52     if eval test -z \"`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`\" ; then
53       CFLAGS="$CFLAGS -pedantic"
54     fi
55   fi
56 fi
57
58 # Checks for header files.
59 AC_HEADER_STDC
60
61 # Checks for library functions.
62 AC_FUNC_VPRINTF
63
64 AC_CHECK_SIZEOF(char)
65 AC_CHECK_SIZEOF(short)
66 AC_CHECK_SIZEOF(long)
67 AC_CHECK_SIZEOF(int)
68 AC_CHECK_SIZEOF(void *)
69
70 # long doubles were not used, and a portability problem 
71 # AC_C_LONG_DOUBLE
72 AC_C_CONST
73 AC_C_INLINE
74
75 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
76 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
77 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
78
79 # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
80 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
81
82 # Check for sys_errlist
83 AC_MSG_CHECKING(sys_errlist)
84 AC_TRY_LINK(, [
85 extern char *sys_errlist[];
86 extern int sys_nerr;
87 sys_errlist[sys_nerr-1][0] = 0;
88 ], glib_ok=yes, glib_ok=no)
89 AC_MSG_RESULT($glib_ok)
90 if test $glib_ok = no; then
91     AC_DEFINE(NO_SYS_ERRLIST)
92 fi
93
94 # Check for sys_siglist
95 AC_MSG_CHECKING(sys_siglist)
96 AC_TRY_LINK(, [
97 extern char *sys_siglist[];
98 sys_siglist[1][0] = 0;
99 ], glib_ok=yes, glib_ok=no)
100 AC_MSG_RESULT($glib_ok)
101 if test $glib_ok = no; then
102     AC_DEFINE(NO_SYS_SIGLIST)
103 fi
104
105 # Check for sys/select.h
106
107 AC_MSG_CHECKING([fd_set and sys/select])
108 AC_TRY_COMPILE([#include <sys/types.h>],
109         [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
110 if test $gtk_ok = no; then
111     AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
112     if test $gtk_ok = yes; then
113         AC_DEFINE(HAVE_SYS_SELECT_H)
114     fi
115 fi
116 AC_MSG_RESULT($gtk_ok)
117 if test $gtk_ok = no; then
118     AC_DEFINE(NO_FD_SET)
119 fi
120
121 # This stuff is here, only so that we can define these
122 # things in glibconfig.h. If ../config.h was installed
123 # (under some other name?) then the definitions would
124 # belong there. (They are only used in GDK)
125
126 # Check for wchar.h
127
128 AC_MSG_CHECKING(for wchar.h)
129 AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
130 if test $gtk_ok = yes; then
131    AC_DEFINE(HAVE_WCHAR_H)
132 fi
133 AC_MSG_RESULT($gtk_ok)
134
135 # Check for wctype.h (for iswalnum)
136
137 AC_MSG_CHECKING(for wctype.h)
138 AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
139 if test $gtk_ok = yes; then
140    AC_DEFINE(HAVE_WCTYPE_H)
141 fi
142 AC_MSG_RESULT($gtk_ok)
143
144 # The following is necessary for Linux libc-5.4.38
145
146 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
147 AC_TRY_LINK([#include <stdlib.h>],[
148 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
149 #  ifdef HAVE_WCTYPE_H
150 #    include <wctype.h>
151 #  else
152 #    ifdef HAVE_WCHAR_H
153 #      include <wchar.h>
154 #    endif
155 #  endif
156 #else
157 #  define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
158 #endif
159 iswalnum((wchar_t) 0);
160 ], gtk_ok=yes, gtk_ok=no)
161
162 if test $gtk_ok = no; then
163    AC_DEFINE(HAVE_BROKEN_WCTYPE)
164 fi
165 AC_MSG_RESULT($gtk_ok)
166
167 AC_OUTPUT(Makefile)