]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: Allow configuration of pcre-config path
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Fri, 28 Sep 2018 17:21:26 +0000 (19:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 30 Sep 2018 14:23:04 +0000 (16:23 +0200)
Add PCRE_CONFIG and PCRE2_CONFIG variables to allow the user to
configure path of pcre-config or pcre2-config instead of using the one
in his path.
This is particulary useful when cross-compiling.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Makefile

index 382f944f3d828cc246d93f0289e55f956bcd786e..074e016981aff0d6914c166e20a432cfb394c828 100644 (file)
--- a/Makefile
+++ b/Makefile
 # Other variables :
 #   DLMALLOC_SRC   : build with dlmalloc, indicate the location of dlmalloc.c.
 #   DLMALLOC_THRES : should match PAGE_SIZE on every platform (default: 4096).
+#   PCRE_CONFIG    : force the binary path to get pcre config (by default
+#                                                              pcre-config)
 #   PCREDIR        : force the path to libpcre.
 #   PCRE_LIB       : force the lib path to libpcre (defaults to $PCREDIR/lib).
 #   PCRE_INC       : force the include path to libpcre ($PCREDIR/inc)
+#   PCRE2_CONFIG   : force the binary path to get pcre2 config (by default
+#                                                               pcre2-config)
 #   SSL_LIB        : force the lib path to libssl/libcrypto
 #   SSL_INC        : force the include path to libssl/libcrypto
 #   LUA_LIB        : force the lib path to lua
@@ -734,7 +738,8 @@ endif
 # Forcing PCREDIR to an empty string will let the compiler use the default
 # locations.
 
-PCREDIR                := $(shell pcre-config --prefix 2>/dev/null || echo /usr/local)
+PCRE_CONFIG            := pcre-config
+PCREDIR                := $(shell $(PCRE_CONFIG) --prefix 2>/dev/null || echo /usr/local)
 ifneq ($(PCREDIR),)
 PCRE_INC        := $(PCREDIR)/include
 PCRE_LIB        := $(PCREDIR)/lib
@@ -759,7 +764,8 @@ endif
 endif
 
 ifneq ($(USE_PCRE2)$(USE_STATIC_PCRE2)$(USE_PCRE2_JIT),)
-PCRE2DIR       := $(shell pcre2-config --prefix 2>/dev/null || echo /usr/local)
+PCRE2_CONFIG   := pcre2-config
+PCRE2DIR       := $(shell $(PCRE2_CONFIG) --prefix 2>/dev/null || echo /usr/local)
 ifneq ($(PCRE2DIR),)
 PCRE2_INC       := $(PCRE2DIR)/include
 PCRE2_LIB       := $(PCRE2DIR)/lib
@@ -777,7 +783,7 @@ endif
 endif
 
 
-PCRE2_LDFLAGS  := $(shell pcre2-config --libs$(PCRE2_WIDTH) 2>/dev/null || echo -L/usr/local/lib -lpcre2-$(PCRE2_WIDTH))
+PCRE2_LDFLAGS  := $(shell $(PCRE2_CONFIG) --libs$(PCRE2_WIDTH) 2>/dev/null || echo -L/usr/local/lib -lpcre2-$(PCRE2_WIDTH))
 
 ifeq ($(PCRE2_LDFLAGS),)
 $(error libpcre2-$(PCRE2_WIDTH) not found)