Split glib.h into many header files mostly according to the resp.
[platform/upstream/glib.git] / configure.in
index be002dc..79608a2 100644 (file)
@@ -15,9 +15,7 @@ cflags_set=${CFLAGS+set}
 # we rewrite this file
 rm -f glibconfig-sysdefs.h
 
-dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
-dnl are available for $ac_help expansion (don't we all *love* autoconf?)
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+GLIB_DIVERT_BEFORE_HELP([
 #
 # The following version number definitions apply to GLib, GModule, GObject and GThread
 # as a whole, so if changes occoured in any of them, they are all
@@ -37,8 +35,7 @@ GLIB_MICRO_VERSION=1
 GLIB_INTERFACE_AGE=0
 GLIB_BINARY_AGE=0
 GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
-dnl
-AC_DIVERT_POP()dnl
+])dnl
 
 AC_SUBST(GLIB_MAJOR_VERSION)
 AC_SUBST(GLIB_MINOR_VERSION)
@@ -90,15 +87,16 @@ case $host in
 esac
 AC_MSG_RESULT([$glib_native_beos])
 
-dnl figure debugging default, prior to $ac_help setup
 dnl
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+
+GLIB_DIVERT_BEFORE_HELP([
+# figure debugging default, prior to $ac_help setup
 if test `expr $GLIB_MINOR_VERSION \% 2` = 1 ; then
-       debug_default=yes
+  debug_default=yes
 else
-       debug_default=minimum
-fi
-AC_DIVERT_POP()dnl
+  debug_default=minimum
+fi[]dnl
+])
 
 dnl declare --enable-* args and collect ac_help strings
 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
@@ -314,17 +312,8 @@ esac
 AC_C_BIGENDIAN
 
 # check for header files
-AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
-AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
-AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
-AC_CHECK_HEADERS(sys/param.h, AC_DEFINE(HAVE_SYS_PARAM_H))
-AC_CHECK_HEADERS(sys/poll.h, AC_DEFINE(HAVE_SYS_POLL_H))
-AC_CHECK_HEADERS(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
-AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
-AC_CHECK_HEADERS(sys/times.h, AC_DEFINE(HAVE_SYS_TIMES_H))
-AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
-AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
-AC_CHECK_HEADERS(stdint.h, AC_DEFINE(HAVE_VALUES_H))
+AC_CHECK_HEADERS([float.h limits.h pwd.h sys/param.h sys/poll.h sys/select.h])
+AC_CHECK_HEADERS([sys/time.h sys/times.h unistd.h values.h stdint.h])
 
 AC_MSG_CHECKING(whether make is GNU Make)
 STRIP_BEGIN=
@@ -449,11 +438,13 @@ AC_CACHE_VAL(glib_cv_sane_realloc,[
           return realloc (0, sizeof (int)) == 0;
         }],
         glib_cv_sane_realloc=yes
-        AC_DEFINE(REALLOC_0_WORKS)
         ,
         glib_cv_sane_realloc=no
         ,)
 ])
+if test x$glib_cv_sane_realloc = xyes; then
+  AC_DEFINE(REALLOC_0_WORKS)
+fi
 AC_MSG_RESULT($glib_cv_sane_realloc)
 
 dnl Check for nl_langinfo and CODESET
@@ -579,10 +570,9 @@ G_MODULE_HAVE_DLERROR=0
 dnl *** dlopen() and dlsym() in system libraries
 if test -z "$G_MODULE_IMPL"; then
        AC_CHECK_FUNC(dlopen,
-               AC_CHECK_FUNC(dlsym,
-                       G_MODULE_IMPL=G_MODULE_IMPL_DL
-               ,)
-       ,)
+                     [AC_CHECK_FUNC(dlsym,
+                                    [G_MODULE_IMPL=G_MODULE_IMPL_DL],[])],
+                     [])
 fi
 dnl *** load_image (BeOS)
 if test -z "$G_MODULE_IMPL" -a "x$glib_native_beos" = "xyes"; then
@@ -593,14 +583,13 @@ if test -z "$G_MODULE_IMPL" -a "x$glib_native_beos" = "xyes"; then
       G_MODULE_IMPL=G_MODULE_IMPL_BEOS 
 ,)
 fi   
-dnl *** dlopen() and dlsym() in libdl
+# *** dlopen() and dlsym() in libdl
 if test -z "$G_MODULE_IMPL"; then
        AC_CHECK_LIB(dl, dlopen,
-               AC_CHECK_LIB(dl, dlsym,
-                       G_MODULE_LIBS=-ldl
-                       G_MODULE_IMPL=G_MODULE_IMPL_DL
-               ,)
-       ,)
+                    [AC_CHECK_LIB(dl, dlsym,
+                                  [G_MODULE_LIBS=-ldl
+                                  G_MODULE_IMPL=G_MODULE_IMPL_DL],[])],
+                    [])
 fi
 dnl *** shl_load() in libdld (HP-UX)
 if test -z "$G_MODULE_IMPL"; then
@@ -1183,11 +1172,13 @@ case "$CONFIG_OTHER" in
        cat > $outfile <<\_______EOF
 /* glibconfig.h
  *
- * This is a generated file.  Please modify `configure.in'
+ * This is a generated file.  Please modify 'configure.in'
  */
 
-#ifndef GLIBCONFIG_H
-#define GLIBCONFIG_H
+#ifndef __G_LIBCONFIG_H__
+#define __G_LIBCONFIG_H__
+
+#include <gmacros.h>
 
 _______EOF
 
@@ -1200,11 +1191,8 @@ _______EOF
        if test x$glib_values_h = xyes; then
          echo '#include <values.h>' >> $outfile
        fi
-       if test x$g_mutex_header_file != x; then
-         echo '#include <'"$g_mutex_header_file"'>' >> $outfile
-       fi
        if test "$glib_header_alloca_h" = "yes"; then
-         echo  '#include <alloca.h>' >> $outfile
+         echo '#define GLIB_HAVE_ALLOCA_H' >> $outfile
        fi
        if test x$glib_sys_poll_h = xyes; then
          echo '#define GLIB_HAVE_SYS_POLL_H' >> $outfile
@@ -1212,9 +1200,7 @@ _______EOF
 
        cat >> $outfile <<_______EOF
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+G_BEGIN_DECLS
 
 #define G_MINFLOAT     $glib_mf
 #define G_MAXFLOAT     $glib_Mf
@@ -1403,9 +1389,7 @@ _______EOF
 
        cat >>$outfile <<_______EOF
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 #endif /* GLIBCONFIG_H */
 _______EOF