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 *)
123 AC_CHECK_SIZEOF(long long)
125 # long doubles were not used, and a portability problem
130 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
131 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
132 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
134 # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
135 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
137 # Check for sys_errlist
138 AC_MSG_CHECKING(for sys_errlist)
140 extern char *sys_errlist[];
142 sys_errlist[sys_nerr-1][0] = 0;
143 ], glib_ok=yes, glib_ok=no)
144 AC_MSG_RESULT($glib_ok)
145 if test $glib_ok = no; then
146 AC_DEFINE(NO_SYS_ERRLIST)
149 # Check for sys_siglist
150 AC_MSG_CHECKING(for sys_siglist)
152 extern char *sys_siglist[];
153 sys_siglist[1][0] = 0;
154 ], glib_ok=yes, glib_ok=no)
155 AC_MSG_RESULT($glib_ok)
156 if test $glib_ok = no; then
157 AC_DEFINE(NO_SYS_SIGLIST)
160 # Check if <sys/select.h> needs to be included for fd_set
161 AC_MSG_CHECKING([for fd_set])
162 AC_TRY_COMPILE([#include <sys/types.h>],
163 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
164 if test $gtk_ok = yes; then
165 AC_MSG_RESULT([yes, found in sys/types.h])
167 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
168 if test $gtk_ok = yes; then
169 AC_DEFINE(HAVE_SYS_SELECT_H)
170 AC_MSG_RESULT([yes, found in sys/select.h])
177 # This stuff is here, only so that we can define these
178 # things in glibconfig.h. If ../config.h was installed
179 # (under some other name?) then the definitions would
180 # belong there. (They are only used in GDK)
184 AC_MSG_CHECKING(for wchar.h)
185 AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
186 if test $gtk_ok = yes; then
187 AC_DEFINE(HAVE_WCHAR_H)
189 AC_MSG_RESULT($gtk_ok)
191 # Check for wctype.h (for iswalnum)
193 AC_MSG_CHECKING(for wctype.h)
194 AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
195 if test $gtk_ok = yes; then
196 AC_DEFINE(HAVE_WCTYPE_H)
198 AC_MSG_RESULT($gtk_ok)
200 # The following is necessary for Linux libc-5.4.38
202 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
203 AC_TRY_LINK([#include <stdlib.h>],[
204 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
205 # ifdef HAVE_WCTYPE_H
213 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
215 iswalnum((wchar_t) 0);
216 ], gtk_ok=yes, gtk_ok=no)
218 if test $gtk_ok = no; then
219 AC_DEFINE(HAVE_BROKEN_WCTYPE)
221 AC_MSG_RESULT($gtk_ok)
223 AC_OUTPUT([Makefile glib-config],[chmod +x glib-config])