Skip to content

Commit

Permalink
Extend configure so we switch to C++11 if necessary for Protobuf 3.6 …
Browse files Browse the repository at this point in the history
…or above too

(cherry picked from commit 5286a69)
  • Loading branch information
peternewman committed Dec 31, 2020
1 parent 76099be commit 30fe936
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,29 @@ AS_IF([test "x$ac_cv_gnu_plus_plus_11" = xyes],
# force us into gnu++98 mode if necessary
# If gnu++11 and gnu++98 then
# If random works with gnu++98
# If no unit tests, force to gnu++98
# If unittests and cppunit < 1.14.0, force to gnu++98
# Else turn off deprecation messages for std::auto_ptr and run gnu++11
# Else run gnu++11
# If protobuf < 3.6
# If no unit tests, force to gnu++98
# Else we have unit tests
# If cppunit < 1.14.0, force to gnu++98
# Else turn off deprecation messages for std::auto_ptr and run gnu++11
# Else assume we have protobuf >= 3.6 (later checks will confirm that for certain), turn off deprecation messages for std::auto_ptr and run gnu++11
# Else turn off deprecation messages for std::auto_ptr and run gnu++11
require_gnu_plus_plus_11="no"
AS_IF([test "x$ac_cv_gnu_plus_plus_11" = xyes],
[AS_IF([test "x$ac_cv_gnu_plus_plus_98" = xyes],
[AS_IF([test "x$ac_cv_header_random_98" = xyes],
[AS_IF([test "x$enable_unittests" = xno],
[CXXFLAGS="$CXXFLAGS -std=gnu++98"],
[PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0],
[PKG_CHECK_MODULES([PROTOBUF1], [protobuf < 3.6],
[AS_IF([test "x$enable_unittests" = xno],
[CXXFLAGS="$CXXFLAGS -std=gnu++98"],
[PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0],
[require_gnu_plus_plus_11="yes"],
[AC_MSG_WARN([OLA requires std::auto_ptr support.])])
[PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0],
[CXXFLAGS="$CXXFLAGS -std=gnu++98"],
[PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0],
[require_gnu_plus_plus_11="yes"],
[AC_MSG_WARN([OLA requires std::auto_ptr support.])])
])
])
])
],
[require_gnu_plus_plus_11="yes"])
],
[require_gnu_plus_plus_11="yes"])
])
Expand Down

0 comments on commit 30fe936

Please sign in to comment.