Update mac build to build in pcre2 instead of gnu extended
regular expressions.
@@ -5,13 +5,14 @@ SCOPE_VER:="$(shell git --no-pager describe --abbrev=12 --dirty=+ --always --tag
TEST_CFLAGS=-g -Wall -Wno-nonnull -O0 -coverage -D__MACOS__
TEST_CFLAGS+=-DSCOPE_VER=\"$(SCOPE_VER)\"
TEST_CFLAGS +=-D__MACOS__
-LD_FLAGS=-Wl, -ldl -lpthread
-INCLUDES=-I./contrib/libyaml/include -I./contrib/cJSON -I./os/$(OS)
+LD_FLAGS=$(PCRE2_AR) -Wl, -ldl -lpthread
+INCLUDES=-I./contrib/libyaml/include -I./contrib/cJSON -I./os/$(OS) -I./contrib/pcre2/src
YAML_DEFINES=-DYAML_VERSION_MAJOR="0" -DYAML_VERSION_MINOR="2" -DYAML_VERSION_PATCH="2" -DYAML_VERSION_STRING="\"0.2.2\""
YAML_SRC=$(wildcard contrib/libyaml/src/*.c)
YAML_AR=contrib/libyaml/src/.libs/libyaml.a
JSON_AR=contrib/cJSON/libcjson.a
-TEST_AR=$(YAML_AR) $(JSON_AR)
+PCRE2_AR=contrib/pcre2/build/libpcre2-posix.a contrib/pcre2/build/libpcre2-8.a
+TEST_AR=$(YAML_AR) $(JSON_AR) $(PCRE2_AR)
TEST_LIB=contrib/cmocka/build/src/libcmocka.dylib
TEST_INCLUDES=-I./src -I./contrib/cmocka/include
TEST_LD_FLAGS=-Lcontrib/cmocka/build/src -lcmocka -ldl
@@ -19,8 +20,15 @@ TEST_LD_FLAGS=-Lcontrib/cmocka/build/src -lcmocka -ldl
.PHONY: all clean test
all: libscope.so
+$(PCRE2_AR):
+ @echo "Building pcre2"
+ cd contrib/pcre2 && mkdir -p build
+ cd contrib/pcre2/build && cmake ..
+ cd contrib/pcre2/build && make
+
libscope.so: src/wrap.c src/state.c src/report.c src/plattime.c os/$(OS)/os.c src/cfgutils.c src/cfg.c src/transport.c src/log.c src/mtc.c src/circbuf.c src/linklist.c src/evtformat.c src/ctl.c src/mtcformat.c src/com.c src/dbg.c $(YAML_SRC) contrib/cJSON/cJSON.c
@echo "Building libscope.so ..."
+ make $(PCRE2_AR)
$(CC) $(CFLAGS) -shared -fvisibility=hidden -DSCOPE_VER=\"$(SCOPE_VER)\" $(YAML_DEFINES) -o ./lib/$(OS)/$@ $(INCLUDES) $^ -e,prog_version $(LD_FLAGS)
$(CC) -c $(CFLAGS) -DSCOPE_VER=\"$(SCOPE_VER)\" $(YAML_DEFINES) $(INCLUDES) $^
rm -rf ./test/selfinterpose && mkdir ./test/selfinterpose && mv *.o ./test/selfinterpose/
