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.

198 lines
5.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:=1.8.14
  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:=b17e402578be85e58af7a3eac99b1f675953bea9f67af2e964cf8bdbd1bd3fdf
  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. LINUX_TARGET:=linux2628
  83. ifeq ($(BUILD_VARIANT),ssl)
  84. ADDON+=USE_OPENSSL=1
  85. ADDON+=ADDLIB="-lcrypto -lm "
  86. endif
  87. ifeq ($(ENABLE_LUA),y)
  88. ADDON+=USE_LUA=1
  89. ADDON+=LUA_LIB_NAME="lua535"
  90. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.5/include"
  91. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.5/lib"
  92. endif
  93. ifeq ($(ENABLE_REGPARM),y)
  94. ADDON+=USE_REGPARM=1
  95. endif
  96. ifeq ($(ENABLE_LUA),y)
  97. define Build/Compile/lua
  98. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  99. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.5/" \
  100. CC="$(TARGET_CC)" \
  101. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  102. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  103. LD="$(TARGET_LD)" \
  104. linux install
  105. mv $(STAGING_DIR)/lua-5.3.5/lib/liblua.a $(STAGING_DIR)/lua-5.3.5/lib/liblua535.a
  106. endef
  107. endif
  108. define Build/Compile
  109. $(call Build/Compile/lua)
  110. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  111. DESTDIR="$(PKG_INSTALL_DIR)" \
  112. CC="$(TARGET_CC)" \
  113. PCREDIR="$(STAGING_DIR)/usr/" \
  114. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
  115. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 \
  116. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
  117. VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" \
  118. $(ADDON) \
  119. CFLAGS="$(TARGET_CFLAGS)" \
  120. LD="$(TARGET_CC)" \
  121. LDFLAGS="$(TARGET_LDFLAGS) -latomic" \
  122. IGNOREGIT=1
  123. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  124. DESTDIR="$(PKG_INSTALL_DIR)" \
  125. LD="$(TARGET_CC)" \
  126. LDFLAGS="$(TARGET_LDFLAGS)" \
  127. $(MAKE_FLAGS) \
  128. install
  129. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  130. DESTDIR="$(PKG_INSTALL_DIR)" \
  131. $(MAKE_FLAGS) \
  132. ADDLIB="-lcrypto" \
  133. VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" \
  134. halog
  135. endef
  136. define Package/haproxy/install
  137. $(INSTALL_DIR) $(1)/usr/sbin
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  139. $(INSTALL_DIR) $(1)/etc
  140. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  141. $(INSTALL_DIR) $(1)/etc/init.d
  142. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  143. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  144. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  145. endef
  146. Package/haproxy-nossl/install = $(Package/haproxy/install)
  147. define Package/halog
  148. MENU:=1
  149. $(call Package/haproxy)
  150. TITLE+= halog
  151. DEPENDS:=haproxy
  152. endef
  153. define Package/halog/description
  154. HAProxy Log Analyzer
  155. endef
  156. define Package/halog/install
  157. $(INSTALL_DIR) $(1)/usr/bin
  158. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  159. endef
  160. $(eval $(call Download,lua535))
  161. $(eval $(call BuildPackage,haproxy))
  162. $(eval $(call BuildPackage,halog))
  163. $(eval $(call BuildPackage,haproxy-nossl))