From abf45cfa2708055ad7392f64167b2c6620018bea Mon Sep 17 00:00:00 2001 From: Zed Date: Sat, 22 Aug 2020 04:44:10 +0200 Subject: [PATCH] Support compiling without PCRE (#12) --- README.md | 6 ++++++ makefiles/variables.mk | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a45a69a..adf9e6d 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,12 @@ it comes to support. `make USE_SYSTEM_NIM=1 test` +### LINK_PCRE + +Link PCRE, defaults to 1. + +`make LINK_PCRE=0` + ## Make targets ### build diff --git a/makefiles/variables.mk b/makefiles/variables.mk index a4f43f8..674d3e7 100644 --- a/makefiles/variables.mk +++ b/makefiles/variables.mk @@ -32,9 +32,12 @@ ifdef LOG_LEVEL endif # avoid a "libpcre.so.3: cannot open shared object file: No such file or directory" message, where possible -ifneq ($(OS), Windows_NT) - ifneq ($(strip $(shell uname)), Darwin) - NIM_PARAMS := $(NIM_PARAMS) -d:usePcreHeader --passL:\"-lpcre\" +LINK_PCRE := 1 +ifeq ($(LINK_PCRE), 1) + ifneq ($(OS), Windows_NT) + ifneq ($(strip $(shell uname)), Darwin) + NIM_PARAMS := $(NIM_PARAMS) -d:usePcreHeader --passL:\"-lpcre\" + endif endif endif