50f0910cf0
This patch moves all pcre1/2 dependencies into the new files regex.h and regex.c implementing the common denominator of features needed by libselinux. The compiler flag -DUSE_PCRE2 toggles between the used implementations. As of this patch libselinux supports either pcre or pcre2 but not both at the same time. The persistently stored file contexts information differs. This means libselinux can only load file context files generated by sefcontext_compile build with the same pcre variant. Also, for pcre2 the persistent format is architecture dependent. Stored precompiled regular expressions can only be used on the same architecture they were generated on. If pcre2 is used, sefcontext_compile now respects the "-r". This flag makes sefcontext_compile include the precompiled regular expressions in the output file. The default is to omit them, so that the output remains portable at the cost of having to recompile the regular expressions at load time, or rather on first use. Signed-off-by: Janis Danisevskis <jdanis@google.com>
56 lines
1.1 KiB
Makefile
56 lines
1.1 KiB
Makefile
SUBDIRS = src include utils man
|
|
|
|
DISABLE_AVC ?= n
|
|
DISABLE_SETRANS ?= n
|
|
DISABLE_RPM ?= n
|
|
DISABLE_BOOL ?= n
|
|
ifeq ($(EMBEDDED),y)
|
|
override DISABLE_AVC=y
|
|
override DISABLE_SETRANS=y
|
|
override DISABLE_RPM=y
|
|
override DISABLE_BOOL=y
|
|
endif
|
|
ifeq ($(DISABLE_AVC),y)
|
|
EMFLAGS+= -DDISABLE_AVC
|
|
endif
|
|
ifeq ($(DISABLE_BOOL),y)
|
|
EMFLAGS+= -DDISABLE_BOOL
|
|
endif
|
|
ifeq ($(DISABLE_RPM),y)
|
|
EMFLAGS+= -DDISABLE_RPM
|
|
endif
|
|
ifeq ($(DISABLE_SETRANS),y)
|
|
EMFLAGS+= -DDISABLE_SETRANS
|
|
endif
|
|
export DISABLE_AVC DISABLE_SETRANS DISABLE_RPM DISABLE_BOOL EMFLAGS
|
|
|
|
USE_PCRE2 ?= n
|
|
ifeq ($(USE_PCRE2),y)
|
|
PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
|
|
PCRE_LDFLAGS := -lpcre2-8
|
|
else
|
|
PCRE_LDFLAGS := -lpcre
|
|
endif
|
|
export PCRE_CFLAGS PCRE_LDFLAGS
|
|
|
|
all install relabel clean distclean indent:
|
|
@for subdir in $(SUBDIRS); do \
|
|
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
|
done
|
|
|
|
swigify: all
|
|
$(MAKE) -C src swigify $@
|
|
|
|
pywrap:
|
|
$(MAKE) -C src pywrap $@
|
|
|
|
rubywrap:
|
|
$(MAKE) -C src rubywrap $@
|
|
|
|
install-pywrap:
|
|
$(MAKE) -C src install-pywrap $@
|
|
|
|
install-rubywrap:
|
|
$(MAKE) -C src install-rubywrap $@
|
|
|
|
test:
|