According to the automake manual, CPPFLAGS (aka INCLUDES, as spelled
in automake 1.9.6) should only include -I, -D, and -U directives; more
generic directives like -Wall belong in CFLAGS since they affect more
phases of the build process. Therefore, we should be sticking CFLAGS
additions into a CFLAGS container, not a CPPFLAGS container.
* src/Makefile.am (INCLUDES): Move CFLAGS items...
(AM_CFLAGS): ...to their proper location.
* python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
* tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
---
python/Makefile.am | 5 +++--
src/Makefile.am | 15 +++++++--------
tests/Makefile.am | 8 +++++---
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index 432ad70..0edb3e4 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -3,12 +3,13 @@
SUBDIRS= . tests
INCLUDES = \
- $(WARN_CFLAGS) \
- $(PYTHON_INCLUDES) \
+ $(PYTHON_INCLUDES) \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I$(top_builddir)/$(subdir)
+AM_CFLAGS = $(WARN_CFLAGS)
+
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
DOCS = ${srcdir}/TODO
diff --git a/src/Makefile.am b/src/Makefile.am
index 02d53ee..292fa30 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,20 +3,19 @@
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
# that actually use them
-INCLUDES = \
- -I$(top_srcdir)/gnulib/lib \
+INCLUDES = -I$(top_srcdir)/gnulib/lib \
-I../gnulib/lib \
-I../include \
-I@top_srcdir@/src/util \
-I@top_srcdir@/include \
- $(DRIVER_MODULE_CFLAGS) \
+ -DIN_LIBVIRT
+
+AM_CFLAGS = $(DRIVER_MODULE_CFLAGS) \
$(LIBXML_CFLAGS) \
$(WARN_CFLAGS) \
- $(LOCK_CHECKING_CFLAGS) \
- -DIN_LIBVIRT \
- $(WIN32_EXTRA_CFLAGS)
-
-AM_CFLAGS = $(COVERAGE_CFLAGS)
+ $(LOCK_CHECKING_CFLAGS) \
+ $(WIN32_EXTRA_CFLAGS) \
+ $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(COVERAGE_LDFLAGS)
EXTRA_DIST = $(conf_DATA)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7ae50a2..2b21d82 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,14 +8,16 @@ INCLUDES = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \
- -I$(top_srcdir)/src/conf \
+ -I$(top_srcdir)/src/conf
+
+AM_CFLAGS = \
$(LIBXML_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
$(SELINUX_CFLAGS) \
$(APPARMOR_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- $(WARN_CFLAGS)
+ $(COVERAGE_CFLAGS) \
+ $(WARN_CFLAGS)
if WITH_DRIVER_MODULES
INCLUDES += \
--
1.7.4.4