configure.ac | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
New commits: commit 19d85ff18f3f27d68908091242eb7e22b85f9e7c Author: Ismael Luceno <ism...@iodev.co.uk> AuthorDate: Thu Sep 30 02:07:59 2021 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Oct 5 10:40:46 2021 +0200 configure: Fix libc version check Testing for gnu_get_libc_version isn't quite right (available before 2.1), and the feature macros were already present. The new test at least will fail for glibc < 2.1, but will pass on non-glibc systems. The buildsystem should be actually checking for some sort of compliance barrier instead, but this is a start. Signed-off-by: Ismael Luceno <ism...@iodev.co.uk> Change-Id: I879278c2946c1fa5416da0407a949c8c4b2a8bf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123006 Tested-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/configure.ac b/configure.ac index 0dcd4f283330..c0713a64df5a 100644 --- a/configure.ac +++ b/configure.ac @@ -11327,15 +11327,13 @@ dnl *************************************** dnl testing libc version for Linux... dnl *************************************** if test "$_os" = "Linux"; then - AC_MSG_CHECKING([whether libc is >= 2.1.1]) - exec 6>/dev/null # no output - AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC) - exec 6>&1 # output on again - if test "$HAVE_LIBC"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_ERROR([no, upgrade libc]) - fi + AC_MSG_CHECKING([whether the libc is recent enough]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <features.h> + #if defined(__GNU_LIBRARY__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) + #error glibc >= 2.1 is required + #endif + ]])],, [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no, upgrade libc])]) fi dnl =========================================