1 # Process this file with autoconf to produce a configure script.
4 # Save this value here, since automake will set cflags later
5 cflags_set=${CFLAGS+set}
7 dnl Initialize automake stuff
8 AM_INIT_AUTOMAKE(glib, 0.99.8)
10 # Specify a configuration file
11 AM_CONFIG_HEADER(glibconfig.h)
13 dnl Initialize libtool
16 dnl Initialize maintainer mode
21 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
23 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
26 if test "x$enable_debug" = "xyes"; then
27 test "$cflags_set" = set || CFLAGS="-g"
28 CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
30 if test "x$enable_debug" = "xno"; then
31 CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
35 AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, "${enable_debug}")
37 # Checks for programs.
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"
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"
52 if eval test -z \"`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`\" ; then
53 CFLAGS="$CFLAGS -pedantic"
58 # Checks for header files.
61 # Checks for library functions.
65 AC_CHECK_SIZEOF(short)
68 AC_CHECK_SIZEOF(void *)
70 # long doubles were not used, and a portability problem
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))
79 # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
80 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
82 # Check for sys_errlist
83 AC_MSG_CHECKING(sys_errlist)
85 extern char *sys_errlist[];
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)
94 # Check for sys_siglist
95 AC_MSG_CHECKING(sys_siglist)
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)
105 # Check for sys/select.h
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)
116 AC_MSG_RESULT($gtk_ok)
117 if test $gtk_ok = no; then
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)
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)
133 AC_MSG_RESULT($gtk_ok)
135 # Check for wctype.h (for iswalnum)
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)
142 AC_MSG_RESULT($gtk_ok)
144 # The following is necessary for Linux libc-5.4.38
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
157 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
159 iswalnum((wchar_t) 0);
160 ], gtk_ok=yes, gtk_ok=no)
162 if test $gtk_ok = no; then
163 AC_DEFINE(HAVE_BROKEN_WCTYPE)
165 AC_MSG_RESULT($gtk_ok)