kumquat-buildroot/package/zmqpp/zmqpp.mk
Jörg Krause f3b3d6e27c package/zmqpp: fix static build issues
The Makefile for zmqpp builds both shared and static libraries and the client
binary. This leads to several build issues in a pure static library context:
  * R_ARM_TLS_LE32 relocation not permitted in shared object
  * relocation R_ARC_32_ME against `_ZSt7nothrow' can not be used when making
    a shared object; recompile with -fPIC

We add a minimal patch to add some basic handling of building a shared or a
static library only.

Additionally, disable the client for static only builds as it depends on
building the shared library in zmqpp's Makefile. As there is already version
4.1.2 available which provides a CMake build file which solves this issue
(probably, not tested) we don't care for now.

Fixes:
http://autobuild.buildroot.net/results/345/345771eb488c60585e388fbbf4490df936e88e19/
http://autobuild.buildroot.net/results/21b/21b6912c70a5c300bdabde53bee6a1d9cc3bbb02/
http://autobuild.buildroot.net/results/d98/d9882d2ba00da16f76cea6d86a84cd4815ebbba2/

[Thomas:
 - don't change TARGET_CONFIGURE_OPTS, use ZMQPP_MAKE_OPTS instead.
 - simplify condition logic.]

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-11-29 15:09:27 +01:00

49 lines
1.5 KiB
Makefile

################################################################################
#
# zmqpp
#
################################################################################
ZMQPP_VERSION = 3.2.0
ZMQPP_SITE = $(call github,zeromq,zmqpp,$(ZMQPP_VERSION))
ZMQPP_INSTALL_STAGING = YES
ZMQPP_DEPENDENCIES = zeromq
ZMQPP_LICENSE = MIT
ZMQPP_LICENSE_FILES = LICENSE
ZMQPP_PATCH = https://github.com/zeromq/zmqpp/commit/260a9304f6c74272bd3c396f6cca685657b4aff1.patch
ZMQPP_MAKE_OPTS = LD="$(TARGET_CXX)" BUILD_PATH=./build PREFIX=/usr
ZMQPP_LDFLAGS = $(TARGET_LDFLAGS) -lpthread
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) \
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))