diff --git a/libselinux/Makefile b/libselinux/Makefile index 98776d24..1ecab178 100644 --- a/libselinux/Makefile +++ b/libselinux/Makefile @@ -22,12 +22,12 @@ export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST USE_PCRE2 ?= n ifeq ($(USE_PCRE2),y) PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8) - PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre2-8) + PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8) else PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre) - PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre) + PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre) endif -export PCRE_CFLAGS PCRE_LDFLAGS +export PCRE_CFLAGS PCRE_LDLIBS OS := $(shell uname) export OS diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index a277b871..c685e66b 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -91,7 +91,7 @@ override LDFLAGS += -L/opt/local/lib -undefined dynamic_lookup LD_SONAME_FLAGS=-install_name,$(LIBSO) endif -PCRE_LDFLAGS ?= -lpcre +PCRE_LDLIBS ?= -lpcre override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) @@ -143,8 +143,8 @@ $(LIBA): $(OBJS) $(RANLIB) $@ $(LIBSO): $(LOBJS) - $(CC) $(CFLAGS) -shared -o $@ $^ $(PCRE_LDFLAGS) -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,$(LD_SONAME_FLAGS) - ln -sf $@ $(TARGET) + $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(PCRE_LDLIBS) -ldl -L$(LIBDIR) -Wl,$(LD_SONAME_FLAGS) + ln -sf $@ $(TARGET) $(LIBPC): $(LIBPC).in ../VERSION sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBBASE):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile index 954da450..68f7097f 100644 --- a/libselinux/utils/Makefile +++ b/libselinux/utils/Makefile @@ -46,7 +46,7 @@ endif override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS) LDLIBS += -L../src -lselinux -L$(LIBDIR) -PCRE_LDFLAGS ?= -lpcre +PCRE_LDLIBS ?= -lpcre ifeq ($(ANDROID_HOST),y) TARGETS=sefcontext_compile @@ -54,7 +54,7 @@ else TARGETS=$(patsubst %.c,%,$(wildcard *.c)) endif -sefcontext_compile: LDLIBS += $(PCRE_LDFLAGS) ../src/libselinux.a -lsepol +sefcontext_compile: LDLIBS += $(PCRE_LDLIBS) ../src/libselinux.a -lsepol sefcontext_compile: sefcontext_compile.o ../src/regex.o