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}
8 # GLIB_MICRO_VERSION += 1;
9 # GLIB_INTERFACE_AGE += 1;
10 # GLIB_BINARY_AGE += 1;
11 # if any functions have been added, set GLIB_INTERFACE_AGE to 0.
12 # if backwards compatibility has been broken,
13 # set GLIB_BINARY_AGE and GLIB_INTERFACE_AGE to 0.
20 GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
21 AC_SUBST(GLIB_VERSION)
24 LT_RELEASE=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION
25 LT_CURRENT=`expr $GLIB_MICRO_VERSION - $GLIB_INTERFACE_AGE`
26 LT_REVISION=$GLIB_INTERFACE_AGE
27 LT_AGE=`expr $GLIB_BINARY_AGE - $GLIB_INTERFACE_AGE`
36 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
38 # Specify a configuration file
39 AM_CONFIG_HEADER(glibconfig.h)
41 AC_DEFINE_UNQUOTED(GLIB_MAJOR_VERSION, $GLIB_MAJOR_VERSION)
42 AC_DEFINE_UNQUOTED(GLIB_MINOR_VERSION, $GLIB_MINOR_VERSION)
43 AC_DEFINE_UNQUOTED(GLIB_MICRO_VERSION, $GLIB_MICRO_VERSION)
45 dnl Initialize libtool
48 dnl Initialize maintainer mode
53 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
54 AC_ARG_ENABLE(mem_check, [ --enable-mem-check=[no/yes] turn on malloc/free sanity checking [default=no]],,enable_mem_check=no)
55 AC_ARG_ENABLE(mem_profile, [ --enable-mem-profile=[no/yes] turn on malloc profiling atexit [default=no]],,enable_mem_profile=no)
57 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
60 AC_MSG_CHECKING(whether to enable memory checking)
61 if test "x$enable_mem_check" = "xyes"; then
62 AC_DEFINE(ENABLE_MEM_CHECK, 1)
63 AC_SUBST(ENABLE_MEM_CHECK)
69 AC_MSG_CHECKING(whether to enable memory profiling)
70 if test "x$enable_mem_profile" = "xyes"; then
71 AC_DEFINE(ENABLE_MEM_PROFILE, 1)
72 AC_SUBST(ENABLE_MEM_PROFILE)
78 if test "x$enable_debug" = "xyes"; then
79 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
80 CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
82 if test "x$enable_debug" = "xno"; then
83 CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
87 AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, "${enable_debug}")
89 # Checks for programs.
94 if eval "test x$GCC = xyes"; then
95 if eval test -z \"`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`\" ; then
96 CFLAGS="$CFLAGS -Wall"
99 if eval "test x$enable_ansi = xyes"; then
100 if eval test -z \"`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`\" ; then
101 CFLAGS="$CFLAGS -ansi"
104 if eval test -z \"`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`\" ; then
105 CFLAGS="$CFLAGS -pedantic"
110 # Checks for header files.
113 # Checks for library functions.
116 AC_CHECK_FUNCS(atexit on_exit)
118 AC_CHECK_SIZEOF(char)
119 AC_CHECK_SIZEOF(short)
120 AC_CHECK_SIZEOF(long)
122 AC_CHECK_SIZEOF(void *)
124 # long doubles were not used, and a portability problem
129 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
130 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
131 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
133 # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
134 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
136 # Check for sys_errlist
137 AC_MSG_CHECKING(for sys_errlist)
139 extern char *sys_errlist[];
141 sys_errlist[sys_nerr-1][0] = 0;
142 ], glib_ok=yes, glib_ok=no)
143 AC_MSG_RESULT($glib_ok)
144 if test $glib_ok = no; then
145 AC_DEFINE(NO_SYS_ERRLIST)
148 # Check for sys_siglist
149 AC_MSG_CHECKING(for sys_siglist)
151 extern char *sys_siglist[];
152 sys_siglist[1][0] = 0;
153 ], glib_ok=yes, glib_ok=no)
154 AC_MSG_RESULT($glib_ok)
155 if test $glib_ok = no; then
156 AC_DEFINE(NO_SYS_SIGLIST)
159 # Check if <sys/select.h> needs to be included for fd_set
160 AC_MSG_CHECKING([for fd_set])
161 AC_TRY_COMPILE([#include <sys/types.h>],
162 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
163 if test $gtk_ok = yes; then
164 AC_MSG_RESULT([yes, found in sys/types.h])
166 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
167 if test $gtk_ok = yes; then
168 AC_DEFINE(HAVE_SYS_SELECT_H)
169 AC_MSG_RESULT([yes, found in sys/select.h])
176 # This stuff is here, only so that we can define these
177 # things in glibconfig.h. If ../config.h was installed
178 # (under some other name?) then the definitions would
179 # belong there. (They are only used in GDK)
183 AC_MSG_CHECKING(for wchar.h)
184 AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
185 if test $gtk_ok = yes; then
186 AC_DEFINE(HAVE_WCHAR_H)
188 AC_MSG_RESULT($gtk_ok)
190 # Check for wctype.h (for iswalnum)
192 AC_MSG_CHECKING(for wctype.h)
193 AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
194 if test $gtk_ok = yes; then
195 AC_DEFINE(HAVE_WCTYPE_H)
197 AC_MSG_RESULT($gtk_ok)
199 # The following is necessary for Linux libc-5.4.38
201 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
202 AC_TRY_LINK([#include <stdlib.h>],[
203 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
204 # ifdef HAVE_WCTYPE_H
212 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
214 iswalnum((wchar_t) 0);
215 ], gtk_ok=yes, gtk_ok=no)
217 if test $gtk_ok = no; then
218 AC_DEFINE(HAVE_BROKEN_WCTYPE)
220 AC_MSG_RESULT($gtk_ok)
222 AC_OUTPUT([Makefile glib-config],[chmod +x glib-config])