1 # Process this file with autoconf to produce a configure script.
4 dnl Initialize automake stuff
5 AM_INIT_AUTOMAKE(glib, 0.99.3)
7 # Specify a configuration file
8 AM_CONFIG_HEADER(glibconfig.h)
10 dnl Initialize libtool
13 dnl Initialize maintainer mode
18 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
19 if test "x$enable_debug" = "xyes"; then
23 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
26 if test -n "$DEBUGFLAG"; then
27 test "$cflags_set" = set || CFLAGS="$DEBUGFLAG"
30 # Checks for programs.
35 if eval "test x$GCC = xyes"; then
36 if eval test -z \"`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`\" ; then
37 CFLAGS="$CFLAGS -Wall"
40 if eval "test x$enable_ansi = xyes"; then
41 if eval test -z \"`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`\" ; then
42 CFLAGS="$CFLAGS -ansi"
45 if eval test -z \"`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`\" ; then
46 CFLAGS="$CFLAGS -pedantic"
51 # Checks for header files.
54 # Checks for library functions.
58 AC_CHECK_SIZEOF(short)
61 AC_CHECK_SIZEOF(void *)
63 # long doubles were not used, and a portability problem
68 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
69 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
70 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
72 # Check for strerror, strsignal, and memmove functions
73 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf)
75 # Check for sys_errlist
76 AC_MSG_CHECKING(sys_errlist)
78 extern char *sys_errlist[];
80 sys_errlist[sys_nerr-1][0] = 0;
81 ], glib_ok=yes, glib_ok=no)
82 AC_MSG_RESULT($glib_ok)
83 if test $glib_ok = no; then
84 AC_DEFINE(NO_SYS_ERRLIST)
87 # Check for sys_siglist
88 AC_MSG_CHECKING(sys_siglist)
90 extern char *sys_siglist[];
91 sys_siglist[1][0] = 0;
92 ], glib_ok=yes, glib_ok=no)
93 AC_MSG_RESULT($glib_ok)
94 if test $glib_ok = no; then
95 AC_DEFINE(NO_SYS_SIGLIST)
98 # Check for sys/select.h
100 AC_MSG_CHECKING([fd_set and sys/select])
101 AC_TRY_COMPILE([#include <sys/types.h>],
102 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
103 if test $gtk_ok = no; then
104 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
105 if test $gtk_ok = yes; then
106 AC_DEFINE(HAVE_SYS_SELECT_H)
109 AC_MSG_RESULT($gtk_ok)
110 if test $gtk_ok = no; then
114 # This stuff is here, only so that we can define these
115 # things in glibconfig.h. If ../config.h was installed
116 # (under some other name?) then the definitions would
117 # belong there. (They are only used in GDK)
121 AC_MSG_CHECKING(for wchar.h)
122 AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
123 if test $gtk_ok = yes; then
124 AC_DEFINE(HAVE_WCHAR_H)
126 AC_MSG_RESULT($gtk_ok)
128 # Check for wctype.h (for iswalnum)
130 AC_MSG_CHECKING(for wctype.h)
131 AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
132 if test $gtk_ok = yes; then
133 AC_DEFINE(HAVE_WCTYPE_H)
135 AC_MSG_RESULT($gtk_ok)