From: VMware, Inc <> Date: Wed, 17 Apr 2013 19:23:10 +0000 (-0700) Subject: OVT: require glib2 >= 2.14 and disable 'deprecated-declarations' warnings X-Git-Tag: 2013.04.16-1098359~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=867ea989d5e6889abcac77b4c7dae7db2651df58;p=thirdparty%2Fopen-vm-tools.git OVT: require glib2 >= 2.14 and disable 'deprecated-declarations' warnings 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 --- diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index 0fb3dc918..7c84f0a7c 100644 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -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 diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c index 633bdeef7..654a43958 100644 --- a/open-vm-tools/services/plugins/vix/vixTools.c +++ b/open-vm-tools/services/plugins/vix/vixTools.c @@ -412,9 +412,7 @@ static const char *fileInfoFormatString = "" "%"FMT64"d" ""; -#if !defined(OPEN_VM_TOOLS) || defined(HAVE_GLIB_REGEX) static const char *listFilesRemainingFormatString = "%d"; -#endif #ifdef _WIN32 static const char *fileExtendedInfoWindowsFormatString = "" @@ -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