[libvirt] [PATCHv2 0/3] more VPATH build fixes

Technically, this is a v2 of messages I've sent before, but now provided as a single series; see each commit for earlier references. I tested these on top of this unreviewed patch: https://www.redhat.com/archives/libvir-list/2011-February/msg00616.html but suspect that they will trivially rebase. I tested six combinations: in-tree incremental git checkout (my usual dev tree) in-tree fresh clone git checkout in-tree expanded tarball outside git VPATH fresh clone git checkout (note that ./autogen.sh tries to do an in-tree build as the very first thing, but './autogen.sh --help' is sufficient to stop things before ./configure, to set up the VPATH) VPATH incremental git checkout VPATH expanded tarball outside git In each combination, I tested that 'make distcheck' and './autobuild.sh' were able to succeed, including full mingw cross-compilation. That made testing this rather time-consuming in relation to the size of the diffstat. Eric Blake (3): build: don't require pod2man for tarball builds maint: fix 'make dist' in VPATH build autobuild.sh: use VPATH build .gitignore | 1 + autobuild.sh | 10 +++++----- bootstrap.conf | 10 ++++++++++ daemon/.gitignore | 3 ++- daemon/Makefile.am | 10 ++++++---- docs/Makefile.am | 2 +- tools/Makefile.am | 15 ++++++++------- 7 files changed, 33 insertions(+), 18 deletions(-) -- 1.7.4

Right now, 'man libvirtd' includes information that depends on configure results, so it must be generated on the fly and live in $(builddir); however, requiring pod2man on all end user machines is overkill. Meanwhile, 'man virsh' doesn't mention any configure results, so it can be built at 'make dist' time. If that situation changes in the future, we can generate virsh.1 in the same way that we generate libvirtd.8. * daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in advance of distribution. (libvirtd.8): Use only sed from tarball. (EXTRA_DIST): Ship new file. (libvirtd.pod): Delete unused rule. (man8_MANS): Let automake know which section to use. (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files. * tools/Makefile.am (dist_man1_MANS): Distribute pre-built man pages, fine since they don't require any substitution. (virt-xml-validate.1, virt-pki-validate.1): Change input source. (virsh.1): Build into srcdir. (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style. * daemon/.gitignore: Update. Reported by Diego Elio Pettenò. --- Re-send, minor VPATH tweaks from v1: https://www.redhat.com/archives/libvir-list/2011-February/msg00613.html daemon/.gitignore | 3 ++- daemon/Makefile.am | 10 ++++++---- tools/Makefile.am | 15 ++++++++------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/daemon/.gitignore b/daemon/.gitignore index 840ddd8..ab3d093 100644 --- a/daemon/.gitignore +++ b/daemon/.gitignore @@ -8,6 +8,7 @@ libvirt_qemud libvirtd libvirtd.init libvirtd*.logrotate -libvirtd.pod libvirtd.8 +libvirtd.8.in +libvirtd.pod probes.h diff --git a/daemon/Makefile.am b/daemon/Makefile.am index cdf0f75..86f024f 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -38,6 +38,7 @@ EXTRA_DIST = \ test_libvirtd.aug \ THREADING.txt \ libvirtd.pod.in \ + libvirtd.8.in \ libvirtd.stp \ $(AVAHI_SOURCES) \ $(DAEMON_SOURCES) @@ -46,7 +47,7 @@ BUILT_SOURCES = if WITH_LIBVIRTD -man_MANS = libvirtd.8 +man8_MANS = libvirtd.8 sbin_PROGRAMS = libvirtd @@ -62,7 +63,7 @@ augeastests_DATA = test_libvirtd.aug POD2MAN = pod2man -c "Virtualization Support" \ -r "$(PACKAGE)-$(VERSION)" -s 8 -libvirtd.pod: libvirtd.pod.in +libvirtd.8: $(srcdir)/libvirtd.8.in sed \ -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \ -e 's![@]localstatedir[@]!$(localstatedir)!g' \ @@ -70,7 +71,7 @@ libvirtd.pod: libvirtd.pod.in < $< > $@-t mv $@-t $@ -libvirtd.8: libvirtd.pod +$(srcdir)/libvirtd.8.in: libvirtd.pod.in $(AM_V_GEN)$(POD2MAN) $< $@ libvirtd_SOURCES = $(DAEMON_SOURCES) @@ -338,5 +339,6 @@ uninstall-data-sasl: endif -CLEANFILES += $(BUILT_SOURCES) $(man_MANS) libvirtd.pod +CLEANFILES += $(BUILT_SOURCES) $(man8_MANS) CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda +MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in diff --git a/tools/Makefile.am b/tools/Makefile.am index f008078..3dc549e 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -19,22 +19,22 @@ EXTRA_DIST = \ bin_SCRIPTS = virt-xml-validate virt-pki-validate bin_PROGRAMS = virsh -man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 +dist_man1_MANS = virt-xml-validate.1 virt-pki-validate.1 virsh.1 virt-xml-validate: virt-xml-validate.in Makefile $(AM_V_GEN)sed -e 's,@SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ -virt-xml-validate.1: virt-xml-validate - $(AM_V_GEN)$(POD2MAN) $< $@ +virt-xml-validate.1: virt-xml-validate.in + $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ virt-pki-validate: virt-pki-validate.in Makefile $(AM_V_GEN)sed -e 's,@SYSCONFDIR@,$(sysconfdir),' < $< > $@ \ || (rm $@ && exit 1) && chmod +x $@ -virt-pki-validate.1: virt-pki-validate - $(AM_V_GEN)$(POD2MAN) $< $@ +virt-pki-validate.1: virt-pki-validate.in + $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ virsh_SOURCES = \ console.c console.h \ @@ -123,7 +123,7 @@ virsh_win_icon.$(OBJEXT): virsh_win_icon.rc endif virsh.1: virsh.pod - $(AM_V_GEN)$(POD2MAN) $< $@ + $(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@ install-data-local: install-init @@ -162,7 +162,8 @@ libvirt-guests.init: endif # LIBVIRT_INIT_SCRIPT_RED_HAT -CLEANFILES = $(bin_SCRIPTS) $(man1_MANS) +CLEANFILES = $(bin_SCRIPTS) CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s +MAINTAINERCLEANFILES = $(dist_man1_MANS) DISTCLEANFILES = $(BUILT_SOURCES) -- 1.7.4

On Fri, Feb 18, 2011 at 03:24:55PM -0700, Eric Blake wrote:
Right now, 'man libvirtd' includes information that depends on configure results, so it must be generated on the fly and live in $(builddir); however, requiring pod2man on all end user machines is overkill. Meanwhile, 'man virsh' doesn't mention any configure results, so it can be built at 'make dist' time. If that situation changes in the future, we can generate virsh.1 in the same way that we generate libvirtd.8.
* daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in advance of distribution. (libvirtd.8): Use only sed from tarball. (EXTRA_DIST): Ship new file. (libvirtd.pod): Delete unused rule. (man8_MANS): Let automake know which section to use. (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files. * tools/Makefile.am (dist_man1_MANS): Distribute pre-built man pages, fine since they don't require any substitution. (virt-xml-validate.1, virt-pki-validate.1): Change input source. (virsh.1): Build into srcdir. (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style. * daemon/.gitignore: Update. Reported by Diego Elio Pettenò. ---
Re-send, minor VPATH tweaks from v1: https://www.redhat.com/archives/libvir-list/2011-February/msg00613.html
daemon/.gitignore | 3 ++- daemon/Makefile.am | 10 ++++++---- tools/Makefile.am | 15 ++++++++------- 3 files changed, 16 insertions(+), 12 deletions(-)
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

A diff of 'make dist' from in-tree vs. a VPATH build showed that we were missing docs/api_extension/*.patch files, but shipping other files that we didn't need. * bootstrap.conf (gnulib_extra_files): Don't distribute files we don't care about. * docs/Makefile.am (patches): Perform wildcard correctly. --- The commit date lies - I've been sitting on an earlier form of this patch since: https://www.redhat.com/archives/libvir-list/2010-April/msg01337.html Fortunately, the rest of the hunks in that earlier version have since been taken care of in the meantime. bootstrap.conf | 10 ++++++++++ docs/Makefile.am | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 2c425bb..a9d4ba4 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -165,6 +165,16 @@ tar - # Automake requires that ChangeLog exist. touch ChangeLog || exit 1 +# Override bootstrap's list - we don't use mdate-sh or texinfo.tex. +gnulib_extra_files=" + $build_aux/install-sh + $build_aux/missing + $build_aux/depcomp + $build_aux/config.guess + $build_aux/config.sub + doc/INSTALL +" + bootstrap_epilogue() { diff --git a/docs/Makefile.am b/docs/Makefile.am index c4926d4..db4bc59 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -64,7 +64,7 @@ dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.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 \ -- 1.7.4

On Fri, Feb 18, 2011 at 03:24:56PM -0700, Eric Blake wrote:
A diff of 'make dist' from in-tree vs. a VPATH build showed that we were missing docs/api_extension/*.patch files, but shipping other files that we didn't need.
* bootstrap.conf (gnulib_extra_files): Don't distribute files we don't care about. * docs/Makefile.am (patches): Perform wildcard correctly. ---
The commit date lies - I've been sitting on an earlier form of this patch since: https://www.redhat.com/archives/libvir-list/2010-April/msg01337.html
Fortunately, the rest of the hunks in that earlier version have since been taken care of in the meantime.
bootstrap.conf | 10 ++++++++++ docs/Makefile.am | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-)
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Try to avoid future regressions on the VPATH front. * autobuild.sh: Uncomment VPATH use. * .gitignore: Exclude build directory. --- v2, not that much changed since: https://www.redhat.com/archives/libvir-list/2010-April/msg01422.html but now that all the intermediate VPATH issues that had stumped me for so long have been resolved, it finally works! .gitignore | 1 + autobuild.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 309becf..41f7654 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ /autom4te.cache /build-aux /build-aux/ +/build/ /config.cache /config.guess /config.h diff --git a/autobuild.sh b/autobuild.sh index 91e2ab2..54fb273 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 @@ -66,7 +66,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.4

On Fri, Feb 18, 2011 at 03:24:57PM -0700, Eric Blake wrote:
Try to avoid future regressions on the VPATH front.
* autobuild.sh: Uncomment VPATH use. * .gitignore: Exclude build directory. ---
v2, not that much changed since: https://www.redhat.com/archives/libvir-list/2010-April/msg01422.html
but now that all the intermediate VPATH issues that had stumped me for so long have been resolved, it finally works!
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 02/21/2011 10:03 AM, Daniel P. Berrange wrote:
On Fri, Feb 18, 2011 at 03:24:57PM -0700, Eric Blake wrote:
Try to avoid future regressions on the VPATH front.
* autobuild.sh: Uncomment VPATH use. * .gitignore: Exclude build directory. ---
v2, not that much changed since: https://www.redhat.com/archives/libvir-list/2010-April/msg01422.html
but now that all the intermediate VPATH issues that had stumped me for so long have been resolved, it finally works!
ACK
Thanks for the review; series is now pushed, and hopefully I don't have to revisit VPATH issues for a while :) -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake