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.

184 lines
5.0 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.5
  11. PKG_RELEASE:=01
  12. PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://www.haproxy.org/download/1.7/src/
  14. PKG_MD5SUM:=ed84c80cb97852d2aa3161ed16c48a1c
  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/lua533
  27. FILE:=lua-5.3.3.tar.gz
  28. URL:=http://www.lua.org/ftp/
  29. MD5SUM:=703f75caa4fdf4a911c1a72e67a27498
  30. endef
  31. define Build/Prepare
  32. $(call Build/Prepare/Default)
  33. tar -zxvf $(DL_DIR)/lua-5.3.3.tar.gz -C $(PKG_BUILD_DIR)
  34. ln -s $(PKG_BUILD_DIR)/lua-5.3.3 $(PKG_BUILD_DIR)/lua
  35. endef
  36. define Package/haproxy/Default/conffiles
  37. /etc/haproxy.cfg
  38. endef
  39. define Package/haproxy/Default/description
  40. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  41. endef
  42. define Package/haproxy
  43. 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
  44. TITLE+= (with SSL support)
  45. VARIANT:=ssl
  46. $(call Package/haproxy/Default)
  47. endef
  48. define Package/haproxy/conffiles
  49. $(call Package/haproxy/Default/conffiles)
  50. endef
  51. define Package/haproxy/description
  52. $(call Package/haproxy/Default/description)
  53. This package is built with SSL and LUA support.
  54. endef
  55. define Package/haproxy/config
  56. select CONFIG_OPENSSL_WITH_DEPRECATED
  57. $(call Package/haproxy/Default/config)
  58. endef
  59. define Package/haproxy-nossl
  60. TITLE+= (without SSL support)
  61. VARIANT:=nossl
  62. DEPENDS+= +libpcre +libltdl +zlib +libpthread
  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. ifeq ($(CONFIG_avr32),y)
  74. LINUX_TARGET:=linux26
  75. else
  76. LINUX_TARGET:=linux2628
  77. endif
  78. ifeq ($(BUILD_VARIANT),ssl)
  79. ADDON+=USE_OPENSSL=1
  80. ADDON+=USE_LUA=1
  81. ADDON+=LUA_LIB_NAME="lua533"
  82. ADDON+=LUA_INC="$(STAGING_DIR)/lua-5.3.3/include"
  83. ADDON+=LUA_LIB="$(STAGING_DIR)/lua-5.3.3/lib"
  84. ADDON+=ADDLIB="-lcrypto -lm "
  85. else
  86. ADDON+=ADDLIB="-lm"
  87. endif
  88. define Build/Compile
  89. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR)/lua \
  90. INSTALL_TOP="$(STAGING_DIR)/lua-5.3.3/" \
  91. CC="$(TARGET_CC)" \
  92. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  93. LDFLAGS="$(TARGET_LDFLAGS) -lncurses -lreadline" \
  94. LD="$(TARGET_LD)" \
  95. linux install
  96. mv $(STAGING_DIR)/lua-5.3.3/lib/liblua.a $(STAGING_DIR)/lua-5.3.3/lib/liblua533.a
  97. $(MAKE) TARGET=$(LINUX_TARGET) -C $(PKG_BUILD_DIR) \
  98. DESTDIR="$(PKG_INSTALL_DIR)" \
  99. CC="$(TARGET_CC)" \
  100. PCREDIR="$(STAGING_DIR)/usr/" \
  101. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530 " \
  102. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_REGPARM=1 \
  103. USE_ZLIB=yes USE_PCRE=1 USE_PCRE_JIT=1\
  104. VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
  105. $(ADDON)
  106. CFLAGS="$(TARGET_CFLAGS) -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer -fhonour-copts" \
  107. LD="$(TARGET_LD)" \
  108. LDFLAGS="$(TARGET_LDFLAGS) -lcurses -lreadline" \
  109. GNOREGIT=1
  110. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  111. DESTDIR="$(PKG_INSTALL_DIR)" \
  112. LD="$(TARGET_CC)" \
  113. LDFLAGS="$(TARGET_LDFLAGS)" \
  114. $(MAKE_FLAGS) \
  115. install
  116. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  117. DESTDIR="$(PKG_INSTALL_DIR)" \
  118. $(MAKE_FLAGS) \
  119. ADDLIB="-lcrypto" \
  120. VERSION="$(PKG_VERSION)-patch$(PKG_RELEASE)" \
  121. halog
  122. endef
  123. define Package/haproxy/install
  124. $(INSTALL_DIR) $(1)/usr/sbin
  125. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  126. $(INSTALL_DIR) $(1)/etc
  127. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  128. $(INSTALL_DIR) $(1)/etc/init.d
  129. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  130. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  131. $(INSTALL_BIN) ./files/haproxy.hotplug $(1)/etc/hotplug.d/net/90-haproxy
  132. endef
  133. Package/haproxy-nossl/install = $(Package/haproxy/install)
  134. define Package/halog
  135. MENU:=1
  136. $(call Package/haproxy)
  137. TITLE+= halog
  138. DEPENDS:=haproxy
  139. endef
  140. define Package/halog/description
  141. HAProxy Log Analyzer
  142. endef
  143. define Package/halog/install
  144. $(INSTALL_DIR) $(1)/usr/bin
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  146. endef
  147. $(eval $(call Download,lua533))
  148. $(eval $(call BuildPackage,haproxy))
  149. $(eval $(call BuildPackage,halog))
  150. $(eval $(call BuildPackage,haproxy-nossl))