1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# haproxy 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunHAPROXY_VERSION_MAJOR = 2.4 8*4882a593SmuzhiyunHAPROXY_VERSION = $(HAPROXY_VERSION_MAJOR).7 9*4882a593SmuzhiyunHAPROXY_SITE = http://www.haproxy.org/download/$(HAPROXY_VERSION_MAJOR)/src 10*4882a593SmuzhiyunHAPROXY_LICENSE = GPL-2.0+ and LGPL-2.1+ with exceptions 11*4882a593SmuzhiyunHAPROXY_LICENSE_FILES = LICENSE doc/lgpl.txt doc/gpl.txt 12*4882a593SmuzhiyunHAPROXY_CPE_ID_VENDOR = haproxy 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunHAPROXY_MAKE_OPTS = \ 15*4882a593Smuzhiyun LD=$(TARGET_CC) \ 16*4882a593Smuzhiyun PREFIX=/usr \ 17*4882a593Smuzhiyun TARGET=custom 18*4882a593Smuzhiyun 19*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),) 20*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_DL=1 21*4882a593Smuzhiyunendif 22*4882a593Smuzhiyun 23*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) 24*4882a593SmuzhiyunHAPROXY_LIBS += -latomic 25*4882a593Smuzhiyunendif 26*4882a593Smuzhiyun 27*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),y) 28*4882a593Smuzhiyun# threads uses atomics on gcc >= 4.7 and sync otherwise (see 29*4882a593Smuzhiyun# include/common/hathreads.h) 30*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_ATOMIC),y:y) 31*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_THREAD=1 32*4882a593Smuzhiyunelse ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_SYNC_4),:y) 33*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_THREAD=1 34*4882a593Smuzhiyunendif 35*4882a593Smuzhiyunendif 36*4882a593Smuzhiyun 37*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LUA_5_3),y) 38*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += lua 39*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += \ 40*4882a593Smuzhiyun LUA_LIB_NAME=lua \ 41*4882a593Smuzhiyun USE_LUA=1 42*4882a593Smuzhiyunendif 43*4882a593Smuzhiyun 44*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y) 45*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += openssl 46*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_OPENSSL=1 47*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),y) 48*4882a593SmuzhiyunHAPROXY_LIBS += -lz 49*4882a593Smuzhiyunendif 50*4882a593Smuzhiyunendif 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun# pcre and pcre2 can't be enabled at the same time so prefer pcre2 53*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_PCRE2),y) 54*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += pcre2 55*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += \ 56*4882a593Smuzhiyun PCRE2_CONFIG=$(STAGING_DIR)/usr/bin/pcre2-config \ 57*4882a593Smuzhiyun USE_PCRE2=1 58*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_PCRE),y) 59*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += pcre 60*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += \ 61*4882a593Smuzhiyun PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre-config \ 62*4882a593Smuzhiyun USE_PCRE=1 63*4882a593Smuzhiyunendif 64*4882a593Smuzhiyun 65*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SYSTEMD),y) 66*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += systemd 67*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_SYSTEMD=1 68*4882a593Smuzhiyunendif 69*4882a593Smuzhiyun 70*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZLIB),y) 71*4882a593SmuzhiyunHAPROXY_DEPENDENCIES += zlib 72*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += USE_ZLIB=1 73*4882a593Smuzhiyunendif 74*4882a593Smuzhiyun 75*4882a593SmuzhiyunHAPROXY_MAKE_OPTS += ADDLIB="$(HAPROXY_LIBS)" 76*4882a593Smuzhiyun 77*4882a593SmuzhiyunHAPROXY_CFLAGS = $(TARGET_CFLAGS) 78*4882a593Smuzhiyun 79*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y) 80*4882a593SmuzhiyunHAPROXY_CFLAGS += -O0 81*4882a593Smuzhiyunendif 82*4882a593Smuzhiyun 83*4882a593Smuzhiyundefine HAPROXY_BUILD_CMDS 84*4882a593Smuzhiyun $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ 85*4882a593Smuzhiyun $(HAPROXY_MAKE_OPTS) CFLAGS="$(HAPROXY_CFLAGS)" -C $(@D) 86*4882a593Smuzhiyunendef 87*4882a593Smuzhiyun 88*4882a593Smuzhiyundefine HAPROXY_INSTALL_TARGET_CMDS 89*4882a593Smuzhiyun $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \ 90*4882a593Smuzhiyun $(HAPROXY_MAKE_OPTS) -C $(@D) DESTDIR=$(TARGET_DIR) install 91*4882a593Smuzhiyunendef 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun$(eval $(generic-package)) 94