提交 6ae3052c 编写于 作者: E Eric Blake

build: consistently use CFLAGS

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 (libvirt_driver_vmware_la_CFLAGS): Use AM_CFLAGS.
(INCLUDES): Move CFLAGS items...
(AM_CFLAGS): ...to their proper location.
* python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
* tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
(commandtest_CFLAGS, commandhelper_CFLAGS)
(virnetmessagetest_CFLAGS, virnetsockettest_CFLAGS): Use AM_CFLAGS.
上级 8c58abea
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
SUBDIRS= . tests SUBDIRS= . tests
INCLUDES = \ INCLUDES = \
$(WARN_CFLAGS) \ $(PYTHON_INCLUDES) \
$(PYTHON_INCLUDES) \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_builddir)/include \ -I$(top_builddir)/include \
-I$(top_builddir)/$(subdir) -I$(top_builddir)/$(subdir)
AM_CFLAGS = $(WARN_CFLAGS)
DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION) DOCS_DIR = $(datadir)/doc/libvirt-python-$(LIBVIRT_VERSION)
DOCS = ${srcdir}/TODO DOCS = ${srcdir}/TODO
......
...@@ -3,20 +3,19 @@ ...@@ -3,20 +3,19 @@
# No libraries with the exception of LIBXML should be listed # No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets # here. List them against the individual XXX_la_CFLAGS targets
# that actually use them # that actually use them
INCLUDES = \ INCLUDES = -I$(top_srcdir)/gnulib/lib \
-I$(top_srcdir)/gnulib/lib \
-I../gnulib/lib \ -I../gnulib/lib \
-I../include \ -I../include \
-I@top_srcdir@/src/util \ -I@top_srcdir@/src/util \
-I@top_srcdir@/include \ -I@top_srcdir@/include \
$(DRIVER_MODULE_CFLAGS) \ -DIN_LIBVIRT
AM_CFLAGS = $(DRIVER_MODULE_CFLAGS) \
$(LIBXML_CFLAGS) \ $(LIBXML_CFLAGS) \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
$(LOCK_CHECKING_CFLAGS) \ $(LOCK_CHECKING_CFLAGS) \
-DIN_LIBVIRT \ $(WIN32_EXTRA_CFLAGS) \
$(WIN32_EXTRA_CFLAGS) $(COVERAGE_CFLAGS)
AM_CFLAGS = $(COVERAGE_CFLAGS)
AM_LDFLAGS = $(COVERAGE_LDFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS)
EXTRA_DIST = $(conf_DATA) EXTRA_DIST = $(conf_DATA)
...@@ -640,7 +639,7 @@ noinst_LTLIBRARIES += libvirt_driver_vmware.la ...@@ -640,7 +639,7 @@ noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
endif endif
libvirt_driver_vmware_la_CFLAGS = \ libvirt_driver_vmware_la_CFLAGS = \
-I@top_srcdir@/src/conf -I@top_srcdir@/src/vmx -I@top_srcdir@/src/conf -I@top_srcdir@/src/vmx $(AM_CFLAGS)
if WITH_DRIVER_MODULES if WITH_DRIVER_MODULES
libvirt_driver_vmware_la_LIBADD = ../gnulib/lib/libgnu.la libvirt_driver_vmware_la_LIBADD = ../gnulib/lib/libgnu.la
libvirt_driver_vmware_la_LDFLAGS = -module -avoid-version libvirt_driver_vmware_la_LDFLAGS = -module -avoid-version
......
...@@ -8,15 +8,17 @@ INCLUDES = \ ...@@ -8,15 +8,17 @@ INCLUDES = \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/src \ -I$(top_srcdir)/src \
-I$(top_srcdir)/src/util \ -I$(top_srcdir)/src/util \
-I$(top_srcdir)/src/conf \ -I$(top_srcdir)/src/conf
AM_CFLAGS = \
$(LIBXML_CFLAGS) \ $(LIBXML_CFLAGS) \
$(GNUTLS_CFLAGS) \ $(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \ $(SASL_CFLAGS) \
$(SELINUX_CFLAGS) \ $(SELINUX_CFLAGS) \
$(APPARMOR_CFLAGS) \ $(APPARMOR_CFLAGS) \
$(YAJL_CFLAGS) \ $(YAJL_CFLAGS) \
$(COVERAGE_CFLAGS) \ $(COVERAGE_CFLAGS) \
$(WARN_CFLAGS) $(WARN_CFLAGS)
if WITH_DRIVER_MODULES if WITH_DRIVER_MODULES
INCLUDES += \ INCLUDES += \
...@@ -419,22 +421,22 @@ nodeinfotest_LDADD = $(LDADDS) ...@@ -419,22 +421,22 @@ nodeinfotest_LDADD = $(LDADDS)
commandtest_SOURCES = \ commandtest_SOURCES = \
commandtest.c testutils.h testutils.c commandtest.c testutils.h testutils.c
commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" commandtest_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
commandtest_LDADD = $(LDADDS) commandtest_LDADD = $(LDADDS)
commandhelper_SOURCES = \ commandhelper_SOURCES = \
commandhelper.c commandhelper.c
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
commandhelper_LDADD = $(LDADDS) commandhelper_LDADD = $(LDADDS)
virnetmessagetest_SOURCES = \ virnetmessagetest_SOURCES = \
virnetmessagetest.c testutils.h testutils.c virnetmessagetest.c testutils.h testutils.c
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS) virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
virnetsockettest_SOURCES = \ virnetsockettest_SOURCES = \
virnetsockettest.c testutils.h testutils.c virnetsockettest.c testutils.h testutils.c
virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS) virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册