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.

202 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. # 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.13
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://www.haproxy.org/download/1.8/src/
  15. PKG_HASH:=2bf5dafbb5f1530c0e67ab63666565de948591f8e0ee2a1d3c84c45e738220f1
  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 +@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
  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/config
  60. select CONFIG_OPENSSL_WITH_DEPRECATED
  61. $(call Package/haproxy/Default/config)
  62. endef
  63. define Package/haproxy-nossl
  64. TITLE+= (without SSL support)
  65. VARIANT:=nossl
  66. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libatomic
  67. TITLE+= (without SSL support)
  68. $(call Package/haproxy/Default)
  69. endef
  70. define Package/haproxy-nossl/conffiles
  71. $(call Package/haproxy/Default/conffiles)
  72. endef
  73. define Package/haproxy-nossl/description
  74. $(call Package/haproxy/Default/description)
  75. This package is built without SSL support.
  76. endef
  77. ENABLE_LUA:=y
  78. ENABLE_REGPARM:=n
  79. ifeq ($(CONFIG_TARGET_x86),y)
  80. ENABLE_REGPARM:=y
  81. endif
  82. ifeq ($(CONFIG_avr32),y)
  83. LINUX_TARGET:=linux26
  84. else
  85. LINUX_TARGET:=linux2628
  86. endif
  87. ifeq ($(BUILD_VARIANT),ssl)
  88. ADDON+=USE_OPENSSL=1
  89. ADDON+=ADDLIB="-lcrypto -lm "
  90. endif
  91. ifeq ($(ENABLE_LUA),y)
  92. ADDON+=USE_LUA=1
  93. ADDON+=LUA_LIB_NAME="lua535"
  94. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.5/include"
  95. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.5/lib"
  96. endif
  97. ifeq ($(ENABLE_REGPARM),y)
  98. ADDON+=USE_REGPARM=1
  99. endif
  100. ifeq ($(ENABLE_LUA),y)
  101. define Build/Compile/lua
  102. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  103. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.5/" \
  104. CC="$(TARGET_CC)" \
  105. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  106. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  107. LD="$(TARGET_LD)" \
  108. linux install
  109. mv $(STAGING_DIR)/lua-5.3.5/lib/liblua.a $(STAGING_DIR)/lua-5.3.5/lib/liblua535.a
  110. endef
  111. endif
  112. define Build/Compile
  113. $(call Build/Compile/lua)
  114. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  115. DESTDIR="$(PKG_INSTALL_DIR)" \
  116. CC="$(TARGET_CC)" \
  117. PCREDIR="$(STAGING_DIR)/usr/" \
  118. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
  119. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 \
  120. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
  121. VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" \
  122. $(ADDON) \
  123. CFLAGS="$(TARGET_CFLAGS)" \
  124. LD="$(TARGET_CC)" \
  125. LDFLAGS="$(TARGET_LDFLAGS) -latomic" \
  126. IGNOREGIT=1
  127. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  128. DESTDIR="$(PKG_INSTALL_DIR)" \
  129. LD="$(TARGET_CC)" \
  130. LDFLAGS="$(TARGET_LDFLAGS)" \
  131. $(MAKE_FLAGS) \
  132. install
  133. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  134. DESTDIR="$(PKG_INSTALL_DIR)" \
  135. $(MAKE_FLAGS) \
  136. ADDLIB="-lcrypto" \
  137. VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" \
  138. halog
  139. endef
  140. define Package/haproxy/install
  141. $(INSTALL_DIR) $(1)/usr/sbin
  142. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  143. $(INSTALL_DIR) $(1)/etc
  144. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  145. $(INSTALL_DIR) $(1)/etc/init.d
  146. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  147. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  148. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  149. endef
  150. Package/haproxy-nossl/install = $(Package/haproxy/install)
  151. define Package/halog
  152. MENU:=1
  153. $(call Package/haproxy)
  154. TITLE+= halog
  155. DEPENDS:=haproxy
  156. endef
  157. define Package/halog/description
  158. HAProxy Log Analyzer
  159. endef
  160. define Package/halog/install
  161. $(INSTALL_DIR) $(1)/usr/bin
  162. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  163. endef
  164. $(eval $(call Download,lua535))
  165. $(eval $(call BuildPackage,haproxy))
  166. $(eval $(call BuildPackage,halog))
  167. $(eval $(call BuildPackage,haproxy-nossl))