File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,23 +8,29 @@ NAME=regex.so
88# the autodetection
99# CROSS_COMPILE=true
1010
11+ PCRE_LIB ?= pcre2-8
12+ PCRE_VERSION ?= $(word 1,$(subst -, , $(PCRE_LIB ) ) )
13+ PCRE_CONFIG ?= $(PCRE_VERSION ) -config
14+
1115ifeq ($(CROSS_COMPILE ) ,)
1216PCRE_BUILDER := $(shell \
13- if which pcre2-config >/dev/null 2>/dev/null; then \
14- echo 'pcre2-config '; \
15- elif pkg-config --exists libpcre2-8 ; then \
16- echo 'pkg-config libpcre2-8 '; \
17+ if which $( PCRE_CONFIG ) >/dev/null 2>/dev/null; then \
18+ echo '$( PCRE_CONFIG ) '; \
19+ elif pkg-config --exists lib $( PCRE_LIB ) ; then \
20+ echo 'pkg-config lib $( PCRE_LIB ) '; \
1721 fi)
1822endif
1923
2024ifeq ($(PCRE_BUILDER ) ,)
2125 DEFS += -I$(SYSBASE)/include \
2226 -I$(LOCALBASE)/include
2327 LIBS += -L$(SYSBASE)/lib \
24- -L$(LOCALBASE)/lib -lpcre2-8
28+ -L$(LOCALBASE)/lib -l$(PCRE_LIB)
2529else
2630 DEFS += $(shell $(PCRE_BUILDER) --cflags)
27- LIBS += $(shell $(PCRE_BUILDER) --libs8)
31+ LIBS += $(shell $(PCRE_BUILDER) --libs 2>/dev/null) \
32+ $(shell $(PCRE_BUILDER) --libs$(word 2,$(subst -, ,$(PCRE_LIB))) 2>/dev/null)
2833endif
34+ DEFS += -D$(shell echo $(PCRE_VERSION ) | tr 'a-z' 'A-Z') _LIB
2935
3036include ../../Makefile.modules
You can’t perform that action at this time.
0 commit comments