Include dirent.h with doublequotes so that it is searched from this same
[platform/upstream/glib.git] / configure.in
index 336f52d..e9eea58 100644 (file)
@@ -7,10 +7,6 @@ dnl *** include special GLib macros ***
 dnl ***********************************
 
 m4_define(glib_configure_in)
-m4_include(acglib.m4)dnl
-m4_include(glib/libcharset/codeset.m4)dnl
-m4_include(glib/libcharset/glibc21.m4)dnl
-m4_include(m4macros/glib-gettext.m4)dnl
 
 #
 # The following version number definitions apply to GLib, GModule, GObject 
@@ -26,9 +22,9 @@ m4_include(m4macros/glib-gettext.m4)dnl
 # set glib_binary_age _and_ glib_interface_age to 0.
 #
 m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [13])
-m4_define([glib_micro_version], [2])
-m4_define([glib_interface_age], [2])
+m4_define([glib_minor_version], [17])
+m4_define([glib_micro_version], [0])
+m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])
 m4_define([glib_version],
@@ -122,20 +118,19 @@ AC_MSG_CHECKING([for Win32])
 case "$host" in
   *-*-mingw*)
     glib_native_win32=yes
-    GLIB_DEF=glib.def
-    GMODULE_DEF=gmodule.def
-    GOBJECT_DEF=gobject.def
-    GTHREAD_DEF=gthread.def
-    TESTGMODULE_EXP=testgmodule.exp
     glib_pid_type='void *'
+    # Unfortunately the mingw implementations of C99-style snprintf and vsnprintf
+    # don't seem to be quite good enough, at least not in mingw-runtime-3.14.
+    # (Sorry, I don't know exactly what is the problem, but it is related to
+    # floating point formatting and decimal point vs. comma.)
+    # The simple tests in AC_FUNC_VSNPRINTF_C99 and AC_FUNC_SNPRINTF_C99 aren't
+    # rigorous enough to notice, though.
+    # So preset the autoconf cache variables.
+    ac_cv_func_vsnprintf_c99=no
+    ac_cv_func_snprintf_c99=no
     ;;
   *)
     glib_native_win32=no
-    GLIB_DEF=
-    GMODULE_DEF=
-    GOBJECT_DEF=
-    GTHREAD_DEF=
-    TESTGMODULE_EXP=
     glib_pid_type=int
     ;;
 esac
@@ -145,16 +140,21 @@ case $host in
     ;;
 esac
 
-
 AC_MSG_RESULT([$glib_native_win32])
+
+glib_have_carbon=no
+AC_MSG_CHECKING([for Mac OS X Carbon support])
+AC_TRY_CPP([
+#include <Carbon/Carbon.h>
+#include <CoreServices/CoreServices.h>
+], glib_have_carbon=yes)
+
+AC_MSG_RESULT([$glib_have_carbon])
+
 AM_CONDITIONAL(OS_WIN32, [test "$glib_native_win32" = "yes"])
 AM_CONDITIONAL(OS_UNIX, [test "$glib_native_win32" != "yes"])
 AM_CONDITIONAL(OS_LINUX, [test "$glib_os_linux" = "yes"])
-AC_SUBST(GLIB_DEF)
-AC_SUBST(GMODULE_DEF)
-AC_SUBST(GOBJECT_DEF)
-AC_SUBST(GTHREAD_DEF)
-AC_SUBST(TESTGMODULE_EXP)
+AM_CONDITIONAL(OS_CARBON, [test "$glib_have_carbon" = "yes"])
 
 if test "$glib_native_win32" = "yes"; then
   AC_CHECK_TOOL(WINDRES, windres, no)
@@ -180,6 +180,12 @@ else
 fi
 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
 
+if test "x$glib_have_carbon" = "xyes"; then
+  AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
+  LDFLAGS="$LDFLAGS -framework Carbon"
+fi
+
+
 dnl declare --enable-* args and collect ac_help strings
 AC_ARG_ENABLE(debug,
               AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
@@ -212,9 +218,6 @@ if test "x$enable_threads" != "xyes"; then
   enable_threads=no
 fi
 
-AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, ["${enable_debug}"],
-       [Whether glib was compiled with debugging enabled])
-
 AC_MSG_CHECKING([whether to enable garbage collector friendliness])
 if test "x$enable_gc_friendly" = "xyes"; then
   AC_DEFINE(ENABLE_GC_FRIENDLY_DEFAULT, 1, [Whether to enable GC friendliness by default])
@@ -232,17 +235,6 @@ else
   AC_MSG_RESULT([yes])
 fi
 
-if test "$glib_native_win32" = "yes"; then
-  if test x$enable_static = xyes -o x$enable_static = x; then
-    AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
-    enable_static=no
-  fi
-  if test x$enable_shared = xno; then
-    AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
-  fi
-  enable_shared=yes
-fi
-
 dnl Checks for programs.
 AC_PROG_CC
 
@@ -255,6 +247,7 @@ AM_CONDITIONAL(HAVE_CXX, [test "$CXX" != ""])
 AC_LANG_RESTORE
 
 AM_PROG_CC_STDC
+AM_PROG_CC_C_O
 AC_PROG_INSTALL
 
 AC_SYS_LARGEFILE
@@ -267,10 +260,10 @@ if test x$PKG_CONFIG = xno ; then
   AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
 fi
 
-if $PKG_CONFIG --atleast-pkgconfig-version 0.14 ; then
+if $PKG_CONFIG --atleast-pkgconfig-version 0.16 ; then
   :
 else
-  AC_MSG_ERROR([*** pkg-config too old; version 0.14 or better required.])
+  AC_MSG_ERROR([*** pkg-config too old; version 0.16 or better required.])
 fi
 
 if test "x$enable_debug" = "xyes"; then
@@ -328,6 +321,8 @@ if test x"$glib_native_win32" = xyes; then
     fi
   fi
 fi
+GLIB_EXTRA_CFLAGS="${msnative_struct}"
+AC_SUBST(GLIB_EXTRA_CFLAGS)
 
 AC_EXEEXT
 
@@ -350,49 +345,60 @@ AC_SUBST(REBUILD)
 #
 if test "x$PERL" != x ; then
   AC_PATH_PROG(PERL_PATH, [$PERL])
-else
+fi
+if test "x$PERL_PATH" = x ; then
   PERL_PATH="/usr/bin/env perl"
 fi
 AC_SUBST(PERL_PATH)
 
+# Need suitable python path for greport
+AM_PATH_PYTHON(2.4,,PYTHON="/usr/bin/env python2.4")
+
+
 dnl ***********************
 dnl *** Tests for iconv ***
 dnl ***********************
 dnl
 dnl We do this before the gettext checks, to avoid distortion
 
-AC_ARG_WITH(libiconv,
-            [AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
-                            [use the libiconv library])],,
-           [with_libiconv=maybe])
+dnl On Windows we use a native implementation
 
-found_iconv=no
-case $with_libiconv in
-  maybe)
-    # Check in the C library first
-    AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
-    # Check if we have GNU libiconv
-    if test $found_iconv = "no"; then
+if test x"$glib_native_win32" = xyes; then
+  with_libiconv=native
+else
+  AC_ARG_WITH(libiconv,
+             [AC_HELP_STRING([--with-libiconv=@<:@no/gnu/native@:>@],
+                             [use the libiconv library])],,
+             [with_libiconv=maybe])
+
+  found_iconv=no
+  case $with_libiconv in
+    maybe)
+      # Check in the C library first
+      AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
+      # Check if we have GNU libiconv
+      if test $found_iconv = "no"; then
+       AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
+      fi
+      # Check if we have a iconv in -liconv, possibly from vendor
+      if test $found_iconv = "no"; then
+       AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
+      fi
+      ;;
+    no)
+      AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
+      ;;
+    gnu|yes)
       AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
-    fi
-    # Check if we have a iconv in -liconv, possibly from vendor
-    if test $found_iconv = "no"; then
+      ;;
+    native)
       AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
-    fi
-    ;;
-  no)
-    AC_CHECK_FUNC(iconv_open, [with_libiconv=no; found_iconv=yes])
-    ;;
-  gnu|yes)
-    AC_CHECK_LIB(iconv, libiconv_open, [with_libiconv=gnu; found_iconv=yes])
-    ;;
-  native)
-    AC_CHECK_LIB(iconv, iconv_open, [with_libiconv=native; found_iconv=yes])
-    ;;
-esac
+      ;;
+  esac
 
-if test "x$found_iconv" = "xno" ; then
-   AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
+  if test "x$found_iconv" = "xno" ; then
+     AC_MSG_ERROR([*** No iconv() implementation found in C library or libiconv])
+  fi
 fi
 
 jm_GLIBC21
@@ -427,7 +433,7 @@ dnl
 dnl gettext support
 dnl
 
-ALL_LINGUAS="am ar az be be@latin bg bn bn_IN bs ca cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ka ko ku lt lv mg mk ml mn ms nb ne nl nn or pa pl pt pt_BR ro ru rw sk sl sq sr sr@Latn sr@ije sv ta te th tl tr tt uk vi wa xh yi zh_CN zh_HK zh_TW"
+ALL_LINGUAS="am ar as az be be@latin bg bn bn_IN bs ca cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ka kn ko ku lt lv mg mk ml mn mr ms nb ne nl nn oc or pa pl pt pt_BR ro ru rw si sk sl sq sr sr@Latn sr@ije sv ta te th tl tr tt uk vi wa xh yi zh_CN zh_HK zh_TW"
 GLIB_GNU_GETTEXT
 
 if test "$gt_cv_have_gettext" != "yes" ; then
@@ -450,11 +456,13 @@ dnl
 dnl Now we are done with gettext checks, figure out ICONV_LIBS
 dnl
 
-if test x$with_libiconv != xno ; then
-  case " $INTLLIBS " in
-  *[[\ \       ]]-liconv[[\ \  ]]*) ;;
-  *) ICONV_LIBS="-liconv" ;;
-  esac
+if test x"$glib_native_win32" != xyes; then
+  if test x$with_libiconv != xno ; then
+    case " $INTLLIBS " in
+    *[[\ \     ]]-liconv[[\ \  ]]*) ;;
+    *) ICONV_LIBS="-liconv" ;;
+    esac
+  fi
 fi
 AC_SUBST(ICONV_LIBS)
 
@@ -479,6 +487,19 @@ if test "x$GCC" = "xyes"; then
   esac
 fi
 
+if test "$glib_native_win32" = "yes"; then
+  if test x$enable_static = xyes -a x$enable_shared = xyes; then
+    AC_MSG_ERROR([Can not build both shared and static at the same time on Windows.])
+  fi
+  if test x$enable_static = xyes; then
+    glib_win32_static_compilation=yes
+    GLIB_WIN32_STATIC_COMPILATION_DEFINE="#define GLIB_STATIC_COMPILATION 1
+#define GOBJECT_STATIC_COMPILATION 1"
+    AC_SUBST(GLIB_WIN32_STATIC_COMPILATION_DEFINE)
+  fi
+fi
+AM_CONDITIONAL(OS_WIN32_AND_DLL_COMPILATION, [test x$glib_native_win32 = xyes -a x$glib_win32_static_compilation != xyes])
+
 dnl
 dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R)
 dnl
@@ -528,7 +549,7 @@ AC_CHECK_FUNCS(valloc)
 
 AC_CHECK_FUNCS(atexit on_exit)
 
-AC_CHECK_FUNCS(timegm)
+AC_CHECK_FUNCS(timegm gmtime_r)
 
 AC_CHECK_SIZEOF(char)
 AC_CHECK_SIZEOF(short)
@@ -799,9 +820,23 @@ AM_CONDITIONAL(HAVE_SUNSTUDIO_VISIBILITY, [test x$g_have_sunstudio_visibility =
 AC_C_BIGENDIAN
 
 # check for header files
-AC_CHECK_HEADERS([dirent.h float.h limits.h pwd.h sys/param.h sys/poll.h])
+AC_CHECK_HEADERS([dirent.h float.h limits.h pwd.h grp.h sys/param.h sys/poll.h sys/resource.h])
 AC_CHECK_HEADERS([sys/time.h sys/times.h sys/wait.h unistd.h values.h])
 AC_CHECK_HEADERS([sys/select.h sys/types.h stdint.h sched.h malloc.h])
+AC_CHECK_HEADERS([sys/vfs.h sys/mount.h sys/vmount.h sys/statfs.h sys/statvfs.h])
+AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h sys/sysctl.h fstab.h])
+
+# check for structure fields
+AC_CHECK_MEMBERS([struct stat.st_mtimensec, struct stat.st_mtim.tv_nsec, struct stat.st_atimensec, struct stat.st_atim.tv_nsec, struct stat.st_ctimensec, struct stat.st_ctim.tv_nsec])
+AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct statfs.f_fstypename],,, [#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif])
 
 # Checks for libcharset
 jm_LANGINFO_CODESET
@@ -865,6 +900,8 @@ AC_MSG_RESULT(unsigned $glib_size_type)
 
 # Check for some functions
 AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk)
+AC_CHECK_FUNCS(chown lchown fchmod fchown link statvfs statfs utimes getgrgid getpwuid)
+AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo)
 # Check for high-resolution sleep functions
 AC_CHECK_FUNCS(nanosleep nsleep)
 
@@ -874,6 +911,47 @@ AC_CHECK_FUNCS(_NSGetEnviron)
 AC_FUNC_VSNPRINTF_C99
 AC_FUNC_PRINTF_UNIX98
 
+dnl
+dnl if statfs() takes 2 arguments (Posix) or 4 (Solaris)
+dnl
+if test "$ac_cv_func_statfs" = yes ; then
+  AC_MSG_CHECKING([number of arguments to statfs()])
+  AC_TRY_COMPILE([#include <unistd.h>
+  #ifdef HAVE_SYS_PARAM_H
+  #include <sys/param.h>
+  #endif
+  #ifdef HAVE_SYS_VFS_H
+  #include <sys/vfs.h>
+  #endif
+  #ifdef HAVE_SYS_MOUNT_H
+  #include <sys/mount.h>
+  #endif
+  #ifdef HAVE_SYS_STATFS_H
+  #include <sys/statfs.h>
+  #endif], [struct statfs st;
+  statfs(NULL, &st);],[
+    AC_MSG_RESULT([2])
+    AC_DEFINE(STATFS_ARGS, 2, [Number of arguments to statfs()])],[
+    AC_TRY_COMPILE([#include <unistd.h>
+  #ifdef HAVE_SYS_PARAM_H
+  #include <sys/param.h>
+  #endif
+  #ifdef HAVE_SYS_VFS_H
+  #include <sys/vfs.h>
+  #endif
+  #ifdef HAVE_SYS_MOUNT_H
+  #include <sys/mount.h>
+  #endif
+  #ifdef HAVE_SYS_STATFS_H
+  #include <sys/statfs.h>
+  #endif], [struct statfs st;
+  statfs(NULL, &st, sizeof (st), 0);],[
+      AC_MSG_RESULT([4])
+      AC_DEFINE(STATFS_ARGS, 4, [Number of arguments to statfs()])],[
+      AC_MSG_RESULT(unknown)
+      AC_MSG_ERROR([unable to determine number of arguments to statfs()])])])
+fi
+
 #
 # Check whether to use an included printf
 #
@@ -1376,6 +1454,150 @@ esac
 AC_MSG_RESULT($GIO)
 AC_SUBST(GIO)
 
+dnl *********************************
+dnl *** Directory for GIO modules ***
+dnl *********************************
+
+AC_ARG_WITH(gio-module-dir,
+           [AC_HELP_STRING([--with-gio-module-dir=PATH],
+                           [Load gio modules from this directory [LIBDIR/gio/modules]])],
+           [],
+          [with_gio_module_dir='${libdir}/gio/modules'])
+GIO_MODULE_DIR=$with_gio_module_dir
+AC_SUBST(GIO_MODULE_DIR)
+
+dnl **********************************
+dnl *** Check for libselinux (GIO) ***
+dnl **********************************
+AC_ARG_ENABLE(selinux, [  --disable-selinux       build without selinux support])
+msg_selinux=no
+SELINUX_LIBS=
+if test "x$enable_selinux" != "xno"; then
+
+ AC_CHECK_LIB(selinux, is_selinux_enabled,
+   [AC_CHECK_HEADERS(selinux/selinux.h,
+     [AC_SEARCH_LIBS(lgetfilecon_raw, selinux, 
+       [AC_DEFINE(HAVE_SELINUX, 1, [Define to 1 if libselinux is available])
+        SELINUX_LIBS="-lselinux"
+        msg_selinux=yes])
+     ])
+   ])
+fi
+AC_SUBST(SELINUX_LIBS)
+
+dnl *****************************
+dnl ** Check for inotify (GIO) **
+dnl *****************************
+inotify_support=no
+AC_CHECK_HEADERS([sys/inotify.h],
+[
+       inotify_support=yes
+])
+
+AM_CONDITIONAL(HAVE_INOTIFY, [test "$inotify_support" = "yes"])
+
+dnl *********************************
+dnl ** Check for Solaris FEN (GIO) **
+dnl *********************************
+fen_support=no
+AC_COMPILE_IFELSE([ 
+#include <port.h> 
+#ifndef PORT_SOURCE_FILE 
+#error "Please upgrade to Nevada 72 or above to suppoert FEN" 
+#endif 
+int main() { return 0; } ],
+[
+       fen_support=yes
+],)
+
+AM_CONDITIONAL(HAVE_FEN, [test "$fen_support" = "yes"])
+
+dnl ****************************
+dnl *** Checks for FAM (GIO) ***
+dnl ****************************
+
+should_disable_fam=no
+
+AC_ARG_ENABLE(fam, [  --disable-fam          build without enabling fam for file system monitoring],
+                         [
+                                if test "x$enable_fam" = "xno"; then
+                                        should_disable_fam=yes
+                                        echo "Not building FAM support"
+                                fi
+                         ]
+                         )
+fam_support=no
+FAM_LIBS=
+if test "x$should_disable_fam" = "xno"; then
+AC_CHECK_LIB(fam, FAMOpen,
+  [AC_CHECK_HEADERS(fam.h,
+    [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
+     AC_CHECK_LIB(fam, FAMNoExists,
+                 AC_DEFINE(HAVE_FAM_NO_EXISTS, [], [Define if we have FAMNoExists in fam]))
+     FAM_LIBS="-lfam"]
+     fam_support=yes,
+    AC_MSG_WARN(*** FAM support will not be built (header files not found) ***))],
+  AC_MSG_WARN(*** FAM support will not be built (FAM library not found) ***))
+AC_SUBST(FAM_LIBS)
+fi
+AM_CONDITIONAL(HAVE_FAM, [test "$fam_support" = "yes"])
+
+
+dnl *****************************
+dnl *** Check for xattr (GIO) ***
+dnl *****************************
+AC_ARG_ENABLE(xattr, [  --disable-xattr           build without xattr support])
+msg_xattr=no
+XATTR_LIBS=
+if test "x$enable_xattr" != "xno"; then
+
+dnl either glibc or libattr can provide xattr support
+
+dnl for both of them, we check for getxattr being in
+dnl the library and a valid xattr header.
+
+dnl try glibc
+ AC_CHECK_LIB(c, getxattr,
+   [AC_CHECK_HEADERS(sys/xattr.h,
+     [AC_DEFINE(HAVE_XATTR, 1, [Define to 1 if xattr is available])
+      msg_xattr=yes])
+   ])
+
+  if test "x$msg_xattr" != "xyes"; then
+dnl   failure. try libattr
+   AC_CHECK_LIB(attr, getxattr,
+      [AC_CHECK_HEADERS(attr/xattr.h,
+       [AC_DEFINE(HAVE_XATTR, 1, [Define to 1 if xattr is available])
+        XATTR_LIBS="-lattr"
+        msg_xattr=yes])
+      ])
+  fi
+
+  if test "x$msg_xattr" = "xyes"; then
+    AC_MSG_CHECKING([for XATTR_NOFOLLOW])
+    AC_TRY_COMPILE([
+      #include <stdio.h>
+      #ifdef HAVE_SYS_TYPES_H
+      #include <sys/types.h>
+      #endif
+      #ifdef HAVE_SYS_XATTR_H
+      #include <sys/xattr.h>
+      #elif HAVE_ATTR_XATTR_H
+      #include <attr/xattr.h>
+      #endif
+    ],
+    [ssize_t len = getxattr("", "", NULL, 0, 0, XATTR_NOFOLLOW);],
+    [
+      AC_DEFINE([HAVE_XATTR_NOFOLLOW], [1], [Define to 1 if xattr API uses XATTR_NOFOLLOW])
+      AC_MSG_RESULT([yes])
+    ],
+    [AC_MSG_RESULT([no])]
+    )
+  fi
+
+fi
+AC_SUBST(XATTR_LIBS)
+
 dnl ****************************************
 dnl *** platform dependent source checks ***
 dnl ****************************************
@@ -1809,7 +2031,7 @@ if test x"$have_threads" != xno; then
        # we are not doing the following for now, as this might require glib 
        # to always be linked with the thread libs on some platforms. 
        # LIBS="$LIBS $G_THREAD_LIBS"
-       AC_CHECK_FUNCS(localtime_r)
+       AC_CHECK_FUNCS(localtime_r gmtime_r)
        if test "$ac_cv_header_pwd_h" = "yes"; then
                AC_CACHE_CHECK([for posix getpwuid_r],
                        ac_cv_func_posix_getpwuid_r,
@@ -1849,6 +2071,45 @@ int main () {
                        fi
                fi
        fi
+       if test "$ac_cv_header_grp_h" = "yes"; then
+               AC_CACHE_CHECK([for posix getgrgid_r],
+                       ac_cv_func_posix_getgrgid_r,
+                       [AC_TRY_RUN([
+#include <errno.h>
+#include <grp.h>
+int main () { 
+    char buffer[10000];
+    struct group grp, *grpptr = &grp;
+    int error;
+    errno = 0;
+    error = getgrgid_r (0, &grp, buffer, 
+                        sizeof (buffer), &grpptr);
+   return (error < 0 && errno == ENOSYS) 
+          || error == ENOSYS; 
+}                              ],
+                              [ac_cv_func_posix_getgrgid_r=yes],
+                              [ac_cv_func_posix_getgrgid_r=no])])
+               GLIB_ASSERT_SET(ac_cv_func_posix_getgrgid_r)
+               if test "$ac_cv_func_posix_getgrgid_r" = yes; then
+                       AC_DEFINE(HAVE_POSIX_GETGRGID_R,1,
+                               [Have POSIX function getgrgid_r])
+               else
+                       AC_CACHE_CHECK([for nonposix getgrgid_r],
+                               ac_cv_func_nonposix_getgrgid_r,
+                               [AC_TRY_LINK([#include <grp.h>],
+                                               [char buffer[10000];
+                                       struct group grp;       
+                                       getgrgid_r (0, &grp, buffer, 
+                                               sizeof (buffer));],
+                               [ac_cv_func_nonposix_getgrgid_r=yes],
+                               [ac_cv_func_nonposix_getgrgid_r=no])])
+                       GLIB_ASSERT_SET(ac_cv_func_nonposix_getgrgid_r)
+                       if test "$ac_cv_func_nonposix_getgrgid_r" = yes; then
+                               AC_DEFINE(HAVE_NONPOSIX_GETGRGID_R,1,
+                                       [Have non-POSIX function getgrgid_r])
+                       fi
+               fi
+       fi
        LIBS="$G_THREAD_LIBS $LIBS"
        if test x"$have_threads" = xposix; then
                glib_save_CPPFLAGS="$CPPFLAGS"
@@ -1947,9 +2208,10 @@ fi
 # 
 #  a) GCC < 3.3 for Linux doesn't include -lpthread when
 #     building shared libraries with linux.
+#  b) FreeBSD doesn't do this either.
 #
 case $host in
-  *-*-linux*)
+  *-*-freebsd*|*-*-linux*)
     G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
     ;;
   *)    
@@ -2070,6 +2332,17 @@ if test x"$GCC" = xyes; then
       AC_DEFINE_UNQUOTED(G_ATOMIC_POWERPC, 1,
                         [powerpc atomic implementation])
       glib_memory_barrier_needed=yes
+      AC_MSG_CHECKING([whether asm supports numbered local labels])
+      AC_TRY_COMPILE(
+               ,[ 
+                       __asm__ __volatile__ ("1:       nop\n"
+                                             "         bne-    1b")
+               ],[
+                       AC_DEFINE_UNQUOTED(ASM_NUMERIC_LABELS, 1, [define if asm blocks can use numeric local labels])
+                       AC_MSG_RESULT([yes])
+               ],[
+                       AC_MSG_RESULT([no])
+               ])
       ;;       
     ia64)
       AC_MSG_RESULT([ia64])
@@ -2083,6 +2356,12 @@ if test x"$GCC" = xyes; then
                         [s390 atomic implementation])
       glib_memory_barrier_needed=no
       ;;       
+    arm*)
+      AC_MSG_RESULT([arm])
+      AC_DEFINE_UNQUOTED(G_ATOMIC_ARM, 1,
+                         [arm atomic implementation])
+      glib_memory_barrier_needed=no
+      ;;
     *)
       AC_MSG_RESULT([none])
       glib_memory_barrier_needed=yes
@@ -2149,7 +2428,7 @@ AC_MSG_RESULT($broken_poll)
 dnl *********************
 dnl *** GRegex checks ***
 dnl *********************
-PCRE_REQUIRED_VERSION=7.0
+PCRE_REQUIRED_VERSION=7.2
 
 # Check if we should compile GRegex
 AC_ARG_ENABLE(regex, AC_HELP_STRING([--disable-regex],
@@ -2176,7 +2455,9 @@ if test x$enable_regex = xtrue; then
     PKG_CHECK_MODULES(PCRE,
                       libpcre >= $PCRE_REQUIRED_VERSION)
     AC_CACHE_CHECK([for Unicode support in PCRE],glib_cv_pcre_has_unicode,[
-                   CFLAGS="$CFLAGS $PCRE_CFLAGS" LDFLAGS="$LDFLAGS $PCRE_LIBS"
+                   glib_save_CFLAGS="$CFLAGS"
+                   glib_save_LIBS="$LIBS"
+                   CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS"
                    AC_TRY_RUN([#include <pcre.h>
                                int main () {
                                  int support;
@@ -2190,23 +2471,27 @@ if test x$enable_regex = xtrue; then
                                }],
                    glib_cv_pcre_has_unicode=yes,
                    glib_cv_pcre_has_unicode=no,
-                   glib_cv_pcre_has_unicode=yes)])
+                   glib_cv_pcre_has_unicode=yes)
+                   CFLAGS="$glib_save_CFLAGS"
+                   LIBS="$glib_save_LIBS"
+       ])
     if test "$glib_cv_pcre_has_unicode" = "no"; then
       AC_MSG_ERROR([*** The system-supplied PCRE does not support Unicode properties or UTF-8.])
     fi
     AC_SUBST(PCRE_CFLAGS)
     AC_SUBST(PCRE_LIBS)
     AC_DEFINE(USE_SYSTEM_PCRE, [], [using the system-supplied PCRE library])
+    PCRE_REQUIRES=libpcre
+    AC_SUBST(PCRE_REQUIRES)
   else
     # If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE
     if test x"$GCC" = xyes; then
-      AC_MSG_CHECKING([whether gcc understands -Wno-pointer-sign])
-      if test [`$CC --version | sed -e 's/[^0-9]*\([0-9]\).*/\1/' -e q`] -ge 4; then
-        PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
-        AC_MSG_RESULT([yes]) 
-      else
-        AC_MSG_RESULT([no]) 
-      fi
+      AC_MSG_CHECKING([whether compiler understands -Wno-pointer-sign])
+      save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Wno-pointer-sign"
+      AC_TRY_COMPILE([],[],[PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign"
+                           AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+      CFLAGS="$save_CFLAGS"
     fi
   fi
   AC_SUBST(PCRE_WARN_CFLAGS)
@@ -2260,7 +2545,7 @@ dnl **************************
 dnl *** Checks for gtk-doc ***
 dnl **************************
 
-GTK_DOC_CHECK([1.4])
+GTK_DOC_CHECK([1.8])
 
 AC_ARG_ENABLE(man,
               [AC_HELP_STRING([--enable-man],
@@ -2412,6 +2697,13 @@ typedef unsigned $glib_size_type_define gsize;
 #define G_GSIZE_FORMAT $gsize_format
 
 #define G_MAXSIZE      G_MAXU$glib_msize_type
+#define G_MINSSIZE     G_MIN$glib_msize_type
+#define G_MAXSSIZE     G_MAX$glib_msize_type
+
+typedef gint64 goffset;
+#define G_MINOFFSET    G_MININT64
+#define G_MAXOFFSET    G_MAXINT64
+
 _______EOF
 
        if test -z "$glib_unknown_void_p"; then
@@ -2434,6 +2726,7 @@ $glib_atexit
 $glib_memmove
 $glib_defines
 $glib_os
+$glib_static_compilation
 
 $glib_vacopy
 
@@ -2508,26 +2801,20 @@ _______EOF
 
        fi
 
-       if test x$g_have_gnuc_visibility = xyes ; then
+       if test x$g_have_gnuc_visibility = xyes; then
                cat >>$outfile <<_______EOF
-#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
-#define G_GNUC_INTERNAL
-#else
 #define G_HAVE_GNUC_VISIBILITY 1
-#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
-#endif
-_______EOF
-        else
-          if test x$g_have_sunstudio_visibility = xyes ; then
-                cat >>$outfile <<_______EOF
-#define G_GNUC_INTERNAL __hidden
 _______EOF
-          else
+       fi
                cat >>$outfile <<_______EOF
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define G_GNUC_INTERNAL __hidden
+#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY)
+#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
+#else
 #define G_GNUC_INTERNAL
+#endif
 _______EOF
-         fi
-       fi
 
 
        echo >>$outfile
@@ -2547,9 +2834,15 @@ struct _GStaticMutex
   } static_mutex;
 };
 #define        G_STATIC_MUTEX_INIT     { NULL, { { $g_mutex_contents} } }
+#ifdef __cplusplus
 #define        g_static_mutex_get_mutex(mutex) \\
   (g_thread_use_default_impl ? ((GMutex*) ((mutex)->static_mutex.pad)) : \\
    g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+#else
+#define        g_static_mutex_get_mutex(mutex) \\
+  (g_thread_use_default_impl ? ((GMutex*) (void*) ((mutex)->static_mutex.pad)) : \\
+   g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex)))
+#endif
 _______EOF
        else
                cat >>$outfile <<_______EOF
@@ -2912,6 +3205,11 @@ case $host in
     glib_os="#define G_OS_UNIX"
     ;;
 esac
+glib_static_compilation=""
+if test x$glib_win32_static_compilation = xyes; then
+  glib_static_compilation="#define GLIB_STATIC_COMPILATION 1
+#define GOBJECT_STATIC_COMPILATION 1"
+fi
 ])
 
 AC_CONFIG_FILES([
@@ -2926,6 +3224,10 @@ gthread-2.0.pc
 gthread-2.0-uninstalled.pc
 gobject-2.0.pc
 gobject-2.0-uninstalled.pc
+gio-2.0.pc
+gio-unix-2.0.pc
+gio-2.0-uninstalled.pc
+gio-unix-2.0-uninstalled.pc
 glib-zip
 glib-gettextize
 Makefile
@@ -2938,11 +3240,20 @@ glib/libcharset/Makefile
 glib/gnulib/Makefile
 glib/pcre/Makefile
 glib/update-pcre/Makefile
+glib/tests/Makefile
 gmodule/Makefile
 gmodule/gmoduleconf.h
 gobject/Makefile
 gobject/glib-mkenums
+gobject/tests/Makefile
 gthread/Makefile
+gio/Makefile
+gio/xdgmime/Makefile
+gio/inotify/Makefile
+gio/fen/Makefile
+gio/fam/Makefile
+gio/win32/Makefile
+gio/tests/Makefile
 po/Makefile.in
 docs/Makefile
 docs/reference/Makefile
@@ -2950,6 +3261,8 @@ docs/reference/glib/Makefile
 docs/reference/glib/version.xml
 docs/reference/gobject/Makefile
 docs/reference/gobject/version.xml
+docs/reference/gio/Makefile
+docs/reference/gio/version.xml
 tests/Makefile
 tests/gobject/Makefile
 tests/refcount/Makefile