]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Stop building open-vm-tools for LINUX systems with glibc < 2.12.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:43 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:43 +0000 (11:23 -0700)
Implemented a check for glibc version and abort if the detected
version is lesser than 2.12 (This affects RHEL5 and older generations).

Implemented a config switch '--disable-glibc-check', which when specified,
will skip checking for compatible glibc version.

Modified the tools-pkg.make file to specify --disable-glibc-check
while executing "./configure" for open-vm-tools.

Note: glibc check is done only for Linux systems.

open-vm-tools/configure.ac

index 37291f0f5f2d16ccff4f08100fb9eba2bee47206..8e0c1341fc8941b477d7b98d74b0678d7527bfef 100644 (file)
@@ -132,6 +132,34 @@ case "$host_os" in
 esac
 osVersion="`getOsVersion`"
 
+AC_ARG_ENABLE(
+   glibc-check,
+   AS_HELP_STRING(
+      [--disable-glibc-check],
+      [Skip checking the glibc version on the system. (off by default)]),
+   [enable_glibc_check=$enableval],
+   [enable_glibc_check="yes"])
+
+if test "x$enable_glibc_check" != "xno" ; then
+   if test "x$os" = "xlinux" ; then
+      libc_ver=`ldd --version 2>/dev/null | head -1 | sed 's/.* //;q'`
+
+      if test "x$libc_ver" = "x"; then
+         AC_MSG_ERROR(["Failed to detect glibc version installed in the system."])
+      fi
+
+      libc_ver_mjr=`expr "$libc_ver" : "\([[0-9]]*\)"`
+      libc_ver_mnr=`expr "$libc_ver" : "[[0-9]]*\.\([[0-9]]*\)"`
+      libc_ver_num=`expr $libc_ver_mjr \* 1000 + $libc_ver_mnr`
+
+      if test "$libc_ver_num" -lt 2012; then
+         AC_MSG_ERROR(["glibc version $libc_ver detected.
+This version of open-vm-tools requires glibc version 2.12 or later.
+Please use an older version of open-vm-tools for this system."])
+      fi
+   fi
+fi
+
 AC_ARG_WITH([kernel-modules],
            [AS_HELP_STRING([--with-kernel-modules],
                [compile and install the kernel modules])],