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.

204 lines
5.3 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. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=haproxy
  10. PKG_VERSION:=1.8.9
  11. PKG_RELEASE:=00
  12. PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://www.haproxy.org/download/1.8/src/
  14. PKG_HASH:=436b77927cd85bcd4c2cb3cbf7fb539a5362d9686fdcfa34f37550ca1f5db102
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  16. PKG_LICENSE:=GPL-2.0
  17. MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
  18. ifneq ($(PKG_RELEASE),00)
  19. BUILD_VERSION:=-patch$(PKG_RELEASE)
  20. endif
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/haproxy/Default
  23. SUBMENU:=Web Servers/Proxies
  24. SECTION:=net
  25. CATEGORY:=Network
  26. TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer
  27. URL:=https://www.haproxy.org/
  28. endef
  29. define Download/lua534
  30. FILE:=lua-5.3.4.tar.gz
  31. URL:=https://www.lua.org/ftp/
  32. HASH:=f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c
  33. endef
  34. define Build/Prepare
  35. $(call Build/Prepare/Default)
  36. ifeq ($(ENABLE_LUA),y)
  37. tar -zxvf $(DL_DIR)/lua-5.3.4.tar.gz -C $(PKG_BUILD_DIR)
  38. ln -s $(PKG_BUILD_DIR)/lua-5.3.4 $(PKG_BUILD_DIR)/lua
  39. endif
  40. endef
  41. define Package/haproxy/Default/conffiles
  42. /etc/haproxy.cfg
  43. endef
  44. define Package/haproxy/Default/description
  45. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  46. endef
  47. define Package/haproxy
  48. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +libatomic +@OPENSSL_WITH_DEPRECATED +@OPENSSL_WITH_EC +@OPENSSL_WITH_EC2M +@OPENSSL_WITH_DTLS +@OPENSSL_WITH_COMPRESSION +@OPENSSL_WITH_NPN +@OPENSSL_WITH_PSK +@OPENSSL_WITH_SRP +@OPENSSL_ENGINE_DIGEST +@OPENSSL_ENGINE_CRYPTO
  49. TITLE+= (with SSL support)
  50. VARIANT:=ssl
  51. $(call Package/haproxy/Default)
  52. endef
  53. define Package/haproxy/conffiles
  54. $(call Package/haproxy/Default/conffiles)
  55. endef
  56. define Package/haproxy/description
  57. $(call Package/haproxy/Default/description)
  58. This package is built with SSL and LUA support.
  59. endef
  60. define Package/haproxy/config
  61. select CONFIG_OPENSSL_WITH_DEPRECATED
  62. $(call Package/haproxy/Default/config)
  63. endef
  64. define Package/haproxy-nossl
  65. TITLE+= (without SSL support)
  66. VARIANT:=nossl
  67. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libatomic
  68. TITLE+= (without SSL support)
  69. $(call Package/haproxy/Default)
  70. endef
  71. define Package/haproxy-nossl/conffiles
  72. $(call Package/haproxy/Default/conffiles)
  73. endef
  74. define Package/haproxy-nossl/description
  75. $(call Package/haproxy/Default/description)
  76. This package is built without SSL support.
  77. endef
  78. ENABLE_LUA:=y
  79. ENABLE_REGPARM:=n
  80. ifeq ($(CONFIG_TARGET_x86),y)
  81. ENABLE_REGPARM:=y
  82. endif
  83. ifeq ($(CONFIG_avr32),y)
  84. LINUX_TARGET:=linux26
  85. else
  86. LINUX_TARGET:=linux2628
  87. endif
  88. ifeq ($(BUILD_VARIANT),ssl)
  89. ADDON+=USE_OPENSSL=1
  90. ADDON+=ADDLIB="-lcrypto -lm "
  91. endif
  92. ifeq ($(ENABLE_LUA),y)
  93. ADDON+=USE_LUA=1
  94. ADDON+=LUA_LIB_NAME="lua534"
  95. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.4/include"
  96. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.4/lib"
  97. endif
  98. ifeq ($(ENABLE_REGPARM),y)
  99. ADDON+=USE_REGPARM=1
  100. endif
  101. ifeq ($(ENABLE_LUA),y)
  102. define Build/Compile/lua
  103. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  104. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.4/" \
  105. CC="$(TARGET_CC)" \
  106. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  107. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  108. LD="$(TARGET_LD)" \
  109. linux install
  110. mv $(STAGING_DIR)/lua-5.3.4/lib/liblua.a $(STAGING_DIR)/lua-5.3.4/lib/liblua534.a
  111. endef
  112. endif
  113. define Build/Compile
  114. $(call Build/Compile/lua)
  115. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  116. DESTDIR="$(PKG_INSTALL_DIR)" \
  117. CC="$(TARGET_CC)" \
  118. PCREDIR="$(STAGING_DIR)/usr/" \
  119. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
  120. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 \
  121. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
  122. VERSION="$(PKG_VERSION)$(BUILD_VERSION)" \
  123. $(ADDON) \
  124. CFLAGS="$(TARGET_CFLAGS)" \
  125. LD="$(TARGET_CC)" \
  126. LDFLAGS="$(TARGET_LDFLAGS) -latomic" \
  127. IGNOREGIT=1
  128. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  129. DESTDIR="$(PKG_INSTALL_DIR)" \
  130. LD="$(TARGET_CC)" \
  131. LDFLAGS="$(TARGET_LDFLAGS)" \
  132. $(MAKE_FLAGS) \
  133. install
  134. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  135. DESTDIR="$(PKG_INSTALL_DIR)" \
  136. $(MAKE_FLAGS) \
  137. ADDLIB="-lcrypto" \
  138. VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
  139. halog
  140. endef
  141. define Package/haproxy/install
  142. $(INSTALL_DIR) $(1)/usr/sbin
  143. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  144. $(INSTALL_DIR) $(1)/etc
  145. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  146. $(INSTALL_DIR) $(1)/etc/init.d
  147. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  148. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  149. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  150. endef
  151. Package/haproxy-nossl/install = $(Package/haproxy/install)
  152. define Package/halog
  153. MENU:=1
  154. $(call Package/haproxy)
  155. TITLE+= halog
  156. DEPENDS:=haproxy
  157. endef
  158. define Package/halog/description
  159. HAProxy Log Analyzer
  160. endef
  161. define Package/halog/install
  162. $(INSTALL_DIR) $(1)/usr/bin
  163. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  164. endef
  165. $(eval $(call Download,lua534))
  166. $(eval $(call BuildPackage,haproxy))
  167. $(eval $(call BuildPackage,halog))
  168. $(eval $(call BuildPackage,haproxy-nossl))