[PATCH] Makefile.am: use pkg-config for json-c

David Ward david.ward at ll.mit.edu
Sun Aug 30 18:05:43 UTC 2015


Use pkg-config to locate the json-c headers during compilation, as
is done for the glib2 headers. This fixes build errors with Fedora
and RHEL, and it was also tested on Ubuntu Precise and Ubuntu Wily.

Cc: Naresh Bhat <naresh.bhat at linaro.org>
Signed-off-by: David Ward <david.ward at ll.mit.edu>
---
 src/Makefile.am           |    4 ++--
 src/acpica/Makefile.am    |    4 ++--
 src/lib/src/Makefile.am   |    4 ++--
 src/utilities/Makefile.am |    3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 9c8e35e..6336b7d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,8 +11,8 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/acpica/source/include \
 	-I$(top_srcdir)/src/acpica/source/compiler \
 	-I$(top_srcdir)/efi_runtime \
-	-I=/usr/include/json \
-	-I=/usr/include/json-c \
+	`pkg-config --silence-errors --cflags json` \
+	`pkg-config --silence-errors --cflags json-c` \
 	-pthread `pkg-config --cflags glib-2.0 gio-2.0` \
 	-Wall -Werror -Wextra
 
diff --git a/src/acpica/Makefile.am b/src/acpica/Makefile.am
index 33d7444..24e1f70 100644
--- a/src/acpica/Makefile.am
+++ b/src/acpica/Makefile.am
@@ -8,8 +8,8 @@ AM_CPPFLAGS = 						\
 	-D_LINUX -DNDEBUG -D_CONSOLE -DACPI_EXEC_APP	\
 	-I$(top_srcdir)/src/lib/include			\
 	-I$(srcdir)/source/include			\
-	-I=/usr/include/json				\
-	-I=/usr/include/json-c				\
+	`pkg-config --silence-errors --cflags json`	\
+	`pkg-config --silence-errors --cflags json-c`	\
 	-Wall -fno-strict-aliasing
 
 #
diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am
index e1d9af5..f3abde8 100644
--- a/src/lib/src/Makefile.am
+++ b/src/lib/src/Makefile.am
@@ -2,8 +2,8 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/lib/include 		\
 	-I$(top_srcdir)/src/acpica/source/include	\
 	-I$(top_srcdir)/src/acpica/source/compiler	\
-	-I=/usr/include/json				\
-	-I=/usr/include/json-c				\
+	`pkg-config --silence-errors --cflags json`	\
+	`pkg-config --silence-errors --cflags json-c`	\
 	`pkg-config --cflags glib-2.0 gio-2.0` 		\
 	-DDATAROOTDIR=\"$(datarootdir)\"		\
 	-Wall -Werror -Wextra
diff --git a/src/utilities/Makefile.am b/src/utilities/Makefile.am
index 82e8c58..3160a35 100644
--- a/src/utilities/Makefile.am
+++ b/src/utilities/Makefile.am
@@ -1,5 +1,6 @@
 AM_CPPFLAGS = -Wall -Werror -Wextra -DDATAROOTDIR=\"$(datarootdir)\" \
-	-I=/usr/include/json -I=/usr/include/json-c
+	`pkg-config --silence-errors --cflags json` \
+	`pkg-config --silence-errors --cflags json-c`
 
 bin_PROGRAMS = kernelscan
 kernelscan_SOURCES = kernelscan.c
-- 
1.7.1




More information about the fwts-devel mailing list