mirror of
https://github.com/collectd/collectd.git
synced 2026-02-08 19:59:15 +08:00
configure.ac: fix grpc build
Similar to the previous "configure.ac: fix grpc build" commit:
Google bumped it's compiler requirements again [1], hence the c++ version needs to be adjusted to c++17 to be able to build with the latest grpc versions.
[1] a5e3ed43d4/foundational-cxx-support-matrix.md
Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
This commit is contained in:
committed by
Michael Nosthoff
parent
050877ed95
commit
42b2ede4da
16
configure.ac
16
configure.ac
@@ -2844,20 +2844,20 @@ PKG_CHECK_MODULES([GRPCPP], [grpc++],
|
||||
fi
|
||||
|
||||
if test "x$withval" != "xno"; then
|
||||
AC_MSG_CHECKING([whether $CXX accepts -std=c++14])
|
||||
if test_cxx_flags -std=c++14; then
|
||||
AC_MSG_CHECKING([whether $CXX accepts -std=c++17])
|
||||
if test_cxx_flags -std=c++17; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
with_libgrpcpp="no (requires C++14 support)"
|
||||
with_libprotobuf="no (<absl/base/policy_checks.h> requires C++14 support)"
|
||||
with_libgrpcpp="no (requires C++17 support)"
|
||||
with_libprotobuf="no (<absl/base/policy_checks.h> requires C++17 support)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$with_libgrpcpp" = "xyes"; then
|
||||
AC_LANG_PUSH(C++)
|
||||
SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
|
||||
CPPFLAGS="-std=c++17 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
|
||||
AC_CHECK_HEADERS([grpc++/grpc++.h],
|
||||
[with_libgrpcpp="yes"],
|
||||
[with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
|
||||
@@ -2871,7 +2871,7 @@ if test "x$with_libgrpcpp" = "xyes"; then
|
||||
SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
SAVE_LDFLAGS="$LDFLAGS"
|
||||
SAVE_LIBS="$LIBS"
|
||||
CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
|
||||
CPPFLAGS="-std=c++17 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$with_libgrpcpp_ldflags"
|
||||
if test "x$GRPCPP_LIBS" = "x"; then
|
||||
LIBS="-lgrpc++"
|
||||
@@ -2899,7 +2899,7 @@ if test "x$with_libgrpcpp" = "xyes"; then
|
||||
AC_LANG_POP(C++)
|
||||
fi
|
||||
|
||||
BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++14 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
|
||||
BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++17 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
|
||||
BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
|
||||
BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
|
||||
AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
|
||||
@@ -4843,7 +4843,7 @@ if test "x$withval" != "xno"; then
|
||||
AC_CHECK_LIB([protobuf], [main],
|
||||
[
|
||||
SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="-std=c++14 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
|
||||
CPPFLAGS="-std=c++17 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
|
||||
if test "x$PROTOBUF_LIBS" = "x"
|
||||
then
|
||||
PROTOBUF_LIBS="-lprotobuf"
|
||||
|
||||
Reference in New Issue
Block a user