Signed-off-by: Jason Zaman <[email protected]>
---
 restorecond/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/restorecond/Makefile b/restorecond/Makefile
index 5016753..b1df89f 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -21,12 +21,15 @@ override CFLAGS += $(DBUSFLAGS)
 
 USE_PCRE2 ?= n
 ifeq ($(USE_PCRE2),y)
-       PCRE_LDFLAGS := -lpcre2-8
+       PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell 
$(PKG_CONFIG) --cflags libpcre2-8)
+       PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
 else
-       PCRE_LDFLAGS := -lpcre
+       PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
+       PCRE_LDLIBS := $(shell $(PKG_CONFIG) --libs libpcre)
 endif
+export PCRE_CFLAGS PCRE_LDLIBS
 
-LDLIBS += -lselinux $(PCRE_LDFLAGS) $(DBUSLIB) -L$(LIBDIR)
+LDLIBS += -lselinux $(PCRE_LDLIBS) $(DBUSLIB)
 
 all: restorecond
 
-- 
2.10.2

Reply via email to