2018-09-21 22:56:19 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# haproxy
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2022-06-06 23:23:42 +02:00
|
|
|
HAPROXY_VERSION_MAJOR = 2.6
|
2023-06-12 19:29:26 +02:00
|
|
|
HAPROXY_VERSION = $(HAPROXY_VERSION_MAJOR).14
|
2018-09-21 22:56:19 +02:00
|
|
|
HAPROXY_SITE = http://www.haproxy.org/download/$(HAPROXY_VERSION_MAJOR)/src
|
|
|
|
HAPROXY_LICENSE = GPL-2.0+ and LGPL-2.1+ with exceptions
|
|
|
|
HAPROXY_LICENSE_FILES = LICENSE doc/lgpl.txt doc/gpl.txt
|
2021-01-17 16:33:43 +01:00
|
|
|
HAPROXY_CPE_ID_VENDOR = haproxy
|
2018-09-21 22:56:19 +02:00
|
|
|
|
|
|
|
HAPROXY_MAKE_OPTS = \
|
|
|
|
LD=$(TARGET_CC) \
|
|
|
|
PREFIX=/usr \
|
|
|
|
TARGET=custom
|
|
|
|
|
2020-07-14 19:25:29 +02:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),)
|
|
|
|
HAPROXY_MAKE_OPTS += USE_DL=1
|
|
|
|
endif
|
|
|
|
|
2018-09-21 22:56:19 +02:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
|
|
|
HAPROXY_LIBS += -latomic
|
|
|
|
endif
|
|
|
|
|
2019-11-01 12:10:05 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS_NPTL),y)
|
2018-10-02 21:28:58 +02:00
|
|
|
# threads uses atomics on gcc >= 4.7 and sync otherwise (see
|
|
|
|
# include/common/hathreads.h)
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_ATOMIC),y:y)
|
2018-09-21 22:56:19 +02:00
|
|
|
HAPROXY_MAKE_OPTS += USE_THREAD=1
|
2018-10-02 21:28:58 +02:00
|
|
|
else ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_SYNC_4),:y)
|
|
|
|
HAPROXY_MAKE_OPTS += USE_THREAD=1
|
|
|
|
endif
|
2018-09-21 22:56:19 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
|
|
|
|
HAPROXY_DEPENDENCIES += lua
|
2018-09-28 19:35:19 +02:00
|
|
|
HAPROXY_MAKE_OPTS += \
|
|
|
|
LUA_LIB_NAME=lua \
|
|
|
|
USE_LUA=1
|
2018-09-21 22:56:19 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
|
|
|
HAPROXY_DEPENDENCIES += openssl
|
|
|
|
HAPROXY_MAKE_OPTS += USE_OPENSSL=1
|
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
HAPROXY_LIBS += -lz
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# pcre and pcre2 can't be enabled at the same time so prefer pcre2
|
|
|
|
ifeq ($(BR2_PACKAGE_PCRE2),y)
|
|
|
|
HAPROXY_DEPENDENCIES += pcre2
|
|
|
|
HAPROXY_MAKE_OPTS += \
|
2019-01-13 15:04:12 +01:00
|
|
|
PCRE2_CONFIG=$(STAGING_DIR)/usr/bin/pcre2-config \
|
2018-09-21 22:56:19 +02:00
|
|
|
USE_PCRE2=1
|
|
|
|
else ifeq ($(BR2_PACKAGE_PCRE),y)
|
|
|
|
HAPROXY_DEPENDENCIES += pcre
|
|
|
|
HAPROXY_MAKE_OPTS += \
|
2019-01-13 15:04:12 +01:00
|
|
|
PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre-config \
|
2018-09-21 22:56:19 +02:00
|
|
|
USE_PCRE=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
|
|
|
HAPROXY_DEPENDENCIES += systemd
|
|
|
|
HAPROXY_MAKE_OPTS += USE_SYSTEMD=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
|
|
|
HAPROXY_DEPENDENCIES += zlib
|
|
|
|
HAPROXY_MAKE_OPTS += USE_ZLIB=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
HAPROXY_MAKE_OPTS += ADDLIB="$(HAPROXY_LIBS)"
|
|
|
|
|
2019-06-14 23:03:41 +02:00
|
|
|
HAPROXY_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_90620),y)
|
|
|
|
HAPROXY_CFLAGS += -O0
|
|
|
|
endif
|
|
|
|
|
2018-09-21 22:56:19 +02:00
|
|
|
define HAPROXY_BUILD_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
2019-06-14 23:03:41 +02:00
|
|
|
$(HAPROXY_MAKE_OPTS) CFLAGS="$(HAPROXY_CFLAGS)" -C $(@D)
|
2018-09-21 22:56:19 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define HAPROXY_INSTALL_TARGET_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(HAPROXY_MAKE_OPTS) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|