[libvirt] [RESEND PATCHv3 0/3] fix build dependencies

https://bugzilla.redhat.com/show_bug.cgi?id=589465 was marked incomplete, because VIR_DOMAIN_START_PAUSED did not make it into the python bindings of 0.8.1-10.el6. Matthias Bolte was kind enough to help me figure out why (see patch 2/3 for details - but the short story was a Makefile dependency problem that failed to rebuild the API documentation after an addition to libvirt.h.in). I was a bit surprised when I could not repeat the test on the tip of my development tree, which means I already have pending patches previously posted to the list but not yet reviewed that are already sufficient to resolve the problem. Hence this resend. Eric Blake (3): build: restore operation of bit-rotted 'make cov' build: fix VPATH build of docs autobuild.sh: use VPATH build .gitignore | 4 ++ Makefile.am | 9 +++- autobuild.sh | 10 ++-- configure.ac | 1 + daemon/.gitignore | 2 - docs/Makefile.am | 48 ++++++++++++--------- docs/apibuild.py | 18 ++++++-- m4/compiler-flags.m4 | 1 - src/.gitignore | 3 - src/Makefile.am | 112 +++++++++++++++++++++++++++----------------------- tests/.gitignore | 2 - 11 files changed, 117 insertions(+), 93 deletions(-)

'./autobuild.sh' with lcov installed discovered that our coverage support has been bit-rotting for a while. This restores it back to a successful state, although I have not yet spent any time looking through the resulting files to look for low-hanging fruit in the unit test coverage front. * configure.ac: Clear COMPILER_FLAGS at right place. * Makefile.am (cov): Newer genhtml no longer likes plain -s. * m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST COMPILER_FLAGS; it is a shell variable for use in configure only. * src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make it easier to provide global flag additions. Use throughout, to uniformly apply coverage flags. * .gitignore: Globally ignore gcov output. * daemon/.gitignore: Simplify. * src/.gitignore: Likewise. * tests/.gitignore: Likewise. --- No change from https://www.redhat.com/archives/libvir-list/2010-June/msg00220.html .gitignore | 3 + Makefile.am | 9 +++- configure.ac | 1 + daemon/.gitignore | 2 - m4/compiler-flags.m4 | 1 - src/.gitignore | 3 - src/Makefile.am | 112 +++++++++++++++++++++++++++----------------------- tests/.gitignore | 2 - 8 files changed, 70 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 39ed671..c62e885 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ *.#*# *.a *.exe +*.gcda +*.gcno +*.gcov *.o *.orig *.rej diff --git a/Makefile.am b/Makefile.am index 286b13b..1343d7c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,10 +68,13 @@ tests: cov: clean-cov mkdir $(top_builddir)/coverage - $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/daemon -d $(top_srcdir)/tests - $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr* + $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp \ + -d $(top_srcdir)/src -d $(top_srcdir)/daemon -d $(top_srcdir)/tests + $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp \ + -o $(top_builddir)/coverage/libvirt.info rm $(top_builddir)/coverage/libvirt.info.tmp - $(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info + $(GENHTML) --show-details -t "libvirt" -o $(top_builddir)/coverage \ + --legend $(top_builddir)/coverage/libvirt.info clean-cov: rm -rf $(top_builddir)/coverage diff --git a/configure.ac b/configure.ac index 691ef69..67aaac2 100644 --- a/configure.ac +++ b/configure.ac @@ -1688,6 +1688,7 @@ AC_ARG_ENABLE([test-coverage], enable_coverage=$enableval if test "${enable_coverage}" = yes; then + COMPILER_FLAGS= gl_COMPILER_FLAGS(-fprofile-arcs) gl_COMPILER_FLAGS(-ftest-coverage) AC_SUBST([COVERAGE_CFLAGS], [$COMPILER_FLAGS]) diff --git a/daemon/.gitignore b/daemon/.gitignore index 4f4b612..ca390e2 100644 --- a/daemon/.gitignore +++ b/daemon/.gitignore @@ -1,5 +1,3 @@ -*.gcda -*.gcno *.la *.lo .deps diff --git a/m4/compiler-flags.m4 b/m4/compiler-flags.m4 index 628bd1f..6db4816 100644 --- a/m4/compiler-flags.m4 +++ b/m4/compiler-flags.m4 @@ -23,7 +23,6 @@ AC_DEFUN([gl_COMPILER_FLAGS], [AC_MSG_CHECKING(whether compiler accepts $1) - AC_SUBST(COMPILER_FLAGS) ac_save_CFLAGS="$CFLAGS" dnl Some flags are dependant, so we set all previously checked dnl flags when testing. Except for -Werror which we have to diff --git a/src/.gitignore b/src/.gitignore index d24a87d..5d114c9 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -6,9 +6,6 @@ Makefile.in *.loT *.la *.exe -*.gcda -*.gcno -*.gcov *.cov libvirt_parthelper libvirt_lxc diff --git a/src/Makefile.am b/src/Makefile.am index ece18a6..c2d192e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,9 @@ INCLUDES = \ -DIN_LIBVIRT \ $(WIN32_EXTRA_CFLAGS) +AM_CFLAGS = $(COVERAGE_CFLAGS) +AM_LDFLAGS = $(COVERAGE_LDFLAGS) + EXTRA_DIST = $(conf_DATA) BUILT_SOURCES = @@ -418,20 +421,21 @@ libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD) libvirt_la_BUILT_LIBADD = libvirt_util.la libvirt_util_la_SOURCES = \ $(UTIL_SOURCES) -libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) +libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \ + $(AM_CFLAGS) libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) $(LIB_PTHREAD) noinst_LTLIBRARIES += libvirt_conf.la libvirt_la_BUILT_LIBADD += libvirt_conf.la libvirt_conf_la_SOURCES = $(CONF_SOURCES) -libvirt_conf_la_CFLAGS = -libvirt_conf_la_LDFLAGS = +libvirt_conf_la_CFLAGS = $(AM_CFLAGS) +libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS) noinst_LTLIBRARIES += libvirt_cpu.la libvirt_la_BUILT_LIBADD += libvirt_cpu.la libvirt_cpu_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) libvirt_cpu_la_SOURCES = $(CPU_SOURCES) @@ -440,7 +444,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver.la libvirt_driver_la_SOURCES = $(DRIVER_SOURCES) libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) $(GNUTLS_CFLAGS) \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS) USED_SYM_FILES = libvirt_private.syms @@ -453,9 +457,9 @@ noinst_LTLIBRARIES += libvirt_driver_test.la libvirt_la_BUILT_LIBADD += libvirt_driver_test.la endif libvirt_driver_test_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_test_la_LDFLAGS = -module -avoid-version +libvirt_driver_test_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) endif libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES) endif @@ -470,8 +474,9 @@ endif libvirt_driver_remote_la_CFLAGS = \ $(GNUTLS_CFLAGS) \ $(SASL_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_remote_la_LDFLAGS = + -I@top_srcdir@/src/conf \ + $(AM_CFLAGS) +libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) $(SASL_LIBS) if WITH_DRIVER_MODULES libvirt_driver_remote_la_LDFLAGS += -module -avoid-version @@ -520,8 +525,9 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la endif libvirt_driver_xen_la_CFLAGS = \ $(XEN_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_xen_la_LDFLAGS = + -I@top_srcdir@/src/conf \ + $(AM_CFLAGS) +libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_xen_la_LIBADD = $(XEN_LIBS) if WITH_DRIVER_MODULES libvirt_driver_xen_la_LDFLAGS += -module -avoid-version @@ -538,7 +544,7 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la endif libvirt_driver_phyp_la_LIBADD = $(LIBSSH2_LIBS) libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS) \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES) endif @@ -550,9 +556,9 @@ noinst_LTLIBRARIES += libvirt_driver_openvz.la libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la endif libvirt_driver_openvz_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version +libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) endif libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES) endif @@ -565,9 +571,9 @@ noinst_LTLIBRARIES += libvirt_driver_vbox.la libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la endif libvirt_driver_vbox_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version +libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) endif libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS) libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES) @@ -581,8 +587,8 @@ noinst_LTLIBRARIES += libvirt_driver_xenapi.la libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la endif libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(LIBCURL_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_xenapi_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(LIBCURL_LIBS) if WITH_DRIVER_MODULES libvirt_driver_xenapi_la_LDFLAGS += -module -avoid-version @@ -599,8 +605,8 @@ noinst_LTLIBRARIES += libvirt_driver_qemu.la #libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la endif libvirt_driver_qemu_la_CFLAGS = $(NUMACTL_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_qemu_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_qemu_la_LIBADD = $(NUMACTL_LIBS) if WITH_DRIVER_MODULES libvirt_driver_qemu_la_LDFLAGS += -module -avoid-version @@ -626,9 +632,9 @@ noinst_LTLIBRARIES += libvirt_driver_lxc.la #libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la endif libvirt_driver_lxc_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version +libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) endif libvirt_driver_lxc_la_SOURCES = $(LXC_DRIVER_SOURCES) @@ -649,8 +655,8 @@ noinst_LTLIBRARIES += libvirt_driver_uml.la #libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la endif libvirt_driver_uml_la_CFLAGS = $(NUMACTL_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_uml_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_uml_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_uml_la_LIBADD = $(NUMACTL_LIBS) if WITH_DRIVER_MODULES libvirt_driver_uml_la_LDFLAGS += -module -avoid-version @@ -667,8 +673,8 @@ noinst_LTLIBRARIES += libvirt_driver_one.la #libvirt_la_BUILT_LIBADD += libvirt_driver_one.la endif libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_one_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_one_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_one_la_LIBADD = $(XMLRPC_LIBS) #libvirt_driver_one_la_CFLAGS = "-DWITH_ONE" if WITH_DRIVER_MODULES @@ -691,8 +697,8 @@ noinst_LTLIBRARIES += libvirt_driver_esx.la libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la endif libvirt_driver_esx_la_CFLAGS = $(LIBCURL_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_esx_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_esx_la_LIBADD = $(LIBCURL_LIBS) if WITH_DRIVER_MODULES libvirt_driver_esx_la_LDFLAGS += -module -avoid-version @@ -710,9 +716,9 @@ noinst_LTLIBRARIES += libvirt_driver_network.la #libvirt_la_BUILT_LIBADD += libvirt_driver_network.la endif libvirt_driver_network_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_network_la_LDFLAGS = -module -avoid-version +libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) endif libvirt_driver_network_la_SOURCES = $(NETWORK_DRIVER_SOURCES) endif @@ -729,8 +735,8 @@ noinst_LTLIBRARIES += libvirt_driver_interface.la libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la endif libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_interface_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_interface_la_LIBADD = $(NETCF_LIBS) if WITH_DRIVER_MODULES libvirt_driver_interface_la_LDFLAGS += -module -avoid-version @@ -747,9 +753,9 @@ noinst_LTLIBRARIES += libvirt_driver_secret.la #libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la endif libvirt_driver_secret_la_CFLAGS = \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf $(AM_CFLAGS) if WITH_DRIVER_MODULES -libvirt_driver_secret_la_LDFLAGS = -module -avoid-version +libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la endif libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES) @@ -758,8 +764,8 @@ endif # Needed to keep automake quiet about conditionals libvirt_driver_storage_la_SOURCES = libvirt_driver_storage_la_CFLAGS = \ - -I@top_srcdir@/src/conf -libvirt_driver_storage_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_storage_la_LIBADD = if WITH_STORAGE_DIR if WITH_DRIVER_MODULES @@ -810,8 +816,8 @@ endif libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) libvirt_driver_nodedev_la_CFLAGS = \ - -I@top_srcdir@/src/conf -libvirt_driver_nodedev_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_nodedev_la_LIBADD = if HAVE_HAL libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) @@ -838,8 +844,8 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la noinst_LTLIBRARIES += libvirt_driver_nwfilter.la endif libvirt_driver_nwfilter_la_CFLAGS = $(LIBPCAP_CFLAGS) \ - -I@top_srcdir@/src/conf -libvirt_driver_nwfilter_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_nwfilter_la_LDFLAGS = $(LD_AMFLAGS) libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS) if WITH_DRIVER_MODULES libvirt_driver_nwfilter_la_LDFLAGS += -module -avoid-version @@ -853,8 +859,8 @@ libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES) noinst_LTLIBRARIES += libvirt_driver_security.la libvirt_la_BUILT_LIBADD += libvirt_driver_security.la libvirt_driver_security_la_CFLAGS = \ - -I@top_srcdir@/src/conf -libvirt_driver_security_la_LDFLAGS = + -I@top_srcdir@/src/conf $(AM_CFLAGS) +libvirt_driver_security_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_security_la_LIBADD = if WITH_SECDRIVER_SELINUX libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES) @@ -997,13 +1003,13 @@ libvirt.def: libvirt.syms libvirt_la_SOURCES = libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \ -version-info $(LIBVIRT_VERSION_INFO) \ - $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \ + $(AM_LDFLAGS) \ $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la libvirt_la_LIBADD += $(LIBXML_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) -libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT +libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS) # Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we # lose automake's automatic dependencies on an appropriate subset of # $(libvirt_la_LIBADD). But we were careful to create @@ -1025,8 +1031,8 @@ test_LDFLAGS = \ # Just like the above, but with a slightly different set of public symbols. libvirt_test_la_SOURCES = $(libvirt_la_SOURCES) libvirt_test_la_LIBADD = $(libvirt_la_LIBADD) -libvirt_test_la_LDFLAGS = $(test_LDFLAGS) -libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS) +libvirt_test_la_LDFLAGS = $(test_LDFLAGS) $(AM_LDFLAGS) +libvirt_test_la_CFLAGS = $(AM_CFLAGS) libexec_PROGRAMS = @@ -1036,9 +1042,9 @@ if WITH_LIBVIRTD libexec_PROGRAMS += libvirt_parthelper libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES) -libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(COVERAGE_LDFLAGS) +libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS) libvirt_parthelper_LDADD = $(LIBPARTED_LIBS) ../gnulib/lib/libgnu.la -libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) +libvirt_parthelper_CFLAGS = $(LIBPARTED_CFLAGS) $(AM_CFLAGS) endif endif EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES) @@ -1056,7 +1062,7 @@ libvirt_lxc_SOURCES = \ $(DOMAIN_CONF_SOURCES) \ $(CPU_CONF_SOURCES) \ $(NWFILTER_PARAM_CONF_SOURCES) -libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) +libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(AM_LDFLAGS) libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \ $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ $(LIBNL_LIBS) ../gnulib/lib/libgnu.la @@ -1065,7 +1071,8 @@ libvirt_lxc_CFLAGS = \ $(NUMACTL_CFLAGS) \ $(CAPNG_CFLAGS) \ $(YAJL_CFLAGS) \ - -I@top_srcdir@/src/conf + -I@top_srcdir@/src/conf \ + $(AM_CFLAGS) endif endif EXTRA_DIST += $(LXC_CONTROLLER_SOURCES) @@ -1076,7 +1083,7 @@ libexec_PROGRAMS += virt-aa-helper virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) -virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS) +virt_aa_helper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS) virt_aa_helper_LDADD = \ $(LIBXML_LIBS) \ libvirt_conf.la \ @@ -1084,7 +1091,8 @@ virt_aa_helper_LDADD = \ ../gnulib/lib/libgnu.la virt_aa_helper_CFLAGS = \ -I@top_srcdir@/src/conf \ - -I@top_srcdir@/src/security + -I@top_srcdir@/src/security \ + $(AM_CFLAGS) endif endif EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES) diff --git a/tests/.gitignore b/tests/.gitignore index 387a924..3f32939 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -23,8 +23,6 @@ statstest qparamtest seclabeltest eventtest -*.gcda -*.gcno *.exe object-locking object-locking.cmi -- 1.7.0.1

On 06/25/2010 09:30 AM, Eric Blake wrote:
'./autobuild.sh' with lcov installed discovered that our coverage support has been bit-rotting for a while. This restores it back to a successful state, although I have not yet spent any time looking through the resulting files to look for low-hanging fruit in the unit test coverage front.
* configure.ac: Clear COMPILER_FLAGS at right place. * Makefile.am (cov): Newer genhtml no longer likes plain -s. * m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST COMPILER_FLAGS; it is a shell variable for use in configure only. * src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make it easier to provide global flag additions. Use throughout, to uniformly apply coverage flags. * .gitignore: Globally ignore gcov output. * daemon/.gitignore: Simplify. * src/.gitignore: Likewise. * tests/.gitignore: Likewise. ---
No change from https://www.redhat.com/archives/libvir-list/2010-June/msg00220.html
Correction - several minor changes from the original post in order to resolve conflicts during the rebase on top of other recent Makefile.am changes. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/6/25 Eric Blake <eblake@redhat.com>:
'./autobuild.sh' with lcov installed discovered that our coverage support has been bit-rotting for a while. This restores it back to a successful state, although I have not yet spent any time looking through the resulting files to look for low-hanging fruit in the unit test coverage front.
* configure.ac: Clear COMPILER_FLAGS at right place. * Makefile.am (cov): Newer genhtml no longer likes plain -s. * m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST COMPILER_FLAGS; it is a shell variable for use in configure only. * src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make it easier to provide global flag additions. Use throughout, to uniformly apply coverage flags. * .gitignore: Globally ignore gcov output. * daemon/.gitignore: Simplify. * src/.gitignore: Likewise. * tests/.gitignore: Likewise. ---
ACK, with this patch applied make cov works again. Matthias

The rule of thumb for generated files: If they are distributed, they should be generated in $(srcdir); otherwise, they should be built by the end user in $(builddir). Since our .xml docs are built with python, and we want them available even to end users that don't build with python, we want them distributed; hence, they must live in $(srcdir). Tested with 'make distcheck' in both an in-tree build and a VPATH build. * docs/Makefile.am (dot_html_in, patches): Massage wildcard correctly. (EXTRA_DIST): Remove redundant listing of xml files. (api, web, maintainer-clean-local): Update location. (html/index.html): Likewise, and dump all generated files in correct location. ($(devhelphtml)): Since we distribute .xml, build it in srcdir. (html/%-%.html, html/%-virterror.html, %-api.xml, %-refs.xml): Rewrite with... (python_generated_files): ...new macro. * docs/apibuild.py (srcPref): Define. (docBuilder.serialize): Put output in srcdir. (docBuilder.serialize_xrefs_references): Update location. (rebuild): Look for built libvirt.h in builddir. --- No change from https://www.redhat.com/archives/libvir-list/2010-June/msg00051.html. However, testing reveals that this fixes the dependency issue described by Matthias on IRC: [17:20] <photron> eblake_out: i can reproduce a depedency problem here [17:20] <photron> steps to reproduce [17:20] <photron> change include/libvirt.h.in, e.g. a a new item to an enum [17:20] <photron> run make [17:20] <photron> include/libvirt.h gets regerenated, as expected [17:20] <photron> docs/libvirt-api.xml doesn't list the new item, but it should [17:24] <photron> eblake_out: i can fix that by reverting a79fb1c491197a91094cd2345c3d7bbba40da2fd partly [17:25] <photron> then chnaging the input files for apibuild.py triggers a regeneration of libvirt-api.xml again Commit a79fb1c4 is part of 0.8.0, which explains why 0.8.1-10.el6 did not pick up VIR_DOMAIN_START_PAUSED (the api docs were not regenerated correctly, due to the missing dependency). The addition of $(python_generated_files) and better spelling of their dependencies in the patch below serves as the partial reversion of a79fb1c that is sufficient to resolve the problem in BZ 589465. docs/Makefile.am | 48 ++++++++++++++++++++++++++++-------------------- docs/apibuild.py | 18 +++++++++++++----- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 41068c6..57979e2 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -53,10 +53,10 @@ gif = \ architecture.gif \ node.gif -dot_html_in = $(wildcard *.html.in) +dot_html_in = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/*.html.in)) dot_html = $(dot_html_in:%.html.in=%.html) -patches = $(wildcard api_extension/*.patch) +patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch)) xml = \ libvirt-api.xml \ @@ -70,8 +70,8 @@ fig = \ libvirt-object-model.fig EXTRA_DIST= \ - libvirt-api.xml libvirt-refs.xml apibuild.py \ - site.xsl newapi.xsl news.xsl page.xsl ChangeLog.xsl \ + apibuild.py \ + site.xsl newapi.xsl news.xsl page.xsl ChangeLog.xsl \ $(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \ $(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \ $(xml) $(fig) $(png) \ @@ -83,9 +83,10 @@ MAINTAINERCLEANFILES = $(dot_html) $(apihtml) $(devhelphtml) all: web -api: libvirt-api.xml libvirt-refs.xml +api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml -web: $(dot_html) html/index.html devhelp/index.html +web: $(srcdir)/$(dot_html) $(srcdir)/html/index.html \ + $(srcdir)/devhelp/index.html ChangeLog.xml: ../ChangeLog ChangeLog.awk awk -f ChangeLog.awk < $< > $@ @@ -117,11 +118,13 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl || { rm $@ && exit 1; }; \ else echo "missing XHTML1 DTD" ; fi ; fi - -html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in +$(srcdir)/html/index.html: $(srcdir)/libvirt-api.xml newapi.xsl page.xsl \ + sitemap.html.in -@if [ -x $(XSLTPROC) ] ; then \ echo "Rebuilding the HTML pages from the XML API" ; \ - $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi + $(XSLTPROC) --nonet -o $(srcdir)/ \ + $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml; \ + fi -@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" \ > /dev/null ; then \ @@ -129,19 +132,24 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(XMLLINT) --nonet --valid --noout html/*.html ; \ else echo "missing XHTML1 DTD" ; fi ; fi -$(devhelphtml): libvirt-api.xml $(devhelpxsl) +$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl) -@echo Rebuilding devhelp files -@if [ -x $(XSLTPROC) ] ; then \ - $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \ - $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi - -html/%-%.html html/%-virterror.html %-api.xml %-refs.xml: $(srcdir)/apibuild.py - -srcdir=$(srcdir) $(srcdir)/apibuild.py - -html/%-%.html html/%-virterror.html %-api.xml %-refs.xml: \ - $(srcdir)/../include/%/*.h \ - $(srcdir)/../src/%.c \ + $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \ + $(srcdir)/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; \ + fi + +python_generated_files = \ + $(srcdir)/html/libvirt-libvirt.html \ + $(srcdir)/html/libvirt-virterror.html \ + $(srcdir)/libvirt-api.xml \ + $(srcdir)/libvirt-refs.xml + +$(python_generated_files): $(srcdir)/apibuild.py \ + $(srcdir)/../include/libvirt/*.h \ + $(srcdir)/../src/libvirt.c \ $(srcdir)/../src/util/virterror.c + -srcdir=$(srcdir) $(srcdir)/apibuild.py check-local: all @@ -149,7 +157,7 @@ clean-local: rm -f *~ *.bak *.hierarchy *.signals *-unused.txt maintainer-clean-local: clean-local - rm -rf libvirt-api.xml libvirt-refs.xml + rm -rf $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml rebuild: api all diff --git a/docs/apibuild.py b/docs/apibuild.py index 2dda4df..990451c 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -11,6 +11,13 @@ import os, sys import string import glob +if __name__ == "__main__": + # launched as a script + srcPref = os.path.dirname(sys.argv[0]) +else: + # imported + srcPref = os.path.dirname(__file__) + debug=0 debugsym=None @@ -1983,7 +1990,7 @@ class docBuilder: idf = self.idx.identifiers[id] module = idf.header output.write(" <reference name='%s' href='%s'/>\n" % (id, - 'html/' + self.basename + '-' + + 'html/' + self.basename + '-' + self.modulename_file(module) + '.html#' + id)) @@ -2057,7 +2064,7 @@ class docBuilder: def serialize(self): filename = "%s-api.xml" % self.name print "Saving XML description %s" % (filename) - output = open(filename, "w") + output = open(os.path.join(srcPref,filename), "w") output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n') output.write("<api name='%s'>\n" % self.name) output.write(" <files>\n") @@ -2093,7 +2100,7 @@ class docBuilder: filename = "%s-refs.xml" % self.name print "Saving XML Cross References %s" % (filename) - output = open(filename, "w") + output = open(os.path.join(srcPref,filename), "w") output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n') output.write("<apirefs name='%s'>\n" % self.name) self.serialize_xrefs(output) @@ -2109,10 +2116,11 @@ def rebuild(): builder = docBuilder("libvirt", [srcdir + "/../src", srcdir + "/../src/util", - srcdir + "/../include/libvirt"], + srcdir + "/../include/libvirt", + "../include/libvirt"], []) elif glob.glob("src/libvirt.c") != [] : - print "Rebuilding API description for libvir" + print "Rebuilding API description for libvirt" builder = docBuilder("libvirt", ["src", "src/util", "include/libvirt"], []) else: -- 1.7.0.1

On 06/25/2010 09:30 AM, Eric Blake wrote:
The rule of thumb for generated files: If they are distributed, they should be generated in $(srcdir); otherwise, they should be built by the end user in $(builddir). Since our .xml docs are built with python, and we want them available even to end users that don't build with python, we want them distributed; hence, they must live in $(srcdir).
Tested with 'make distcheck' in both an in-tree build and a VPATH build.
* docs/Makefile.am (dot_html_in, patches): Massage wildcard correctly. (EXTRA_DIST): Remove redundant listing of xml files. (api, web, maintainer-clean-local): Update location. (html/index.html): Likewise, and dump all generated files in correct location. ($(devhelphtml)): Since we distribute .xml, build it in srcdir. (html/%-%.html, html/%-virterror.html, %-api.xml, %-refs.xml): Rewrite with... (python_generated_files): ...new macro. * docs/apibuild.py (srcPref): Define. (docBuilder.serialize): Put output in srcdir. (docBuilder.serialize_xrefs_references): Update location. (rebuild): Look for built libvirt.h in builddir. ---
No change from https://www.redhat.com/archives/libvir-list/2010-June/msg00051.html.
Correction: per Matthias' review at https://www.redhat.com/archives/libvir-list/2010-June/msg00087.html, I had indeed changed this patch some compared to last time. Diff in this version from the previous: revert change to apibuild.py that produced corrupt output names in docs/libvirt-refs.xml, and fix $(devhelphtml) to use -o directory for all generated files rather than -o file for just the primary file. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/6/25 Eric Blake <eblake@redhat.com>:
The rule of thumb for generated files: If they are distributed, they should be generated in $(srcdir); otherwise, they should be built by the end user in $(builddir). Since our .xml docs are built with python, and we want them available even to end users that don't build with python, we want them distributed; hence, they must live in $(srcdir).
Tested with 'make distcheck' in both an in-tree build and a VPATH build.
- -html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in +$(srcdir)/html/index.html: $(srcdir)/libvirt-api.xml newapi.xsl page.xsl \ + sitemap.html.in -@if [ -x $(XSLTPROC) ] ; then \ echo "Rebuilding the HTML pages from the XML API" ; \ - $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi + $(XSLTPROC) --nonet -o $(srcdir)/ \ + $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml; \ + fi -@if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" \ > /dev/null ; then \ @@ -129,19 +132,24 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(XMLLINT) --nonet --valid --noout html/*.html ; \ else echo "missing XHTML1 DTD" ; fi ; fi
-$(devhelphtml): libvirt-api.xml $(devhelpxsl) +$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl) -@echo Rebuilding devhelp files -@if [ -x $(XSLTPROC) ] ; then \ - $(XSLTPROC) --nonet -o devhelp/libvirt.devhelp \ - $(top_srcdir)/docs/devhelp/devhelp.xsl libvirt-api.xml ; fi - -html/%-%.html html/%-virterror.html %-api.xml %-refs.xml: $(srcdir)/apibuild.py - -srcdir=$(srcdir) $(srcdir)/apibuild.py - -html/%-%.html html/%-virterror.html %-api.xml %-refs.xml: \ - $(srcdir)/../include/%/*.h \ - $(srcdir)/../src/%.c \ + $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \ + $(srcdir)/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; \ + fi
This makes xsltproc report and "I/O error : Is a directory" for me. I think the problem is that we need to specify the output file instead of the output directory here. I think the same applies to your change to the xsltproc command some lines above for $(srcdir)/html/index.html.
diff --git a/docs/apibuild.py b/docs/apibuild.py index 2dda4df..990451c 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py
@@ -2109,10 +2116,11 @@ def rebuild(): builder = docBuilder("libvirt", [srcdir + "/../src", srcdir + "/../src/util", - srcdir + "/../include/libvirt"], + srcdir + "/../include/libvirt", + "../include/libvirt"], [])
This triggers tons or warnings/errors for me: function virDomainResume from ./../include/libvirt/libvirt.h redeclared in ../include/libvirt/libvirt.h Adding "./../include/libvirt" instead of "../include/libvirt" as last item to the list fixes this for me. Matthias

On 06/25/2010 12:00 PM, Matthias Bolte wrote:
-html/%-%.html html/%-virterror.html %-api.xml %-refs.xml: \ - $(srcdir)/../include/%/*.h \ - $(srcdir)/../src/%.c \ + $(XSLTPROC) --nonet -o $(srcdir)/devhelp/ \ + $(srcdir)/devhelp/devhelp.xsl $(srcdir)/libvirt-api.xml ; \ + fi
This makes xsltproc report and "I/O error : Is a directory" for me. I think the problem is that we need to specify the output file instead of the output directory here.
I am officially stumped. I cannot, for the life of me, figure out why: xsltproc --nonet -o ./ ./newapi.xsl ./libvirt-api.xml works (outputs 4 *.html files into ./), while: xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml outputs 4 *.html files into ./devhelp but then tries to write to ./devhelp/ as a file (hence the I/O error) rather than writing output to the fifth file devhelp/libvirt.devhelp. Since everything about the two command lines is identical except for the .xsl argument, it is obviously some difference between those two style sheets - where newapi.xsl works gracefully for creating files into a target directory but devhelp/devhelp.xsl does not. But I do not have a clue how to read those .xsl stylesheets in order to identify the difference. DV, I see your name tied to xsltproc - can you help?
This triggers tons or warnings/errors for me:
function virDomainResume from ./../include/libvirt/libvirt.h redeclared in ../include/libvirt/libvirt.h
Adding "./../include/libvirt" instead of "../include/libvirt" as last item to the list fixes this for me.
Odd, but I can fold that in. But until I can figure out how to fix that I/O error with devhelp/devhelp.xsl, this patch has no chance of being incorporated, so maybe I should first focus on minimizing the patch down to something less invasive that fixes just the missing makefile dependency. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Try to avoid future regressions on the VPATH front. * autobuild.sh: Uncomment VPATH use. * .gitignore: Exclude build directory. --- No change from https://www.redhat.com/archives/libvir-list/2010-June/msg00050.html .gitignore | 1 + autobuild.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c62e885..14128ad 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ .git-module-status .sc-start-sc_* /GNUmakefile +/build /libvirt-[0-9]* /maint.mk ABOUT-NLS diff --git a/autobuild.sh b/autobuild.sh index c527479..e218740 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -11,11 +11,11 @@ test -n "$1" && RESULTS=$1 || RESULTS=results.log test -f Makefile && make -k distclean || : rm -rf coverage -#rm -rf build -#mkdir build -#cd build +rm -rf build +mkdir build +cd build -./autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \ +../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \ --enable-test-coverage \ --enable-compile-warnings=error \ --with-xen-proxy @@ -67,7 +67,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig" \ CC="i686-pc-mingw32-gcc" \ - ./configure \ + ../configure \ --build=$(uname -m)-pc-linux \ --host=i686-pc-mingw32 \ --prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \ -- 1.7.0.1
participants (2)
-
Eric Blake
-
Matthias Bolte