From 8fd566b13361231b2875928ace455ffbee2be759 Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Mon, 28 Sep 2020 15:28:19 +0200
Subject: [PATCH 2/2] only export needed -D<foo> in pkgconfig cflags, not the
 warning & compiler options

---
 Makefile     | 2 +-
 build.mak.in | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index fb0fa3aab..4b8ec6931 100644
--- a/Makefile
+++ b/Makefile
@@ -132,7 +132,7 @@ install:
 		sed -e "s!@PJ_LDLIBS@!!" | \
 		sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \
 		sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \
-		sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
+		sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CFLAGS_DEFONLY)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc
 
 uninstall:
 	$(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc
diff --git a/build.mak.in b/build.mak.in
index abc0c4fa0..5547d9ec5 100644
--- a/build.mak.in
+++ b/build.mak.in
@@ -320,3 +320,4 @@ export PJ_INSTALL_LIB_DIR := @libdir@
 export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@
 export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS)
 export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS)
+export PJ_INSTALL_CFLAGS_DEFONLY = $(filter -D%,$(PJ_INSTALL_CFLAGS))
-- 
2.17.1

