From 284919152afe72f6b7caa3949a0e894248e4a662 Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Mon, 30 Jan 2012 16:35:37 +0100 Subject: [PATCH] Add ability to USE_SYSTEM_PCRE --- Make.inc | 8 ++++++++ j/Makefile | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Make.inc b/Make.inc index aca5185eddd95..7f4aecd314861 100644 --- a/Make.inc +++ b/Make.inc @@ -50,11 +50,13 @@ TARGET_OPENBLAS_ARCH= USE_SYSTEM_LIBUNWIND=0 USE_SYSTEM_LLVM=0 USE_SYSTEM_READLINE=0 +USE_SYSTEM_PCRE=0 ifeq ($(USE_DEBIAN), 1) USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_LLVM=1 USE_SYSTEM_READLINE=1 +USE_SYSTEM_PCRE=1 endif ifeq ($(USE_SYSTEM_LIBUNWIND), 1) @@ -75,6 +77,12 @@ else READLINE = $(EXTROOT)/lib/libreadline.a -lncurses -lcurses endif +ifeq ($(USE_SYSTEM_PCRE), 1) +PCRE_CONFIG = pcre-config +else +PCRE_CONFIG = $(EXTROOT)/bin/pcre-config +endif + ifeq ($(OS), Linux) SHLIB_EXT = so OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(JULIAHOME)/src/julia.expmap $(LIBUNWIND) diff --git a/j/Makefile b/j/Makefile index 058d28a82d156..7db3ab0f03c4a 100644 --- a/j/Makefile +++ b/j/Makefile @@ -6,7 +6,7 @@ PCRE_CONST = 0x[0-9a-fA-F]+|[-+]?\s*[0-9]+ all: pcre_h.j errno_h.j pcre_h.j: - $(QUIET_PERL) cpp -dM $(EXTROOT)/include/pcre.h | perl -nle '/^\s*#define\s+(PCRE\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@ + $(QUIET_PERL) cpp -dM $(shell $(PCRE_CONFIG) --prefix)/include/pcre.h | perl -nle '/^\s*#define\s+(PCRE\w*)\s*\(?($(PCRE_CONST))\)?\s*$$/ and print "const $$1 = int32($$2)"' | sort > $@ errno_h.j: $(QUIET_PERL) echo '#include "errno.h"' | cpp -dM - | perl -nle 'print "const $$1 = int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | sort > $@