]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
OVT: require glib2 >= 2.14 and disable 'deprecated-declarations' warnings
authorVMware, Inc <>
Wed, 17 Apr 2013 19:23:10 +0000 (12:23 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 17 Apr 2013 21:30:29 +0000 (14:30 -0700)
Internally we are using 2.14.2 on FreeBSD, 2.16.4 on Solaris, and
2.24.2 on Linux, so let's stop pretending that we work with earlier
versions. RHEL5 with 2.12 hasn't been compiling for a while and even
if it would it would have reduced functionality as glib_regexp would
not be available. FreeBSD started packaging glib2 2.22 starting with 7.1.

Also, mutex API in Glib2 is a mess, they keep changing and deprecating
it, so for now simply add -Wnoerror=deprecated-declarations to avoid
build errors.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/configure.ac
open-vm-tools/services/plugins/vix/vixTools.c

index 0fb3dc918602537b5a7a082c46d0fdfa0c9efa6d..7c84f0a7c3e15f1dd5c47cdefec9e98375958470 100644 (file)
@@ -293,44 +293,45 @@ if test "$have_libintl" = "no"; then
 fi
 
 #
-# Check for glib 2.6.0 or greater.
+# Check for glib 2.6.14 or greater.
 #
 AC_VMW_CHECK_LIB([glib-2.0],
                  [GLIB2],
                  [glib-2.0],
                  [],
-                 [2.6.0],
+                 [2.14.0],
                  [glib.h],
                  [g_key_file_new],
                  [],
-                 [AC_MSG_ERROR([glib >= 2.6.0 is required.])])
+                 [AC_MSG_ERROR([glib2 >= 2.14.0 is required.])])
+
 AC_VMW_CHECK_LIB([gmodule-2.0],
                  [GMODULE],
                  [gmodule-2.0],
                  [],
-                 [2.6.0],
+                 [2.14.0],
                  [],
                  [],
                  [],
-                 [AC_MSG_ERROR([gmodule >= 2.6.0 is required.])])
+                 [AC_MSG_ERROR([gmodule >= 2.14.0 is required.])])
 AC_VMW_CHECK_LIB([gobject-2.0],
                  [GOBJECT],
                  [gobject-2.0],
                  [],
-                 [2.6.0],
+                 [2.14.0],
                  [glib-object.h],
                  [],
                  [],
-                 [AC_MSG_ERROR([gobject >= 2.6.0 is required.])])
+                 [AC_MSG_ERROR([gobject >= 2.14.0 is required.])])
 AC_VMW_CHECK_LIB([gthread-2.0],
                  [GTHREAD],
                  [gthread-2.0],
                  [],
-                 [2.6.0],
+                 [2.14.0],
                  [],
                  [],
                  [],
-                 [AC_MSG_ERROR([glib >= 2.6.0 is required.])])
+                 [AC_MSG_ERROR([glib >= 2.14.0 is required.])])
 AC_CHECK_PROG([have_genmarshal],
               [glib-genmarshal],
               [yes],
@@ -340,21 +341,6 @@ if test "$have_genmarshal" != "yes"; then
    AC_MSG_ERROR([glib-genmarshal is required; make sure it's available in your path.])
 fi
 
-#
-# Parts of our Linux code require more recent version of glib
-#
-if test "$os" = "linux"; then
-   AC_VMW_CHECK_LIB([glib-2.0],
-                    [GLIB2],
-                    [glib-2.0],
-                    [],
-                    [2.14.0],
-                    [glib.h],
-                    [g_regex_new],
-                    [have_glib_2_14=yes],
-                    [AC_MSG_WARN([glib is not recent enough, some features will be disabled.])])
-fi
-
 #
 # Check for fuse.
 #
@@ -857,9 +843,12 @@ AC_C_VOLATILE
 CFLAGS="$CFLAGS -Wall"
 CFLAGS="$CFLAGS -Werror"
 
-# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
+# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident'
+# in Xlib.h on OpenSolaris.
+# Glib2 keep changing mutex APIs so we also need to disable 'deprecated'
+# warnings for now (-Wno-deprecated-declarations).
 for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
-    -Wno-unknown-pragmas -Wno-uninitialized; do
+    -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do
     AC_MSG_CHECKING([for GCC flag $TEST_CFLAG])
     ORIGINAL_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $TEST_CFLAG"
@@ -950,10 +939,6 @@ TARGET_OS="$os"
 MODULES_DIR=""
 buildHgfsmounter=no
 
-if test "$have_glib_2_14" = "yes"; then
-   CPPFLAGS="$CPPFLAGS -DHAVE_GLIB_REGEX"
-fi
-
 if test "$os" = "linux"; then
    MODULES_DIR="$LINUXDIR/kernel/"
 
@@ -1063,7 +1048,7 @@ AM_CONDITIONAL(HAVE_FUSE, test "$have_fuse" = "yes")
 AM_CONDITIONAL(HAVE_GNU_LD, test "$with_gnu_ld" = "yes")
 AM_CONDITIONAL(HAVE_GTKMM, test "$have_x" = "yes" -a "$with_gtkmm" = "yes")
 AM_CONDITIONAL(HAVE_PAM, test "$with_pam" = "yes")
-AM_CONDITIONAL(USE_SLASH_PROC, test "os" = "linux" -a "$have_glib_2_14" = "yes")
+AM_CONDITIONAL(USE_SLASH_PROC, test "os" = "linux")
 AM_CONDITIONAL(USE_PRINTF_WRAPPERS, test "$bsdPrintfWrappers" = "yes")
 
 if test "$have_xsm" != "yes"; then
index 633bdeef708b6033e038f80ce3e046f71223cdfe..654a43958e9d021ac48db41de39e083bc794f65d 100644 (file)
@@ -412,9 +412,7 @@ static const char *fileInfoFormatString = "<FileInfo>"
                                           "<ModTime>%"FMT64"d</ModTime>"
                                           "</FileInfo>";
 
-#if !defined(OPEN_VM_TOOLS) || defined(HAVE_GLIB_REGEX)
 static const char *listFilesRemainingFormatString = "<rem>%d</rem>";
-#endif
 
 #ifdef _WIN32
 static const char *fileExtendedInfoWindowsFormatString = "<fxi>"
@@ -5961,7 +5959,6 @@ VixToolsListFiles(VixCommandRequestHeader *requestMsg,    // IN
                   size_t maxBufferSize,                   // IN
                   char **result)                          // OUT
 {
-#if !defined(OPEN_VM_TOOLS) || defined(HAVE_GLIB_REGEX)
    VixError err = VIX_OK;
    const char *dirPathName = NULL;
    char *fileList = NULL;
@@ -6210,9 +6207,6 @@ abort:
    }
 
    return err;
-#else
-   return VIX_E_NOT_SUPPORTED;
-#endif
 } // VixToolsListFiles