Browse Source

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>
lilik-openwrt-22.03
Sergey V. Lobanov 2 years ago
committed by Rosen Penev
parent
commit
d60a7ccedc
4 changed files with 58 additions and 12 deletions
  1. +1
    -1
      net/ola/Makefile
  2. +56
    -0
      net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch
  3. +1
    -1
      net/ola/patches/200-configure-acx-pthread.patch
  4. +0
    -10
      net/ola/patches/202-gnu++11.patch

+ 1
- 1
net/ola/Makefile View 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)?


+ 56
- 0
net/ola/patches/020_extend_configure_so_we_switch_to_cpp11.patch View File

@ -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
- 1
net/ola/patches/200-configure-acx-pthread.patch View 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"


+ 0
- 10
net/ola/patches/202-gnu++11.patch View File

@ -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…
Cancel
Save