diff mbox

[5/7] restorecond: get pcre cflags/libs from pkg-config

Message ID 20170424175959.20998-5-jason@perfinion.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Zaman April 24, 2017, 5:59 p.m. UTC
Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 restorecond/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox

Patch

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