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.

191 lines
4.9 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:=1.8.19
  12. PKG_RELEASE:=2
  13. PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://www.haproxy.org/download/1.8/src/
  15. PKG_HASH:=64f5fbfd4e09ffeaf26cb6667398ba780704a14e96e60000caa8bf69962ba734
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  17. PKG_LICENSE:=GPL-2.0
  18. MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
  19. Christian Lachner <gladiac@gmail.com>
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/haproxy/Default
  22. SUBMENU:=Web Servers/Proxies
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer
  26. URL:=https://www.haproxy.org/
  27. endef
  28. define Download/lua535
  29. FILE:=lua-5.3.5.tar.gz
  30. URL:=https://www.lua.org/ftp/
  31. HASH:=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
  32. endef
  33. define Build/Prepare
  34. $(call Build/Prepare/Default)
  35. ifeq ($(ENABLE_LUA),y)
  36. tar -zxvf $(DL_DIR)/lua-5.3.5.tar.gz -C $(PKG_BUILD_DIR)
  37. ln -s $(PKG_BUILD_DIR)/lua-5.3.5 $(PKG_BUILD_DIR)/lua
  38. endif
  39. endef
  40. define Package/haproxy/Default/conffiles
  41. /etc/haproxy.cfg
  42. endef
  43. define Package/haproxy/Default/description
  44. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  45. endef
  46. define Package/haproxy
  47. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +libatomic
  48. TITLE+= (with SSL support)
  49. VARIANT:=ssl
  50. $(call Package/haproxy/Default)
  51. endef
  52. define Package/haproxy/conffiles
  53. $(call Package/haproxy/Default/conffiles)
  54. endef
  55. define Package/haproxy/description
  56. $(call Package/haproxy/Default/description)
  57. This package is built with SSL and LUA support.
  58. endef
  59. define Package/haproxy-nossl
  60. TITLE+= (without SSL support)
  61. VARIANT:=nossl
  62. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libatomic
  63. TITLE+= (without SSL support)
  64. $(call Package/haproxy/Default)
  65. endef
  66. define Package/haproxy-nossl/conffiles
  67. $(call Package/haproxy/Default/conffiles)
  68. endef
  69. define Package/haproxy-nossl/description
  70. $(call Package/haproxy/Default/description)
  71. This package is built without SSL support.
  72. endef
  73. ENABLE_LUA:=y
  74. ENABLE_REGPARM:=n
  75. ifeq ($(CONFIG_TARGET_x86),y)
  76. ENABLE_REGPARM:=y
  77. endif
  78. LINUX_TARGET:=linux2628
  79. ifeq ($(BUILD_VARIANT),ssl)
  80. ADDON+=USE_OPENSSL=1
  81. ADDON+=ADDLIB="-lcrypto -lm "
  82. endif
  83. ifeq ($(ENABLE_LUA),y)
  84. ADDON+=USE_LUA=1
  85. ADDON+=LUA_LIB_NAME="lua535"
  86. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.5/include"
  87. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.5/lib"
  88. endif
  89. ifeq ($(ENABLE_REGPARM),y)
  90. ADDON+=USE_REGPARM=1
  91. endif
  92. ifeq ($(ENABLE_LUA),y)
  93. define Build/Compile/lua
  94. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  95. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.5/" \
  96. CC="$(TARGET_CC)" \
  97. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  98. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  99. LD="$(TARGET_LD)" \
  100. linux install
  101. mv $(STAGING_DIR)/lua-5.3.5/lib/liblua.a $(STAGING_DIR)/lua-5.3.5/lib/liblua535.a
  102. endef
  103. endif
  104. define Build/Compile
  105. $(call Build/Compile/lua)
  106. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  107. DESTDIR="$(PKG_INSTALL_DIR)" \
  108. CC="$(TARGET_CC)" \
  109. PCREDIR="$(STAGING_DIR)/usr/" \
  110. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \
  111. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 \
  112. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
  113. VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \
  114. VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \
  115. $(ADDON) \
  116. CFLAGS="$(TARGET_CFLAGS)" \
  117. LD="$(TARGET_CC)" \
  118. LDFLAGS="$(TARGET_LDFLAGS) -latomic"
  119. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  120. DESTDIR="$(PKG_INSTALL_DIR)" \
  121. LD="$(TARGET_CC)" \
  122. LDFLAGS="$(TARGET_LDFLAGS)" \
  123. $(MAKE_FLAGS) \
  124. install
  125. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  126. DESTDIR="$(PKG_INSTALL_DIR)" \
  127. $(MAKE_FLAGS) \
  128. ADDLIB="-lcrypto" \
  129. halog
  130. endef
  131. define Package/haproxy/install
  132. $(INSTALL_DIR) $(1)/usr/sbin
  133. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  134. $(INSTALL_DIR) $(1)/etc
  135. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  136. $(INSTALL_DIR) $(1)/etc/init.d
  137. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  138. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  139. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  140. endef
  141. Package/haproxy-nossl/install = $(Package/haproxy/install)
  142. define Package/halog
  143. MENU:=1
  144. $(call Package/haproxy)
  145. TITLE+= halog
  146. DEPENDS:=haproxy
  147. endef
  148. define Package/halog/description
  149. HAProxy Log Analyzer
  150. endef
  151. define Package/halog/install
  152. $(INSTALL_DIR) $(1)/usr/bin
  153. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  154. endef
  155. $(eval $(call Download,lua535))
  156. $(eval $(call BuildPackage,haproxy))
  157. $(eval $(call BuildPackage,halog))
  158. $(eval $(call BuildPackage,haproxy-nossl))