0001-Allow-configuration-of-pcre-config-path.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From f3dcdf6c9ffea4d9b89dca9706a48c44bd76c470 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 28 Sep 2018 19:21:26 +0200
  4. Subject: [PATCH] Allow configuration of pcre-config path
  5. Add PCRE_CONFIGDIR variable to allow the user to configure path of
  6. pcre-config or pcre-config2 instead of using the one in his path.
  7. This is particular useful when cross-compiling.
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. ---
  10. Makefile | 7 ++++---
  11. 1 file changed, 4 insertions(+), 3 deletions(-)
  12. diff --git a/Makefile b/Makefile
  13. index 382f944f..7c31f1ba 100644
  14. --- a/Makefile
  15. +++ b/Makefile
  16. @@ -78,6 +78,7 @@
  17. # Other variables :
  18. # DLMALLOC_SRC : build with dlmalloc, indicate the location of dlmalloc.c.
  19. # DLMALLOC_THRES : should match PAGE_SIZE on every platform (default: 4096).
  20. +# PCRE_CONFIGDIR : force the path to pcre-config or pcre-config2
  21. # PCREDIR : force the path to libpcre.
  22. # PCRE_LIB : force the lib path to libpcre (defaults to $PCREDIR/lib).
  23. # PCRE_INC : force the include path to libpcre ($PCREDIR/inc)
  24. @@ -734,7 +735,7 @@ endif
  25. # Forcing PCREDIR to an empty string will let the compiler use the default
  26. # locations.
  27. -PCREDIR := $(shell pcre-config --prefix 2>/dev/null || echo /usr/local)
  28. +PCREDIR := $(shell $(PCRE_CONFIGDIR)pcre-config --prefix 2>/dev/null || echo /usr/local)
  29. ifneq ($(PCREDIR),)
  30. PCRE_INC := $(PCREDIR)/include
  31. PCRE_LIB := $(PCREDIR)/lib
  32. @@ -759,7 +760,7 @@ endif
  33. endif
  34. ifneq ($(USE_PCRE2)$(USE_STATIC_PCRE2)$(USE_PCRE2_JIT),)
  35. -PCRE2DIR := $(shell pcre2-config --prefix 2>/dev/null || echo /usr/local)
  36. +PCRE2DIR := $(shell $(PCRE_CONFIGDIR)pcre2-config --prefix 2>/dev/null || echo /usr/local)
  37. ifneq ($(PCRE2DIR),)
  38. PCRE2_INC := $(PCRE2DIR)/include
  39. PCRE2_LIB := $(PCRE2DIR)/lib
  40. @@ -777,7 +778,7 @@ endif
  41. endif
  42. -PCRE2_LDFLAGS := $(shell pcre2-config --libs$(PCRE2_WIDTH) 2>/dev/null || echo -L/usr/local/lib -lpcre2-$(PCRE2_WIDTH))
  43. +PCRE2_LDFLAGS := $(shell $(PCRE_CONFIGDIR)pcre2-config --libs$(PCRE2_WIDTH) 2>/dev/null || echo -L/usr/local/lib -lpcre2-$(PCRE2_WIDTH))
  44. ifeq ($(PCRE2_LDFLAGS),)
  45. $(error libpcre2-$(PCRE2_WIDTH) not found)
  46. --
  47. 2.17.1