Include dirent.h with doublequotes so that it is searched from this same
[platform/upstream/glib.git] / configure.in
index f7734d9..e9eea58 100644 (file)
@@ -22,8 +22,8 @@ m4_define(glib_configure_in)
 # set glib_binary_age _and_ glib_interface_age to 0.
 #
 m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [15])
-m4_define([glib_micro_version], [5])
+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)])
@@ -118,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
@@ -156,11 +155,6 @@ 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"])
 AM_CONDITIONAL(OS_CARBON, [test "$glib_have_carbon" = "yes"])
-AC_SUBST(GLIB_DEF)
-AC_SUBST(GMODULE_DEF)
-AC_SUBST(GOBJECT_DEF)
-AC_SUBST(GTHREAD_DEF)
-AC_SUBST(TESTGMODULE_EXP)
 
 if test "$glib_native_win32" = "yes"; then
   AC_CHECK_TOOL(WINDRES, windres, no)
@@ -241,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
 
@@ -338,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
 
@@ -502,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
@@ -551,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)
@@ -830,7 +828,15 @@ AC_CHECK_HEADERS([mntent.h sys/mnttab.h sys/vfstab.h sys/mntctl.h sys/sysctl.h f
 
 # 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])
+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
@@ -895,7 +901,7 @@ 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(setmntent endmntent hasmntopt getmntinfo)
+AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getmntinfo)
 # Check for high-resolution sleep functions
 AC_CHECK_FUNCS(nanosleep nsleep)
 
@@ -1490,6 +1496,22 @@ AC_CHECK_HEADERS([sys/inotify.h],
 
 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 ****************************
@@ -2704,6 +2726,7 @@ $glib_atexit
 $glib_memmove
 $glib_defines
 $glib_os
+$glib_static_compilation
 
 $glib_vacopy
 
@@ -2811,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
@@ -3176,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([
@@ -3211,11 +3245,14 @@ 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