ola: fix build on macos
Latest Apple clang (v13) defines __cplusplus=199711 by default, but
protobuf requires at least 201103 (c++11)
Backported patch to fix c++ detection:
30fe936a88
Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
This commit is contained in:
parent
a1cdf51ba8
commit
d60a7ccedc
4 changed files with 58 additions and 12 deletions
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=ola
|
||||
PKG_VERSION:=0.10.8
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/OpenLightingProject/ola/tar.gz/$(PKG_VERSION)?
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
https://github.com/OpenLightingProject/ola/commit/30fe936a885c8a364bdda507a692c8e259576621
|
||||
|
||||
From 30fe936a885c8a364bdda507a692c8e259576621 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Newman <peterjnewman@gmail.com>
|
||||
Date: Mon, 13 Aug 2018 00:53:51 +0100
|
||||
Subject: [PATCH] Extend configure so we switch to C++11 if necessary for
|
||||
Protobuf 3.6 or above too
|
||||
|
||||
(cherry picked from commit 5286a6925f5f9dc1a045d13632d08cef7f818536)
|
||||
---
|
||||
configure.ac | 28 +++++++++++++++++-----------
|
||||
1 file changed, 17 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -103,23 +103,29 @@ AS_IF([test "x$ac_cv_gnu_plus_plus_11" =
|
||||
# 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"])
|
||||
])
|
|
@ -1,6 +1,6 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -428,8 +428,7 @@ ACX_PTHREAD([
|
||||
@@ -434,8 +434,7 @@ ACX_PTHREAD([
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS"
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -112,7 +112,6 @@ AS_IF([test "x$ac_cv_gnu_plus_plus_11" =
|
||||
[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],
|
||||
[CXXFLAGS="$CXXFLAGS -std=gnu++98"],
|
||||
[PKG_CHECK_MODULES([CPPUNIT2], [cppunit >= 1.14.0],
|
Loading…
Reference in a new issue