summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-11-24 18:00:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-11-28 12:07:44 +0100
commite8e3b00bafefffa1b8a35c5721988fb3bf1f817c (patch)
tree797358e24238e72009aefece2b5688643bdfc9af /configure.ac
parent09b8d1f480b22581f8ef31c2611f4bb7366b53c0 (diff)
Require at least gperf 3.1, which no longer emits "register"
...as discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html> "minutes of ESC call ..." Change-Id: I47b6d4a7b8370262ca942b4385e2c0e6f0adc613 Reviewed-on: https://gerrit.libreoffice.org/63953 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 7 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 17672abcb8f4..4134f6460e16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6155,11 +6155,14 @@ fi
if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
GPERF=`cygpath -m $GPERF`
fi
-AC_MSG_CHECKING([gperf version])
-if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
- AC_MSG_RESULT([OK])
+AC_MSG_CHECKING([whether gperf is new enough])
+my_gperf_ver1=$($GPERF --version | head -n 1)
+my_gperf_ver2=${my_gperf_ver1#GNU gperf }
+my_gperf_ver3=$(printf %s "$my_gperf_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
+if test "$my_gperf_ver3" -ge 301; then
+ AC_MSG_RESULT([yes ($my_gperf_ver2)])
else
- AC_MSG_ERROR([too old, you need at least 3.0.0])
+ AC_MSG_ERROR(["$my_gperf_ver1" is too old or unrecognized, must be at least gperf 3.1])
fi
AC_SUBST(GPERF)
@@ -6184,9 +6187,6 @@ CXXFLAGS_CXX11=
if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
CXXFLAGS_CXX11=-std:c++17
elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
- dnl But only use C++17 if the gperf that is being used knows not to emit
- dnl "register" in C++ output:
- printf 'foo\n' | $GPERF -L C++ > conftest.inc
my_flags='-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z -std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x'
for flag in $my_flags; do
if test "$COM" = MSC; then
@@ -6233,15 +6233,6 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
#include <functional>
#include <vector>
- #include <string.h>
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wpragmas"
- // make GCC not warn about next pragma
- #pragma GCC diagnostic ignored "-Wdeprecated-register"
- // make Clang with -std < C++17 not even warn about register
- #include "conftest.inc"
- #pragma GCC diagnostic pop
-
#if defined SYSTEM_LIBCMIS
// See ucb/source/ucp/cmis/auth_provider.hxx:
#if __GNUC__ >= 7
@@ -6265,7 +6256,6 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
break
fi
done
- rm conftest.inc
fi
if test -n "$CXXFLAGS_CXX11"; then
AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])