mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 13:31:02 +08:00
configure.ac: Use AX_CXX_COMPILE_STDCXX to enable C++11 support in old compilers
This commit enables use of the AX_CXX_COMPILE_STDCXX macro from the autoconf-archive (added in the previous commit), which automatically adds needed flags to the CXX variable to enable C++11 support. This only works and is only required on compilers that are both new enough to have C++11 support and old enough to not enable it by default. We call it with "noext" as the second argument (so that we get the "std" C++11 variant on GCC) and "mandatory" as the third argument, since we now rely on C++11 features as of 83c59e705f461cc08e5844d62514dff27c33a74f. Note that this macro is only called when we are building the compiler (i.e., without --disable-protoc) so that the library can still be built on ancient C compilers.
This commit is contained in:
parent
42612b4ba4
commit
9becc1b66f
@ -76,6 +76,8 @@ AC_ARG_ENABLE([protoc],
|
||||
if test "x$enable_protoc" != "xno"; then
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
|
||||
|
||||
PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0],
|
||||
[proto3_supported=yes],
|
||||
[PKG_CHECK_MODULES([protobuf], [protobuf >= 2.6.0])]
|
||||
|
Loading…
x
Reference in New Issue
Block a user