diff options
author | Ismael Luceno <ismael@iodev.co.uk> | 2021-09-30 02:07:59 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-10-05 10:40:46 +0200 |
commit | 19d85ff18f3f27d68908091242eb7e22b85f9e7c (patch) | |
tree | 91f7e9b2a939a2eae14e7c775337b464063254a3 /configure.ac | |
parent | dd855b9af9b180e878c5cffa881f4f68cff4afb8 (diff) |
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 <ismael@iodev.co.uk>
Change-Id: I879278c2946c1fa5416da0407a949c8c4b2a8bf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123006
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 16 |
1 files changed, 7 insertions, 9 deletions
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 ========================================= |