Skip to content

Commit

Permalink
Add ability to USE_SYSTEM_PCRE
Browse files Browse the repository at this point in the history
  • Loading branch information
Viral B. Shah committed Jan 30, 2012
1 parent 5b184ae commit 2849191
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Make.inc
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion j/Makefile
Expand Up @@ -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 > $@
Expand Down

6 comments on commit 2849191

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little dubious about using this one. PCRE has a lot of configure-time options and the behavior of regular expression are pretty central to the language. Have you tried this out with the system PCRE? Does everything appear to work fine?

@ViralBShah
Copy link
Member

@ViralBShah ViralBShah commented on 2849191 Jan 30, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's central in the sense that it's not a feature you can leave out. If PCRE is compiled with the wrong options or doesn't support the same options as the ones we expect, regex support will just break. For example, we definitely need Unicode support turned on. I have no idea why the hashing tests would fail with this change. Strange.

@ViralBShah
Copy link
Member

@ViralBShah ViralBShah commented on 2849191 Jan 31, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViralBShah
Copy link
Member

@ViralBShah ViralBShah commented on 2849191 Jan 31, 2012 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they're definitely not sufficient. I'll take a crack at that.

Please sign in to comment.