mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
From 93005632eca13d8eda409f6e9496fd5dd69e75b0 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Fri, 4 May 2018 18:38:31 +0200
|
||||
Subject: [PATCH] Allow building shared or static library only
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Patchs retrieved from:
|
||||
- https://git.buildroot.net/buildroot/tree/package/zmqpp/0001-Allow-building-shared-or-static-library-only.patch
|
||||
- https://git.buildroot.net/buildroot/tree/package/zmqpp/0002-Install-static-library-for-static-builds.patch
|
||||
|
||||
Both patches have been merged in a single one and slightly updated to
|
||||
keep default behavior of building and installing static library
|
||||
(BUILD_STATIC is set to yes by default)
|
||||
|
||||
[Upstream status: merged (https://github.com/zeromq/zmqpp/pull/218)]
|
||||
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
Makefile | 24 ++++++++++++++++++++----
|
||||
1 file changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 689acaa..e43054c 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -81,6 +81,9 @@ ifeq ($(UNAME_S),Darwin)
|
||||
endif
|
||||
|
||||
|
||||
+BUILD_SHARED ?= yes
|
||||
+BUILD_STATIC ?= yes
|
||||
+
|
||||
CONFIG_FLAGS =
|
||||
ifeq ($(CONFIG),debug)
|
||||
CONFIG_FLAGS = -g -fno-inline -ftemplate-depth-1000
|
||||
@@ -95,13 +98,22 @@ ifneq (,$(findstring $(CONFIG),release loadtest))
|
||||
CONFIG_FLAGS = -O3 -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNO_DEBUG_LOG -DNO_TRACE_LOG -DNDEBUG
|
||||
endif
|
||||
|
||||
-COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall -fPIC \
|
||||
+COMMON_FLAGS = -MMD -std=c++11 -pipe -Wall \
|
||||
-DBUILD_ENV=$(CONFIG) \
|
||||
-DBUILD_DATESTAMP='$(APP_DATESTAMP)' \
|
||||
-DBUILD_LIBRARY_NAME='"$(LIBRARY_NAME)"' \
|
||||
-DBUILD_CLIENT_NAME='"$(CLIENT_TARGET)"' \
|
||||
-I$(SRC_PATH) $(CUSTOM_INCLUDE_PATH)
|
||||
|
||||
+ifeq ($(BUILD_SHARED),yes)
|
||||
+COMMON_FLAGS += -fPIC
|
||||
+LIBRARY_TARGETS += $(LIBRARY_SHARED)
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(BUILD_STATIC),yes)
|
||||
+LIBRARY_TARGETS += $(LIBRARY_ARCHIVE)
|
||||
+endif
|
||||
+
|
||||
COMMON_LIBS = -lzmq
|
||||
|
||||
LIBRARY_LIBS =
|
||||
@@ -150,11 +162,15 @@ install:
|
||||
mkdir -p $(LIBDIR)
|
||||
mkdir -p $(PKGCONFIGDIR)
|
||||
install -m 644 $(ALL_LIBRARY_INCLUDES) $(INCLUDEDIR)/$(LIBRARY_DIR)
|
||||
- install -m 755 $(BUILD_PATH)/$(LIBRARY_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_FULL_VERSION_SHARED)
|
||||
- install -m 755 $(BUILD_PATH)/$(LIBRARY_ARCHIVE) $(LIBDIR)/$(LIBRARY_ARCHIVE)
|
||||
install -m 755 $(BUILD_PATH)/$(PKGCONFIG_FILE) $(PKGCONFIGDIR)/$(PKGCONFIG_FILE)
|
||||
+ifeq ($(BUILD_SHARED),yes)
|
||||
+ install -m 755 $(BUILD_PATH)/$(LIBRARY_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_FULL_VERSION_SHARED)
|
||||
ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_VERSION_SHARED)
|
||||
ln -sf $(LIBRARY_FULL_VERSION_SHARED) $(LIBDIR)/$(LIBRARY_SHARED)
|
||||
+endif
|
||||
+ifeq ($(BUILD_STATIC),yes)
|
||||
+ install -m 755 $(BUILD_PATH)/$(LIBRARY_ARCHIVE) $(LIBDIR)/$(LIBRARY_ARCHIVE)
|
||||
+endif
|
||||
if [ -f $(BUILD_PATH)/$(CLIENT_TARGET) ]; then install -m 755 $(BUILD_PATH)/$(CLIENT_TARGET) $(BINDIR); fi
|
||||
$(LDCONFIG)
|
||||
@echo "use make installcheck to test the install"
|
||||
@@ -176,7 +192,7 @@ clean:
|
||||
|
||||
client: $(CLIENT_TARGET)
|
||||
|
||||
-library: $(LIBRARY_SHARED) $(LIBRARY_ARCHIVE)
|
||||
+library: $(LIBRARY_TARGETS)
|
||||
|
||||
#
|
||||
# BUILD Targets
|
||||
--
|
||||
2.14.1
|
||||
|
||||
41
package/zmqpp/Config.in
Normal file
41
package/zmqpp/Config.in
Normal file
@@ -0,0 +1,41 @@
|
||||
config BR2_PACKAGE_ZMQPP
|
||||
bool "zmqpp"
|
||||
# c++1x support
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # zeromq
|
||||
depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # exception_ptr
|
||||
select BR2_PACKAGE_ZEROMQ
|
||||
help
|
||||
C++ binding for zeromq (ZeroMQ, 0MQ, zmq).
|
||||
|
||||
This C++ binding is a 'high-level' library that hides most
|
||||
of the C-style interface core zeromq provides.
|
||||
|
||||
http://github.com/benjamg/zmqpp
|
||||
|
||||
comment "zmqpp needs a toolchain w/ C++, threads, gcc >= 4.7"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
|
||||
|
||||
comment "zmqpp needs exception_ptr"
|
||||
depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
|
||||
|
||||
if BR2_PACKAGE_ZMQPP
|
||||
|
||||
config BR2_PACKAGE_ZMQPP_CLIENT
|
||||
bool "zmqpp client"
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # boost
|
||||
depends on BR2_USE_WCHAR # boost
|
||||
select BR2_PACKAGE_BOOST
|
||||
select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
|
||||
help
|
||||
Build and install the zmqpp client, a command line tool that
|
||||
can be used to listen or send to zeromq sockets.
|
||||
|
||||
comment "zmqpp client needs a toolchain w/ dynamic library, threads, wchar"
|
||||
depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS \
|
||||
|| !BR2_USE_WCHAR
|
||||
|
||||
endif
|
||||
3
package/zmqpp/zmqpp.hash
Normal file
3
package/zmqpp/zmqpp.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 c1d4587df3562f73849d9e5f8c932ca7dcfc7d8bec31f62d7f35073ef81f4d29 zmqpp-4.2.0.tar.gz
|
||||
sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 LICENSE
|
||||
60
package/zmqpp/zmqpp.mk
Normal file
60
package/zmqpp/zmqpp.mk
Normal file
@@ -0,0 +1,60 @@
|
||||
################################################################################
|
||||
#
|
||||
# zmqpp
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ZMQPP_VERSION = 4.2.0
|
||||
ZMQPP_SITE = $(call github,zeromq,zmqpp,$(ZMQPP_VERSION))
|
||||
ZMQPP_INSTALL_STAGING = YES
|
||||
ZMQPP_DEPENDENCIES = zeromq
|
||||
ZMQPP_LICENSE = MPL-2.0
|
||||
ZMQPP_LICENSE_FILES = LICENSE
|
||||
ZMQPP_MAKE_OPTS = LD="$(TARGET_CXX)" BUILD_PATH=./build PREFIX=/usr
|
||||
ZMQPP_LDFLAGS = $(TARGET_LDFLAGS) -lpthread
|
||||
ZMQPP_CONFIG = $(if $(BR2_ENABLE_DEBUG),debug,release)
|
||||
|
||||
# gcc bug internal compiler error: in merge_overlapping_regs, at
|
||||
# regrename.c:304. This bug is fixed since gcc 6.
|
||||
# By setting CONFIG to empty, all optimizations such as -funroll-loops
|
||||
# -ffast-math -finline-functions -fomit-frame-pointer are disabled
|
||||
ifeq ($(BR2_or1k):$(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y:)
|
||||
# check-package OverriddenVariable
|
||||
ZMQPP_CONFIG =
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
ZMQPP_LDFLAGS += -latomic
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ZMQPP_CLIENT),y)
|
||||
ZMQPP_DEPENDENCIES += boost
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_STATIC_LIBS),y)
|
||||
ZMQPP_MAKE_OPTS += BUILD_STATIC=yes BUILD_SHARED=no
|
||||
else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
|
||||
ZMQPP_MAKE_OPTS += BUILD_STATIC=yes BUILD_SHARED=yes
|
||||
else ifeq ($(BR2_SHARED_LIBS),y)
|
||||
ZMQPP_MAKE_OPTS += BUILD_STATIC=no BUILD_SHARED=yes
|
||||
endif
|
||||
|
||||
define ZMQPP_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
||||
CONFIG=$(ZMQPP_CONFIG) LDFLAGS="$(ZMQPP_LDFLAGS)" \
|
||||
$(ZMQPP_MAKE_OPTS) $(if $(BR2_PACKAGE_ZMQPP_CLIENT),client,library) -C $(@D)
|
||||
endef
|
||||
|
||||
define ZMQPP_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/include/zmqpp
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
||||
$(ZMQPP_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install -C $(@D)
|
||||
endef
|
||||
|
||||
define ZMQPP_INSTALL_STAGING_CMDS
|
||||
$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/include/zmqpp
|
||||
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
||||
$(ZMQPP_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install -C $(@D)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user