diff mbox

[2/7] libselinux: get pcre CFLAGS/LDFLAGS from pkg-config

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

Commit Message

Jason Zaman April 24, 2017, 5:59 p.m. UTC
Gentoo-Bug: https://bugs.gentoo.org/500674

Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 libselinux/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/libselinux/Makefile b/libselinux/Makefile
index 979e225..98776d2 100644
--- a/libselinux/Makefile
+++ b/libselinux/Makefile
@@ -1,5 +1,6 @@ 
 SUBDIRS = src include utils man
 
+PKG_CONFIG ?= pkg-config
 DISABLE_SETRANS ?= n
 DISABLE_RPM ?= n
 ANDROID_HOST ?= n
@@ -20,10 +21,11 @@  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
-	PCRE_LDFLAGS := -lpcre2-8
+	PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
+	PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
 else
-	PCRE_LDFLAGS := -lpcre
+	PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
+	PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre)
 endif
 export PCRE_CFLAGS PCRE_LDFLAGS