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.

163 lines
4.6 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:=2.1.5
  12. PKG_RELEASE:=1
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=https://www.haproxy.org/download/2.1/src
  15. PKG_HASH:=42174ac5836ab243565b888299ec30115c1259e75872696708528260c6700ea1
  16. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
  17. Christian Lachner <gladiac@gmail.com>
  18. PKG_LICENSE:=GPL-2.0-only
  19. PKG_LICENSE_FILES:=LICENSE
  20. PKG_CPE_ID:=cpe:/a:haproxy:haproxy
  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 Build/Prepare
  30. $(call Build/Prepare/Default)
  31. endef
  32. define Package/haproxy/Default/conffiles
  33. /etc/haproxy.cfg
  34. endef
  35. define Package/haproxy/Default/description
  36. Open source Reliable, High Performance TCP/HTTP Load Balancer.
  37. endef
  38. define Package/haproxy
  39. DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libopenssl +libncurses +libreadline +libatomic
  40. TITLE+= (with SSL support)
  41. VARIANT:=ssl
  42. $(call Package/haproxy/Default)
  43. endef
  44. define Package/haproxy/conffiles
  45. $(call Package/haproxy/Default/conffiles)
  46. endef
  47. define Package/haproxy/description
  48. $(call Package/haproxy/Default/description)
  49. This package is built with SSL and LUA support.
  50. endef
  51. define Package/haproxy-nossl
  52. TITLE+= (without SSL support)
  53. VARIANT:=nossl
  54. DEPENDS+= +libpcre +libltdl +zlib +libpthread +liblua5.3 +libatomic
  55. TITLE+= (without SSL support)
  56. $(call Package/haproxy/Default)
  57. endef
  58. define Package/haproxy-nossl/conffiles
  59. $(call Package/haproxy/Default/conffiles)
  60. endef
  61. define Package/haproxy-nossl/description
  62. $(call Package/haproxy/Default/description)
  63. This package is built without SSL support.
  64. endef
  65. ENABLE_LUA:=y
  66. ENABLE_REGPARM:=n
  67. ifeq ($(CONFIG_TARGET_x86),y)
  68. ENABLE_REGPARM:=y
  69. endif
  70. ifeq ($(CONFIG_USE_UCLIBC),y)
  71. ADDON+=USE_LIBCRYPT=
  72. endif
  73. ifeq ($(BUILD_VARIANT),ssl)
  74. ADDON+=USE_OPENSSL=1
  75. ADDON+=ADDLIB="-lcrypto -lm"
  76. endif
  77. ifeq ($(ENABLE_REGPARM),y)
  78. ADDON+=USE_REGPARM=1
  79. endif
  80. define Build/Compile
  81. $(MAKE) TARGET=linux-glibc -C $(PKG_BUILD_DIR) \
  82. DESTDIR="$(PKG_INSTALL_DIR)" \
  83. CC="$(TARGET_CC)" \
  84. PCREDIR="$(STAGING_DIR)/usr/" \
  85. USE_LUA=1 LUA_LIB_NAME="lua5.3" LUA_INC="$(STAGING_DIR)/usr/include/lua5.3" LUA_LIB="$(STAGING_DIR)/usr/lib" \
  86. SMALL_OPTS="-DBUFSIZE=16384 -DMAXREWRITE=1030 -DSYSTEM_MAXCONN=165530" \
  87. USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 USE_TFO=1 USE_NS=1 \
  88. USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_GETADDRINFO=1 \
  89. USE_THREAD=1 USE_PTHREAD_PSHARED=1 \
  90. VERSION="$(PKG_VERSION)" SUBVERS="-$(PKG_RELEASE)" \
  91. VERDATE="$(shell date -d @$(SOURCE_DATE_EPOCH) '+%Y/%m/%d')" IGNOREGIT=1 \
  92. $(ADDON) USE_BACKTRACE= \
  93. CFLAGS="$(TARGET_CFLAGS) -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-format-truncation -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-old-style-declaration -Wno-ignored-qualifiers -Wno-clobbered -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-stringop-overflow -Wno-cast-function-type -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference" \
  94. LD="$(TARGET_CC)" \
  95. LDFLAGS="$(TARGET_LDFLAGS) -latomic" \
  96. EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o"
  97. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
  98. DESTDIR="$(PKG_INSTALL_DIR)" \
  99. LD="$(TARGET_CC)" \
  100. LDFLAGS="$(TARGET_LDFLAGS)" \
  101. $(MAKE_FLAGS) \
  102. install
  103. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/contrib/halog \
  104. DESTDIR="$(PKG_INSTALL_DIR)" \
  105. $(MAKE_FLAGS) \
  106. OPTIMIZE="$(TARGET_CFLAGS)" \
  107. ADDLIB="-lcrypto" \
  108. halog
  109. endef
  110. define Package/haproxy/install
  111. $(INSTALL_DIR) $(1)/usr/sbin
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/haproxy $(1)/usr/sbin/
  113. $(INSTALL_DIR) $(1)/etc
  114. $(INSTALL_CONF) ./files/haproxy.cfg $(1)/etc/
  115. $(INSTALL_DIR) $(1)/etc/init.d
  116. $(INSTALL_BIN) ./files/haproxy.init $(1)/etc/init.d/haproxy
  117. endef
  118. Package/haproxy-nossl/install = $(Package/haproxy/install)
  119. define Package/halog
  120. MENU:=1
  121. $(call Package/haproxy)
  122. TITLE+= halog
  123. DEPENDS:=haproxy
  124. endef
  125. define Package/halog/description
  126. HAProxy Log Analyzer
  127. endef
  128. define Package/halog/install
  129. $(INSTALL_DIR) $(1)/usr/bin
  130. $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/halog/halog $(1)/usr/bin/
  131. endef
  132. $(eval $(call BuildPackage,haproxy))
  133. $(eval $(call BuildPackage,halog))
  134. $(eval $(call BuildPackage,haproxy-nossl))