Remove GUnixVolumeMonitor, GUnixMount from docs
[platform/upstream/glib.git] / configure.in
index 02860f1..bc4e27b 100644 (file)
@@ -23,7 +23,7 @@ m4_define(glib_configure_in)
 #
 m4_define([glib_major_version], [2])
 m4_define([glib_minor_version], [25])
-m4_define([glib_micro_version], [9])
+m4_define([glib_micro_version], [12])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])
@@ -460,14 +460,16 @@ AC_MSG_RESULT($enable_iconv_cache)
 dnl
 dnl zlib support
 dnl
-found_zlib=no
-AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)])
-
+PKG_CHECK_MODULES([ZLIB], [zlib], [found_zlib=yes], [found_zlib=no])
 if test "x$found_zlib" = "xno" ; then
-   AC_MSG_ERROR([*** Working zlib library and headers not found ***])
+  AC_CHECK_LIB(z, inflate, [AC_CHECK_HEADER(zlib.h, found_zlib=yes)])
+  if test "x$found_zlib" = "xno" ; then
+    AC_MSG_ERROR([*** Working zlib library and headers not found ***])
+  fi
+  ZLIB_LIBS='-lz'
+  AC_SUBST(ZLIB_LIBS)
 fi
-ZLIB_LIBS='-lz'
-AC_SUBST(ZLIB_LIBS)
+
 dnl
 dnl gettext support
 dnl
@@ -2732,7 +2734,8 @@ int error = EILSEQ;
 AC_MSG_RESULT($have_eilseq)
 
 dnl ******************************************************************
-dnl *** Look for glib-genmarshal in PATH if we are cross-compiling ***
+dnl *** If we are cross-compiling, look for glib-genmarshal and    ***
+dnl *** glib-compile-schemas in PATH                               ***
 dnl ******************************************************************
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
@@ -2742,13 +2745,18 @@ if test $cross_compiling = yes; then
   if test x$GLIB_GENMARSHAL = xno; then
     AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH)
   fi
+
+  AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas, no)
+  if test x$GLIB_COMPILE_SCHEMAS = xno; then
+    AC_MSG_ERROR(Could not find a glib-compile-schemas in your PATH)
+  fi
 fi
 
 dnl **************************
 dnl *** Checks for gtk-doc ***
 dnl **************************
 
-GTK_DOC_CHECK([1.11])
+GTK_DOC_CHECK([1.15])
 
 AC_ARG_ENABLE(man,
               [AC_HELP_STRING([--enable-man],
@@ -2783,17 +2791,21 @@ AC_ARG_ENABLE([dtrace],
 have_dtrace=no
 AC_MSG_CHECKING([whether to include dtrace tracing support])
 if test "x$enable_dtrace" != xno; then
-  AC_MSG_RESULT([yes])
-  AC_CHECK_PROGS(DTRACE, dtrace)
-  if test -z "$DTRACE"; then
-    if test "x$enable_dtrace" = xyes; then
-      AC_MSG_ERROR([dtrace not found])
+  if test x$glib_have_carbon = xyes; then
+    AC_MSG_RESULT([no (not yet compatible with MacOS dtrace)])
+  else 
+    AC_MSG_RESULT([yes])
+    AC_CHECK_PROGS(DTRACE, dtrace)
+    if test -z "$DTRACE"; then
+      if test "x$enable_dtrace" = xyes; then
+        AC_MSG_ERROR([dtrace not found])
+      fi
     fi
+    AC_CHECK_HEADER([sys/sdt.h],have_dtrace=yes,
+                    [if test "x$enable_dtrace" = xyes; then
+                      AC_MSG_ERROR([dtrace support needs sys/sdt.h header])
+                     fi])
   fi
-  AC_CHECK_HEADER([sys/sdt.h],have_dtrace=yes,
-                  [if test "x$enable_dtrace" = xyes; then
-                     AC_MSG_ERROR([dtrace support needs sys/sdt.h header])
-                   fi])
 else
   AC_MSG_RESULT([no])
 fi
@@ -2825,15 +2837,84 @@ AC_ARG_WITH([tapset-install-dir],
            [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"])
 AC_SUBST(ABS_TAPSET_DIR)
 
+dnl ************************************
+dnl *** Enable lcov coverage reports ***
+dnl ************************************
+
+AC_ARG_ENABLE(gcov,
+  AS_HELP_STRING([--enable-gcov],
+                [Enable gcov]),
+  [use_gcov=$enableval], [use_gcov=no])
+
+if test "x$use_gcov" = "xyes"; then
+  dnl we need gcc:
+  if test "$GCC" != "yes"; then
+    AC_MSG_ERROR([GCC is required for --enable-gcov])
+  fi
+
+  dnl Check if ccache is being used
+  AC_CHECK_PROG(SHTOOL, shtool, shtool)
+  case `$SHTOOL path $CC` in
+    *ccache*[)] gcc_ccache=yes;;
+    *[)] gcc_ccache=no;;
+  esac
+
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+    AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
+  fi
+
+  ltp_version_list="1.6 1.7 1.8"
+  AC_CHECK_PROG(LTP, lcov, lcov)
+  AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
+
+  if test "$LTP"; then
+    AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
+      glib_cv_ltp_version=invalid
+      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
+      for ltp_check_version in $ltp_version_list; do
+        if test "$ltp_version" = "$ltp_check_version"; then
+          glib_cv_ltp_version="$ltp_check_version (ok)"
+        fi
+      done
+    ])
+  else
+    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+    AC_MSG_ERROR([$ltp_msg])
+  fi
+
+  case $glib_cv_ltp_version in
+    ""|invalid[)]
+      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+      AC_MSG_ERROR([$ltp_msg])
+      LTP="exit 0;"
+      ;;
+  esac
+
+  if test -z "$LTP_GENHTML"; then
+    AC_MSG_ERROR([Could not find genhtml from the LTP package])
+  fi
+
+  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
+
+  dnl Remove all optimization flags from CFLAGS
+  changequote({,})
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  changequote([,])
+
+  dnl Add the special gcc flags
+  CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  LDFLAGS="$LDFLAGS -lgcov"
+fi
+
 dnl ******************************
 dnl *** output the whole stuff ***
 dnl ******************************
 
 dnl this section will only be run if config.status is invoked with no
-dnl arguments, or with "glibconfig.h" as an argument.
-AC_CONFIG_COMMANDS([glibconfig.h],
+dnl arguments, or with "glib/glibconfig.h" as an argument.
+AC_CONFIG_COMMANDS([glib/glibconfig.h],
 [
-       outfile=glibconfig.h-tmp
+       outfile=glib/glibconfig.h-tmp
        cat > $outfile <<\_______EOF
 /* glibconfig.h
  *
@@ -3202,11 +3283,11 @@ G_END_DECLS
 _______EOF
 
 
-       if cmp -s $outfile glibconfig.h; then
-         AC_MSG_NOTICE([glibconfig.h is unchanged])
+       if cmp -s $outfile glib/glibconfig.h; then
+         AC_MSG_NOTICE([glib/glibconfig.h is unchanged])
          rm -f $outfile
        else
-         mv $outfile glibconfig.h
+         mv $outfile glib/glibconfig.h
        fi
 ],[
 
@@ -3550,14 +3631,39 @@ fi
 
 # Check for libdbus1 - Optional - is only used in the GDBus test cases
 #
+# 1.2.14 required for dbus_message_set_serial
 PKG_CHECK_MODULES(DBUS1,
-                  dbus-1,
+                  dbus-1 >= 1.2.14,
                   [AC_DEFINE(HAVE_DBUS1, 1, [Define if dbus-1 is available]) have_dbus1=yes],
                   have_dbus1=no)
 AC_SUBST(DBUS1_CFLAGS)
 AC_SUBST(DBUS1_LIBS)
 AM_CONDITIONAL(HAVE_DBUS1, [test "x$have_dbus1" = "xyes"])
 
+dnl
+dnl Check for -Bsymbolic-functions linker flag used to avoid
+dnl intra-library PLT jumps, if available.
+dnl
+
+AC_ARG_ENABLE(Bsymbolic,
+              [AC_HELP_STRING([--disable-Bsymbolic],
+                              [avoid linking with -Bsymbolic])],,
+              [SAVED_LDFLAGS="${LDFLAGS}"
+               AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
+               LDFLAGS=-Wl,-Bsymbolic-functions
+               AC_TRY_LINK([], [int main (void) { return 0; }],
+                           AC_MSG_RESULT(yes)
+                           enable_Bsymbolic=yes,
+                           AC_MSG_RESULT(no)
+                           enable_Bsymbolic=no)
+               LDFLAGS="${SAVED_LDFLAGS}"])
+
+if test "x${enable_Bsymbolic}" == "xyes"; then
+  GLIB_LINK_FLAGS=-Wl,-Bsymbolic-functions
+fi
+
+AC_SUBST(GLIB_LINK_FLAGS)
+
 AC_CONFIG_FILES([
 glib-2.0.pc
 glib-2.0-uninstalled.pc
@@ -3633,7 +3739,7 @@ if false; then
     INSTALL
     README
     config.h.win32
-    glibconfig.h.win32
+    glib/glibconfig.h.win32
     glib/makefile.msc
     glib/glib.rc
     gmodule/makefile.msc