From d60a7ccedc6d3706e808d24e1d0ca97c9c168feb Mon Sep 17 00:00:00 2001 From: "Sergey V. Lobanov" Date: Sat, 15 Jan 2022 18:32:57 +0300 Subject: [PATCH] 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: https://github.com/OpenLightingProject/ola/commit/30fe936a885c8a364bdda507a692c8e259576621 Signed-off-by: Sergey V. Lobanov --- net/ola/Makefile | 2 +- ...tend_configure_so_we_switch_to_cpp11.patch | 56 +++++++++++++++++++ .../patches/200-configure-acx-pthread.patch | 2 +- net/ola/patches/202-gnu++11.patch | 10 ---- 4 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch delete mode 100644 net/ola/patches/202-gnu++11.patch diff --git a/net/ola/Makefile b/net/ola/Makefile index a057f1f5e..a0abec3c6 100644 --- a/net/ola/Makefile +++ b/net/ola/Makefile @@ -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 index 000000000..8eaeceb98 --- /dev/null +++ b/net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch @@ -0,0 +1,56 @@ +https://github.com/OpenLightingProject/ola/commit/30fe936a885c8a364bdda507a692c8e259576621 + +From 30fe936a885c8a364bdda507a692c8e259576621 Mon Sep 17 00:00:00 2001 +From: Peter Newman +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"]) + ]) diff --git a/net/ola/patches/200-configure-acx-pthread.patch b/net/ola/patches/200-configure-acx-pthread.patch index 789de0b90..112aab1cb 100644 --- a/net/ola/patches/200-configure-acx-pthread.patch +++ b/net/ola/patches/200-configure-acx-pthread.patch @@ -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 index ab00c99ae..000000000 --- a/net/ola/patches/202-gnu++11.patch +++ /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],