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)
44 AC_DEFINE_UNQUOTED(GLIB_INTERFACE_AGE, $GLIB_INTERFACE_AGE)
45 AC_DEFINE_UNQUOTED(GLIB_BINARY_AGE, $GLIB_BINARY_AGE)
47 dnl Initialize libtool
50 dnl Initialize maintainer mode
55 AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=minimum]],,enable_debug=minimum)
56 AC_ARG_ENABLE(mem_check, [ --enable-mem-check=[no/yes] turn on malloc/free sanity checking [default=no]],,enable_mem_check=no)
57 AC_ARG_ENABLE(mem_profile, [ --enable-mem-profile=[no/yes] turn on malloc profiling atexit [default=no]],,enable_mem_profile=no)
59 AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
62 AC_MSG_CHECKING(whether to enable memory checking)
63 if test "x$enable_mem_check" = "xyes"; then
64 AC_DEFINE(ENABLE_MEM_CHECK, 1)
65 AC_SUBST(ENABLE_MEM_CHECK)
71 AC_MSG_CHECKING(whether to enable memory profiling)
72 if test "x$enable_mem_profile" = "xyes"; then
73 AC_DEFINE(ENABLE_MEM_PROFILE, 1)
74 AC_SUBST(ENABLE_MEM_PROFILE)
80 if test "x$enable_debug" = "xyes"; then
81 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
82 CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
84 if test "x$enable_debug" = "xno"; then
85 CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
89 AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, "${enable_debug}")
91 # Checks for programs.
96 if eval "test x$GCC = xyes"; then
97 if eval test -z \"`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`\" ; then
98 CFLAGS="$CFLAGS -Wall"
101 if eval "test x$enable_ansi = xyes"; then
102 if eval test -z \"`echo "$CFLAGS" | grep "\-ansi" 2> /dev/null`\" ; then
103 CFLAGS="$CFLAGS -ansi"
106 if eval test -z \"`echo "$CFLAGS" | grep "\-pedantic" 2> /dev/null`\" ; then
107 CFLAGS="$CFLAGS -pedantic"
112 # Checks for header files.
115 # Checks for library functions.
118 AC_CHECK_FUNCS(atexit on_exit)
120 AC_CHECK_SIZEOF(char)
121 AC_CHECK_SIZEOF(short)
122 AC_CHECK_SIZEOF(long)
124 AC_CHECK_SIZEOF(void *)
125 AC_CHECK_SIZEOF(long long)
127 # long doubles were not used, and a portability problem
132 AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
133 AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
134 AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
136 # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions
137 AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp)
139 # Check for sys_errlist
140 AC_MSG_CHECKING(for sys_errlist)
142 extern char *sys_errlist[];
144 sys_errlist[sys_nerr-1][0] = 0;
145 ], glib_ok=yes, glib_ok=no)
146 AC_MSG_RESULT($glib_ok)
147 if test $glib_ok = no; then
148 AC_DEFINE(NO_SYS_ERRLIST)
151 # Check for sys_siglist
152 AC_MSG_CHECKING(for sys_siglist)
154 extern char *sys_siglist[];
155 sys_siglist[1][0] = 0;
156 ], glib_ok=yes, glib_ok=no)
157 AC_MSG_RESULT($glib_ok)
158 if test $glib_ok = no; then
159 AC_DEFINE(NO_SYS_SIGLIST)
162 # Check if <sys/select.h> needs to be included for fd_set
163 AC_MSG_CHECKING([for fd_set])
164 AC_TRY_COMPILE([#include <sys/types.h>],
165 [fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
166 if test $gtk_ok = yes; then
167 AC_MSG_RESULT([yes, found in sys/types.h])
169 AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
170 if test $gtk_ok = yes; then
171 AC_DEFINE(HAVE_SYS_SELECT_H)
172 AC_MSG_RESULT([yes, found in sys/select.h])
179 # This stuff is here, only so that we can define these
180 # things in glibconfig.h. If ../config.h was installed
181 # (under some other name?) then the definitions would
182 # belong there. (They are only used in GDK)
186 AC_MSG_CHECKING(for wchar.h)
187 AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
188 if test $gtk_ok = yes; then
189 AC_DEFINE(HAVE_WCHAR_H)
191 AC_MSG_RESULT($gtk_ok)
193 # Check for wctype.h (for iswalnum)
195 AC_MSG_CHECKING(for wctype.h)
196 AC_TRY_CPP([#include <wctype.h>], gtk_ok=yes, gtk_ok=no)
197 if test $gtk_ok = yes; then
198 AC_DEFINE(HAVE_WCTYPE_H)
200 AC_MSG_RESULT($gtk_ok)
202 # The following is necessary for Linux libc-5.4.38
204 AC_MSG_CHECKING(if iswalnum() and friends are properly defined)
205 AC_TRY_LINK([#include <stdlib.h>],[
206 #if (defined(HAVE_WCTYPE_H) || defined(HAVE_WCHAR_H))
207 # ifdef HAVE_WCTYPE_H
215 # define iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c))
217 iswalnum((wchar_t) 0);
218 ], gtk_ok=yes, gtk_ok=no)
220 if test $gtk_ok = no; then
221 AC_DEFINE(HAVE_BROKEN_WCTYPE)
223 AC_MSG_RESULT($gtk_ok)
225 dnl ***********************
226 dnl *** g_module checks ***
227 dnl ***********************
231 G_MODULE_NEED_USCORE=0
232 G_MODULE_HAVE_DLERROR=0
233 dnl *** dlopen() in system libraries
234 if test -z "$G_MODULE_IMPL"; then
235 AC_CHECK_FUNC(dlopen,
236 G_MODULE_IMPL=G_MODULE_IMPL_DL
239 dnl *** dlopen() in libdl
240 if test -z "$G_MODULE_IMPL"; then
241 AC_CHECK_LIB(dl, dlopen,
243 G_MODULE_IMPL=G_MODULE_IMPL_DL
246 dnl *** shl_load() in libdld (HP-UX)
247 if test -z "$G_MODULE_IMPL"; then
248 G_MODULE_LDFLAGS='-Wl,-E'
249 AC_CHECK_LIB(dld, shl_load,
251 G_MODULE_IMPL=G_MODULE_IMPL_DLD
254 dnl *** additional checks for G_MODULE_IMPL_DL
255 if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
256 if test -d /usr/include/linux; then
257 G_MODULE_LDFLAGS='-rdynamic'
260 LDFLAGS_orig="$LDFLAGS"
261 LIBS="$LIBS $G_MODULE_LIBS"
262 LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
263 dnl *** check whether we need preceeding underscores
264 AC_MSG_CHECKING(for preceeding underscore in symbols)
265 AC_CACHE_VAL(glib_cv_uscore,[
268 int glib_underscore_test (void) { return 42; }
270 void *f1 = (void*)0, *f2 = (void*)0, *handle;
271 handle = dlopen ((void*)0, 0);
273 f1 = dlsym (handle, "glib_underscore_test");
274 f2 = dlsym (handle, "_glib_underscore_test");
275 } return !(f2 && !f1);
278 G_MODULE_NEED_USCORE=1
281 G_MODULE_NEED_USCORE=0
284 AC_MSG_RESULT($glib_cv_uscore)
285 LDFLAGS="$LDFLAGS_orig"
286 dnl *** check for having dlerror()
287 AC_CHECK_FUNC(dlerror,
288 G_MODULE_HAVE_DLERROR=1,
289 G_MODULE_HAVE_DLERROR=0)
292 dnl *** done, have e got an implementation?
293 if test -z "$G_MODULE_IMPL"; then
296 AC_SUBST(G_MODULE_IMPL)
297 AC_SUBST(G_MODULE_LIBS)
298 AC_SUBST(G_MODULE_LDFLAGS)
299 AC_SUBST(G_MODULE_HAVE_DLERROR)
300 AC_SUBST(G_MODULE_NEED_USCORE)
306 gmodule/gmoduleconf.h
308 ],[chmod +x glib-config])