You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
4.2 KiB

haproxy: Fix PCRE_DIR include path haproxy's Makefile already happens include/ after specifying PCRE_DIR which would result in the following build errors on an external toolchain that does not automatically search for headers in $(STAGING_DIR): mipsel-linux-gnu-gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 -DCONFIG_HAP_LINUX_SPLICE -DTPROXY -DCONFIG_HAP_LINUX_TPROXY -DCONFIG_HAP_CRYPT -DUSE_ZLIB -DENABLE_POLL -DENABLE_EPOLL -DUSE_CPU_AFFINITY -DASSUME_SPLICE_WORKS -DUSE_ACCEPT4 -DNETFILTER -DUSE_GETSOCKNAME -DCONFIG_REGPARM=3 -DUSE_OPENSSL -DUSE_SYSCALL_FUTEX -DUSE_LUA -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/lua-5.3.3/include -DUSE_PCRE -I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include/include -DUSE_PCRE_JIT -DCONFIG_HAPROXY_VERSION=\"1.7.4-patch02\" -DCONFIG_HAPROXY_DATE=\"2017/04/01\" \ -DBUILD_TARGET='"linux2628"' \ -DBUILD_ARCH='""' \ -DBUILD_CPU='"generic"' \ -DBUILD_CC='"mipsel-linux-gnu-gcc"' \ -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530"' \ -DBUILD_OPTIONS='"USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1 USE_ZLIB=yes USE_REGPARM=1 USE_OPENSSL=1 USE_LUA=1 USE_PCRE=1 USE_PCRE_JIT=1"' \ -c -o src/haproxy.o src/haproxy.c In file included from include/types/proxy.h:33:0, from include/proto/log.h:32, from include/common/cfgparse.h:29, from src/haproxy.c:65: include/common/regex.h:31:18: fatal error: pcre.h: No such file or directory #include <pcre.h> Fix this by stripping the additional include/ being added. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
8 years ago
  1. #
  2. # Copyright (C) 2010-2016 OpenWrt.org
  3. # Copyright (C) 2009-2016 Thomas Heil <heil@terminal-consulting.de>
  4. # Copyright (C) 2018 Christian Lachner <gladiac@gmail.com>
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=haproxy
  11. PKG_VERSION:=2.4.16
  12. PKG_RELEASE:=$(AUTORELEASE)
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://www.haproxy.org/download/2.4/src
  15. PKG_HASH:=8c5533779bb8125ef8dbd56a72b1d3fd47fa6bcdf2d257d3cc001269b059cee9
  16. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
  17. Christian Lachner <gladiac@gmail.com>
  18. PKG_LICENSE:=GPL-2.0-only
  19. PKG_LICENSE_FILES:=LICENSE
  20. PKG_CPE_ID:=cpe:/a:haproxy:haproxy
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/haproxy/Default
  23. SUBMENU:=Web Servers/Proxies
  24. SECTION:=net
  25. CATEGORY:=Network
  26. TITLE:=TCP/HTTP Load Balancer
  27. URL:=https://www.haproxy.org/
  28. endef
  29. define Package/haproxy/conffiles
  30. /etc/haproxy.cfg
  31. endef
  32. Package/haproxy-nossl/conffiles = $(Package/haproxy/conffiles)
  33. define Package/haproxy/Default/description
  34. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  35. endef
  36. define Package/haproxy
  37. $(call Package/haproxy/Default)
  38. TITLE+=with SSL support
  39. DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic
  40. VARIANT:=ssl
  41. endef
  42. define Package/haproxy/description
  43. $(call Package/haproxy/Default/description)
  44. This package is built with SSL and LUA support.
  45. endef
  46. define Package/haproxy-nossl
  47. $(call Package/haproxy/Default)
  48. TITLE+=without SSL support
  49. VARIANT:=nossl
  50. DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic
  51. CONFLICTS:=haproxy
  52. endef
  53. define Package/haproxy-nossl/description
  54. $(call Package/haproxy/Default/description)
  55. This package is built without SSL support.
  56. endef
  57. TARGET=linux-glibc
  58. ENABLE_LUA:=y
  59. ifeq ($(CONFIG_USE_UCLIBC),y)
  60. ADDON+=USE_BACKTRACE=
  61. ADDON+=USE_LIBCRYPT=
  62. endif
  63. ifeq ($(CONFIG_USE_MUSL),y)
  64. TARGET=linux-musl
  65. endif
  66. ifeq ($(BUILD_VARIANT),ssl)
  67. ADDON+=USE_OPENSSL=1
  68. ADDON+=ADDLIB="-lcrypto -lm"
  69. endif
  70. define Build/Compile
  71. $(MAKE) TARGET=$(TARGET) -C $(PKG_BUILD_DIR) \
  72. DESTDIR="$(PKG_INSTALL_DIR)" \
  73. CC="$(TARGET_CC)" \
  74. PCREDIR="$(STAGING_DIR)/usr/" \
  75. USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \
  76. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \
  77. USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_PTHREAD_PSHARED=1 USE_LIBATOMIC=1 USE_PROMEX=1 \
  78. VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \
  79. VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \
  80. $(ADDON) \
  81. CFLAGS="$(TARGET_CFLAGS) -fno-strict-aliasing -Wdeclaration-after-statement -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers -Wno-cast-function-type -Wno-address-of-packed-member -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference -fwrapv -fasynchronous-unwind-tables -Wno-null-dereference" \
  82. LD="$(TARGET_CC)" \
  83. LDFLAGS="$(TARGET_LDFLAGS)"
  84. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  85. DESTDIR="$(PKG_INSTALL_DIR)" \
  86. LD="$(TARGET_CC)" \
  87. LDFLAGS="$(TARGET_LDFLAGS)" \
  88. $(MAKE_FLAGS) \
  89. install
  90. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  91. DESTDIR="$(PKG_INSTALL_DIR)" \
  92. CC="$(TARGET_CC)" \
  93. CFLAGS="$(TARGET_CFLAGS) -Wno-address-of-packed-member" \
  94. LDFLAGS="$(TARGET_LDFLAGS)" \
  95. admin/halog/halog
  96. endef
  97. define Package/haproxy/install
  98. $(INSTALL_DIR) $(1)/usr/sbin
  99. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  100. $(INSTALL_DIR) $(1)/etc
  101. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  102. $(INSTALL_DIR) $(1)/etc/init.d
  103. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  104. endef
  105. Package/haproxy-nossl/install = $(Package/haproxy/install)
  106. define Package/halog
  107. $(call Package/haproxy)
  108. TITLE+=halog
  109. DEPENDS:=haproxy
  110. endef
  111. define Package/halog/description
  112. HAProxy Log Analyzer
  113. endef
  114. define Package/halog/install
  115. $(INSTALL_DIR) $(1)/usr/bin
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/admin/halog/halog $(1)/usr/bin/
  117. endef
  118. $(eval $(call BuildPackage,haproxy))
  119. $(eval $(call BuildPackage,halog))
  120. $(eval $(call BuildPackage,haproxy-nossl))