ola: fix build on macos
authorSergey V. Lobanov <sergey@lobanov.in>
Sat, 15 Jan 2022 15:32:57 +0000 (18:32 +0300)
committerRosen Penev <rosenp@gmail.com>
Wed, 19 Jan 2022 19:25:15 +0000 (11:25 -0800)
Latest Apple clang (v13) defines __cplusplus=199711 by default, but
protobuf requires at least 201103 (c++11)

Backported patch to fix c++ detection:
https://github.com/OpenLightingProject/ola/commit/30fe936a885c8a364bdda507a692c8e259576621

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
net/ola/Makefile
net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch [new file with mode: 0644]
net/ola/patches/200-configure-acx-pthread.patch
net/ola/patches/202-gnu++11.patch [deleted file]

index a057f1f5e2736edb38f769ef8c3465779db9abea..a0abec3c6d268b073dbf0c6555389ba8a43b8686 100644 (file)
@@ -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)?
diff --git a/net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch b/net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch
new file mode 100644 (file)
index 0000000..8eaeceb
--- /dev/null
@@ -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"])
+              ])
index 789de0b90437d07369ae7002424ab99831ea6ecd..112aab1cb3317ea66e9b81aec8053ccc3ea65e05 100644 (file)
@@ -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"
diff --git a/net/ola/patches/202-gnu++11.patch b/net/ola/patches/202-gnu++11.patch
deleted file mode 100644 (file)
index ab00c99..0000000
+++ /dev/null
@@ -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],