Make some changes to the way that GMainContext works:
[platform/upstream/glib.git] / configure.in
index 2916a5e..260d5ee 100644 (file)
@@ -7,7 +7,7 @@ builtin(include, acglib.m4)dnl
 AC_PREREQ(2.13)
 
 # Process this file with autoconf to produce a configure script.
-AC_INIT(glist.c)
+AC_INIT(glib/glib.h)
 
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
@@ -31,7 +31,7 @@ GLIB_AC_DIVERT_BEFORE_HELP([
 #
 GLIB_MAJOR_VERSION=1
 GLIB_MINOR_VERSION=3
-GLIB_MICRO_VERSION=3
+GLIB_MICRO_VERSION=7
 GLIB_INTERFACE_AGE=0
 GLIB_BINARY_AGE=0
 GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
@@ -101,7 +101,6 @@ esac[]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)
-AC_ARG_ENABLE(msg-prefix, [  --enable-msg-prefix     turn on program name and PID prefixing of messages and warnings],,enable_msg_prefix=no)
 AC_ARG_ENABLE(gc_friendly, [  --enable-gc-friendly    turn on garbage collector friendliness [default=no]],,enable_gc_friendly=no)
 AC_ARG_ENABLE(mem_pools, [  --disable-mem-pools     disable all glib memory pools],,disable_mem_pools=no)
 AC_ARG_ENABLE(ansi, [  --enable-ansi           turn on strict ansi [default=no]],
@@ -135,14 +134,17 @@ else
   AC_MSG_RESULT(yes)
 fi
 
-if test "x$enable_msg_prefix" = "xyes"; then
-  AC_DEFINE_UNQUOTED(G_ENABLE_MSG_PREFIX, 1, 
-                    [Enable prefixing of error messages with program names])
-fi
-
 dnl Checks for programs.
 AC_PROG_CC
 
+dnl Check for a working C++ compiler, but do not bail out, if none is found.
+AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
+AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
+AC_LANG_RESTORE
+
 AM_PROG_CC_STDC
 AC_PROG_INSTALL
 
@@ -154,7 +156,9 @@ if test x$PKG_CONFIG = xno ; then
   AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
 fi
 
-if ! pkg-config --atleast-pkgconfig-version 0.5 ; then
+if pkg-config --atleast-pkgconfig-version 0.5 ; then
+  :
+else
   AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
 fi
 
@@ -196,7 +200,7 @@ dnl
 dnl gettext support
 dnl
 
-ALL_LINGUAS="de fr no ru sl tr uk"
+ALL_LINGUAS="az ca de fr no ru sl sv tr uk"
 AM_GLIB_GNU_GETTEXT
 LIBS="$LIBS $INTLLIBS"
 
@@ -380,6 +384,38 @@ case x$glib_cv_hasinline in
 xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword])
 esac
 
+# check for flavours of varargs macros
+AC_MSG_CHECKING(for ISO C99 varargs macros in C)
+AC_TRY_COMPILE([],[
+int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+],g_have_iso_c_varargs=yes,g_have_iso_c_varargs=no)
+AC_MSG_RESULT($g_have_iso_c_varargs)
+
+AC_MSG_CHECKING(for ISO C99 varargs macros in C++)
+if test "$CXX" = ""; then
+dnl No C++ compiler
+  g_have_iso_cxx_varargs=no
+else
+  AC_LANG_CPLUSPLUS
+  AC_TRY_COMPILE([],[
+int a(int p1, int p2, int p3);
+#define call_a(...) a(1,__VA_ARGS__)
+call_a(2,3);
+],g_have_iso_cxx_varargs=yes,g_have_iso_cxx_varargs=no)
+  AC_LANG_C
+fi
+AC_MSG_RESULT($g_have_iso_cxx_varargs)
+
+AC_MSG_CHECKING(for GNUC varargs macros)
+AC_TRY_COMPILE([],[
+int a(int p1, int p2, int p3);
+#define call_a(params...) a(1,params)
+call_a(2,3);
+],g_have_gnuc_varargs=yes,g_have_gnuc_varargs=no)
+AC_MSG_RESULT($g_have_gnuc_varargs)
+
 # check for bytesex stuff
 AC_C_BIGENDIAN
 
@@ -424,7 +460,7 @@ GLIB_SIZEOF([$size_includes], ptrdiff_t, ptrdiff_t)
 GLIB_SIZEOF([$size_includes], intmax_t, intmax_t)
 
 # Check for some functions
-AC_CHECK_FUNCS(lstat strerror strsignal memmove mkstemp vsnprintf stpcpy strcasecmp strncasecmp poll getcwd)
+AC_CHECK_FUNCS(lstat strerror strsignal memmove mkstemp vsnprintf stpcpy strcasecmp strncasecmp poll getcwd nanosleep)
 
 # Check if bcopy can be used for overlapping copies, if memmove isn't found.
 # The check is borrowed from the PERL Configure script.
@@ -657,7 +693,7 @@ if test -z "$G_MODULE_IMPL" -a "x$glib_native_beos" = "xyes"; then
       G_MODULE_IMPL=G_MODULE_IMPL_BEOS],
       [])
 fi   
-# *** dlopen() and dlsym() in libdl
+dnl *** dlopen() and dlsym() in libdl
 if test -z "$G_MODULE_IMPL"; then
        AC_CHECK_LIB(dl, dlopen,
                     [AC_CHECK_LIB(dl, dlsym,
@@ -665,6 +701,13 @@ if test -z "$G_MODULE_IMPL"; then
                                   G_MODULE_IMPL=G_MODULE_IMPL_DL],[])],
                     [])
 fi
+dnl *** NSLinkModule (dyld) in system libraries (Darwin)
+if test -z "$G_MODULE_IMPL"; then
+       AC_CHECK_FUNC(NSLinkModule,
+                     [G_MODULE_IMPL=G_MODULE_IMPL_DYLD
+                      G_MODULE_NEED_USCORE=1],
+                     [])
+fi
 dnl *** shl_load() in libdld (HP-UX)
 if test -z "$G_MODULE_IMPL"; then
         AC_MSG_CHECKING(how to export all symbols)
@@ -763,6 +806,9 @@ fi
 dnl *** done, have we got an implementation?
 if test -z "$G_MODULE_IMPL"; then
        G_MODULE_IMPL=0
+        G_MODULE_SUPPORTED=false
+else
+        G_MODULE_SUPPORTED=true
 fi
 
 AC_MSG_CHECKING(for the suffix of shared libraries)
@@ -779,6 +825,7 @@ case "$host_os" in
 esac
 AC_MSG_RESULT(.$glib_gmodule_suffix)
  
+AC_SUBST(G_MODULE_SUPPORTED)
 AC_SUBST(G_MODULE_IMPL)
 AC_SUBST(G_MODULE_LIBS)
 AC_SUBST(G_MODULE_LIBS_EXTRA)
@@ -1004,17 +1051,22 @@ if test x"$have_threads" != xnone; then
                G_THREAD_CFLAGS="$G_THREAD_CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
     esac
 
-    # if we are not finding the ctime_r function, then we probably are
+    # if we are not finding the localtime_r function, then we probably are
     # not using the proper multithread flag
 
     glib_save_CPPFLAGS="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS"
 
-    AC_TRY_COMPILE([#include <time.h>],
-       [time_t t; char b[30]; ctime_r (&t, b);], ,
-           [AC_TRY_COMPILE([#include <time.h>],
-               [time_t t; char b[30]; ctime_r (&t, b, 30);], ,
-                       AC_MSG_WARN($FLAG_DOES_NOT_WORK))])
+    # First we test, whether localtime_r is declared in time.h
+    # directly. Then we test whether a macro localtime_r exists, in
+    # which case localtime_r in the test program is replaced and thus
+    # if we still find localtime_r in the output, it is not defined as 
+    # a macro.
+
+    AC_EGREP_CPP([[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]], [#include <time.h>], ,
+      [AC_EGREP_CPP([[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]], [#include <time.h> 
+                                                          localtime_r(a,b)],
+                  AC_MSG_WARN($FLAG_DOES_NOT_WORK))])
 
     CPPFLAGS="$glib_save_CPPFLAGS"
 
@@ -1182,7 +1234,7 @@ if test x"$have_threads" != xnone; then
                else
                        AC_CACHE_CHECK([for nonposix getpwuid_r],
                                ac_cv_func_nonposix_getpwuid_r,
-                               [AC_TRY_COMPILE([#include <pwd.h>],
+                               [AC_TRY_LINK([#include <pwd.h>],
                                        [char buffer[10000];
                                        struct passwd pwd;
                                        getpwuid_r (0, &pwd, buffer, 
@@ -1268,7 +1320,7 @@ if test x"$have_threads" != xnone; then
                          exit (getpid()==other_pid || 
                                $posix_priority_min != $posix_priority_max);
                        }],
-                       [AC_MSG_RESULT(yes),
+                       [AC_MSG_RESULT(yes)
                          AC_DEFINE(G_THREAD_USE_PID_SURROGATE, 1, [whether to use the PID niceness surrogate for thread priorities])
                         ],
                        [AC_MSG_RESULT(no)])
@@ -1483,7 +1535,7 @@ case "$CONFIG_OTHER" in
 #ifndef __G_LIBCONFIG_H__
 #define __G_LIBCONFIG_H__
 
-#include <gmacros.h>
+#include <glib/gmacros.h>
 
 _______EOF
 
@@ -1617,7 +1669,29 @@ $glib_vacopy
 #else  /* !__cplusplus */
 $glib_inline
 #endif /* !__cplusplus */
+
+_______EOF
+
+       if test x$g_have_iso_c_varargs = xyes ; then
+               cat >>$outfile <<_______EOF
+#ifndef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+_______EOF
+       fi
+       if test x$g_have_iso_cxx_varargs = xyes ; then
+               cat >>$outfile <<_______EOF
+#ifdef __cplusplus
+# define G_HAVE_ISO_VARARGS 1
+#endif
+_______EOF
+       fi
+       if test x$g_have_gnuc_varargs = xyes ; then
+               cat >>$outfile <<_______EOF
+
+#define G_HAVE_GNUC_VARARGS 1
 _______EOF
+       fi
 
        echo >>$outfile
        if test x$g_have_eilseq = xno; then
@@ -1899,6 +1973,10 @@ if test x$glib_cv_has__inline__ = xyes; then
 #define G_HAVE___INLINE__ 1"
 fi
 
+g_have_gnuc_varargs=$g_have_gnuc_varargs
+g_have_iso_c_varargs=$g_have_iso_c_varargs
+g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs
+
 case xyes in
 x$ac_cv_c_bigendian)
   g_byte_order=G_BIG_ENDIAN
@@ -1949,29 +2027,30 @@ esac
 
 AC_OUTPUT([
 glib-2.0.pc
-glib-config-2.0
+glib-2.0-uninstalled.pc
 gmodule-2.0.pc
+gmodule-2.0-uninstalled.pc
 gthread-2.0.pc
+gthread-2.0-uninstalled.pc
 gobject-2.0.pc
+gobject-2.0-uninstalled.pc
 glib.spec
 Makefile
 build/Makefile
 build/win32/Makefile
+glib/Makefile
 gmodule/gmoduleconf.h
 gmodule/Makefile
 gobject/Makefile
 gthread/Makefile
 po/Makefile.in
 docs/Makefile
-docs/glib-config.1
 docs/reference/Makefile
 docs/reference/glib/Makefile
 docs/reference/gobject/Makefile
 tests/Makefile
-],[case "$CONFIG_FILES" in
-*glib-config-2.0*)chmod +x glib-config-2.0;;
-esac
-echo ""
+m4macros/Makefile
+],[echo ""
 echo " *** IMPORTANT *** "
 echo ""
 echo "This is a development version of GLib.  You should be using a stable"
@@ -1981,10 +2060,5 @@ echo ""
 echo "  * You should not base stable software on this version of GLib."
 echo "  * GNOME developers should use a stable version of GLib."
 echo ""
-echo "If you install this version of GLib, we strongly recommend that you"
-echo "install it in a different prefix than GLib 1.2.  Use --prefix as an"
-echo "argument to configure to do this.  Otherwise, you will not be able to"
-echo "do development with GLib 1.2 any longer."
-echo ""
 echo " *** You should be using GLib 1.2 instead. ***"
 ])