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.

194 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. #
  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.7.9
  11. PKG_RELEASE:=02
  12. PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
  14. PKG_HASH:=1072337e54fa188dc6e0cfe3ba4c2200b07082e321cbfe5a0882d85d54db068e
  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. include $(INCLUDE_DIR)/package.mk
  19. define Package/haproxy/Default
  20. SUBMENU:=Web Servers/Proxies
  21. SECTION:=net
  22. CATEGORY:=Network
  23. TITLE:=The Reliable, High Performance TCP/HTTP Load Balancer
  24. URL:=http://haproxy.1wt.eu/
  25. endef
  26. define Download/lua534
  27. FILE:=lua-5.3.4.tar.gz
  28. URL:=http://www.lua.org/ftp/
  29. HASH:=f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c
  30. endef
  31. define Build/Prepare
  32. $(call Build/Prepare/Default)
  33. ifeq ($(ENABLE_LUA),y)
  34. tar -zxvf $(DL_DIR)/lua-5.3.4.tar.gz -C $(PKG_BUILD_DIR)
  35. ln -s $(PKG_BUILD_DIR)/lua-5.3.4 $(PKG_BUILD_DIR)/lua
  36. endif
  37. endef
  38. define Package/haproxy/Default/conffiles
  39. /etc/haproxy.cfg
  40. endef
  41. define Package/haproxy/Default/description
  42. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  43. endef
  44. define Package/haproxy
  45. DEPENDS+= +libpcre +libltdl +zlib +libpthread +libopenssl +libncursesw +libreadline +@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
  46. TITLE+= (with SSL support)
  47. VARIANT:=ssl
  48. $(call Package/haproxy/Default)
  49. endef
  50. define Package/haproxy/conffiles
  51. $(call Package/haproxy/Default/conffiles)
  52. endef
  53. define Package/haproxy/description
  54. $(call Package/haproxy/Default/description)
  55. This package is built with SSL and LUA support.
  56. endef
  57. define Package/haproxy/config
  58. select CONFIG_OPENSSL_WITH_DEPRECATED
  59. $(call Package/haproxy/Default/config)
  60. endef
  61. define Package/haproxy-nossl
  62. TITLE+= (without SSL support)
  63. VARIANT:=nossl
  64. DEPENDS+= +libpcre +libltdl +zlib +libpthread
  65. TITLE+= (without SSL support)
  66. $(call Package/haproxy/Default)
  67. endef
  68. define Package/haproxy-nossl/conffiles
  69. $(call Package/haproxy/Default/conffiles)
  70. endef
  71. define Package/haproxy-nossl/description
  72. $(call Package/haproxy/Default/description)
  73. This package is built without SSL support.
  74. endef
  75. ENABLE_LUA:=y
  76. ifeq ($(CONFIG_mips),y)
  77. ENABLE_LUA:=n
  78. endif
  79. ifeq ($(CONFIG_avr32),y)
  80. LINUX_TARGET:=linux26
  81. else
  82. LINUX_TARGET:=linux2628
  83. endif
  84. ifeq ($(BUILD_VARIANT),ssl)
  85. ADDON+=USE_OPENSSL=1
  86. ADDON+=ADDLIB="-lcrypto -lm "
  87. else ifeq ($(CONFIG_mips),n)
  88. ADDON+=USE_LUA=1
  89. ADDON+=LUA_LIB_NAME="lua534"
  90. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.4/include"
  91. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.4/lib"
  92. else
  93. ADDON+=ADDLIB="-lm"
  94. endif
  95. ifeq ($(ENABLE_LUA),y)
  96. define Build/Compile/lua
  97. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  98. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.4/" \
  99. CC="$(TARGET_CC)" \
  100. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  101. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  102. LD="$(TARGET_LD)" \
  103. linux install
  104. mv $(STAGING_DIR)/lua-5.3.4/lib/liblua.a $(STAGING_DIR)/lua-5.3.4/lib/liblua534.a
  105. endef
  106. endif
  107. define Build/Compile
  108. $(call Build/Compile/lua)
  109. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  110. DESTDIR="$(PKG_INSTALL_DIR)" \
  111. CC="$(TARGET_CC)" \
  112. PCREDIR="$(STAGING_DIR)/usr/" \
  113. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
  114. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_REGPARM=1 \
  115. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1\
  116. VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
  117. $(ADDON)
  118. CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
  119. LD="$(TARGET_LD)" \
  120. LDFLAGS="$(TARGET_LDFLAGS) -lcurses -lreadline" \
  121. GNOREGIT=1
  122. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  123. DESTDIR="$(PKG_INSTALL_DIR)" \
  124. LD="$(TARGET_CC)" \
  125. LDFLAGS="$(TARGET_LDFLAGS)" \
  126. $(MAKE_FLAGS) \
  127. install
  128. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  129. DESTDIR="$(PKG_INSTALL_DIR)" \
  130. $(MAKE_FLAGS) \
  131. ADDLIB="-lcrypto" \
  132. VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
  133. halog
  134. endef
  135. define Package/haproxy/install
  136. $(INSTALL_DIR) $(1)/usr/sbin
  137. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  138. $(INSTALL_DIR) $(1)/etc
  139. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  140. $(INSTALL_DIR) $(1)/etc/init.d
  141. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  142. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  143. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  144. endef
  145. Package/haproxy-nossl/install = $(Package/haproxy/install)
  146. define Package/halog
  147. MENU:=1
  148. $(call Package/haproxy)
  149. TITLE+= halog
  150. DEPENDS:=haproxy
  151. endef
  152. define Package/halog/description
  153. HAProxy Log Analyzer
  154. endef
  155. define Package/halog/install
  156. $(INSTALL_DIR) $(1)/usr/bin
  157. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  158. endef
  159. $(eval $(call Download,lua534))
  160. $(eval $(call BuildPackage,haproxy))
  161. $(eval $(call BuildPackage,halog))
  162. $(eval $(call BuildPackage,haproxy-nossl))