You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
3.2 KiB

  1. https://github.com/OpenLightingProject/ola/commit/30fe936a885c8a364bdda507a692c8e259576621
  2. From 30fe936a885c8a364bdda507a692c8e259576621 Mon Sep 17 00:00:00 2001
  3. From: Peter Newman <peterjnewman@gmail.com>
  4. Date: Mon, 13 Aug 2018 00:53:51 +0100
  5. Subject: [PATCH] Extend configure so we switch to C++11 if necessary for
  6. Protobuf 3.6 or above too
  7. (cherry picked from commit 5286a6925f5f9dc1a045d13632d08cef7f818536)
  8. ---
  9. configure.ac | 28 +++++++++++++++++-----------
  10. 1 file changed, 17 insertions(+), 11 deletions(-)
  11. --- a/configure.ac
  12. +++ b/configure.ac
  13. @@ -103,23 +103,29 @@ AS_IF([test "x$ac_cv_gnu_plus_plus_11" =
  14. # force us into gnu++98 mode if necessary
  15. # If gnu++11 and gnu++98 then
  16. # If random works with gnu++98
  17. -# If no unit tests, force to gnu++98
  18. -# If unittests and cppunit < 1.14.0, force to gnu++98
  19. -# Else turn off deprecation messages for std::auto_ptr and run gnu++11
  20. -# Else run gnu++11
  21. +# If protobuf < 3.6
  22. +# If no unit tests, force to gnu++98
  23. +# Else we have unit tests
  24. +# If cppunit < 1.14.0, force to gnu++98
  25. +# Else turn off deprecation messages for std::auto_ptr and run gnu++11
  26. +# 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
  27. +# Else turn off deprecation messages for std::auto_ptr and run gnu++11
  28. require_gnu_plus_plus_11="no"
  29. AS_IF([test "x$ac_cv_gnu_plus_plus_11" = xyes],
  30. [AS_IF([test "x$ac_cv_gnu_plus_plus_98" = xyes],
  31. [AS_IF([test "x$ac_cv_header_random_98" = xyes],
  32. - [AS_IF([test "x$enable_unittests" = xno],
  33. - [CXXFLAGS="$CXXFLAGS -std=gnu++98"],
  34. - [PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0],
  35. + [PKG_CHECK_MODULES([PROTOBUF1], [protobuf < 3.6],
  36. + [AS_IF([test "x$enable_unittests" = xno],
  37. [CXXFLAGS="$CXXFLAGS -std=gnu++98"],
  38. - [PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0],
  39. - [require_gnu_plus_plus_11="yes"],
  40. - [AC_MSG_WARN([OLA requires std::auto_ptr support.])])
  41. + [PKG_CHECK_MODULES([CPPUNIT1], [cppunit < 1.14.0],
  42. + [CXXFLAGS="$CXXFLAGS -std=gnu++98"],
  43. + [PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0],
  44. + [require_gnu_plus_plus_11="yes"],
  45. + [AC_MSG_WARN([OLA requires std::auto_ptr support.])])
  46. + ])
  47. ])
  48. - ])
  49. + ],
  50. + [require_gnu_plus_plus_11="yes"])
  51. ],
  52. [require_gnu_plus_plus_11="yes"])
  53. ])