configure.ac: Require C++17

There are some recent reports of strange build failures that might have
been fixed by compiling in C++17 mode, so it might be a good idea to use
C++17 in general, and not just when building against very recent
protobuf versions.

Since it looks like we've lost protobuf < 3.0.0 support, configure.ac
can be simplified a bit if we just use C++17 by default.
This commit is contained in:
Robert Edmonds 2023-07-03 01:10:28 -04:00
parent 7582b6e7d6
commit 5b0661f1e8

View File

@ -75,27 +75,8 @@ AC_ARG_ENABLE([protoc],
AS_HELP_STRING([--disable-protoc], [Disable building protoc_c (also disables tests)]))
if test "x$enable_protoc" != "xno"; then
AC_LANG_PUSH([C++])
# PKG_CHECK_MODULES(prefix, list-of-modules, action-if-found, action-if-not-found)
PKG_CHECK_MODULES(
[protobuf],
[protobuf >= 4.22.0],
[
proto3_supported=yes
AX_CXX_COMPILE_STDCXX(17, noext, mandatory)
],
[
PKG_CHECK_MODULES(
[protobuf],
[protobuf >= 3.0.0],
[
proto3_supported=yes
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
],
[
PKG_CHECK_MODULES([protobuf], [protobuf >= 2.6.0])
])
])
PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0], [proto3_supported=yes])
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$save_CPPFLAGS $protobuf_CFLAGS"