xref: /OK3568_Linux_fs/buildroot/package/zmqpp/zmqpp.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# zmqpp
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunZMQPP_VERSION = 4.2.0
8*4882a593SmuzhiyunZMQPP_SITE = $(call github,zeromq,zmqpp,$(ZMQPP_VERSION))
9*4882a593SmuzhiyunZMQPP_INSTALL_STAGING = YES
10*4882a593SmuzhiyunZMQPP_DEPENDENCIES = zeromq
11*4882a593SmuzhiyunZMQPP_LICENSE = MPL-2.0
12*4882a593SmuzhiyunZMQPP_LICENSE_FILES = LICENSE
13*4882a593SmuzhiyunZMQPP_MAKE_OPTS = LD="$(TARGET_CXX)" BUILD_PATH=./build PREFIX=/usr
14*4882a593SmuzhiyunZMQPP_LDFLAGS = $(TARGET_LDFLAGS) -lpthread
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun# gcc bug internal compiler error: in merge_overlapping_regs, at
17*4882a593Smuzhiyun# regrename.c:304. This bug is fixed since gcc 6.
18*4882a593Smuzhiyun# By setting CONFIG to empty, all optimizations such as -funroll-loops
19*4882a593Smuzhiyun# -ffast-math -finline-functions -fomit-frame-pointer are disabled,
20*4882a593Smuzhiyun# so only set CONFIG for the non-affected cases.
21*4882a593Smuzhiyunifneq ($(BR2_or1k):$(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y:)
22*4882a593SmuzhiyunZMQPP_CONFIG = $(if $(BR2_ENABLE_RUNTIME_DEBUG),buildroot,release)
23*4882a593Smuzhiyunendif
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
26*4882a593SmuzhiyunZMQPP_LDFLAGS += -latomic
27*4882a593Smuzhiyunendif
28*4882a593Smuzhiyun
29*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZMQPP_CLIENT),y)
30*4882a593SmuzhiyunZMQPP_DEPENDENCIES += boost
31*4882a593Smuzhiyunendif
32*4882a593Smuzhiyun
33*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),y)
34*4882a593SmuzhiyunZMQPP_MAKE_OPTS += BUILD_STATIC=yes BUILD_SHARED=no
35*4882a593Smuzhiyunelse ifeq ($(BR2_SHARED_STATIC_LIBS),y)
36*4882a593SmuzhiyunZMQPP_MAKE_OPTS += BUILD_STATIC=yes BUILD_SHARED=yes
37*4882a593Smuzhiyunelse ifeq ($(BR2_SHARED_LIBS),y)
38*4882a593SmuzhiyunZMQPP_MAKE_OPTS += BUILD_STATIC=no BUILD_SHARED=yes
39*4882a593Smuzhiyunendif
40*4882a593Smuzhiyun
41*4882a593Smuzhiyundefine ZMQPP_BUILD_CMDS
42*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
43*4882a593Smuzhiyun		CONFIG=$(ZMQPP_CONFIG) LDFLAGS="$(ZMQPP_LDFLAGS)" \
44*4882a593Smuzhiyun		$(ZMQPP_MAKE_OPTS) $(if $(BR2_PACKAGE_ZMQPP_CLIENT),client,library) -C $(@D)
45*4882a593Smuzhiyunendef
46*4882a593Smuzhiyun
47*4882a593Smuzhiyundefine ZMQPP_INSTALL_TARGET_CMDS
48*4882a593Smuzhiyun	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/include/zmqpp
49*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
50*4882a593Smuzhiyun		$(ZMQPP_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install -C $(@D)
51*4882a593Smuzhiyunendef
52*4882a593Smuzhiyun
53*4882a593Smuzhiyundefine ZMQPP_INSTALL_STAGING_CMDS
54*4882a593Smuzhiyun	$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/include/zmqpp
55*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
56*4882a593Smuzhiyun		$(ZMQPP_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install -C $(@D)
57*4882a593Smuzhiyunendef
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun$(eval $(generic-package))
60