Hilko Bengen
2014-Mar-03 23:07 UTC
[Libguestfs] [PATCH 1/4] More fixes for situations where ocamlopt is not available
- run bindtests.opt only if available
- use ocamlc -custom
- Don't try to install native code if it hasn't been built (Thanks to
Olaf Hering)
---
mllib/Makefile.am | 2 +-
ocaml/Makefile.am | 7 ++++++-
ocaml/examples/Makefile.am | 11 ++++-------
ocaml/run-bindtests | 2 ++
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index 2e35d1e..0e317b2 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -176,7 +176,7 @@ common_utils_tests: common_gettext.cmx common_utils.cmx
common_utils_tests.cmx
else
common_utils_tests: common_gettext.cmo common_utils.cmo common_utils_tests.cmo
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
- mlguestfs.cma -linkpkg $^ -cclib -lncurses -o $@
+ mlguestfs.cma -linkpkg $^ -cclib -lncurses -custom -o $@
endif
TESTS_ENVIRONMENT = $(top_builddir)/run --test
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 708b2e7..7c8e515 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -171,13 +171,18 @@ depend: .depend
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
# Do the installation by hand, because we want to run ocamlfind.
+data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli
+if HAVE_OCAMLOPT
+data_hook_files += *.cmx *.cmxa
+endif
+
install-data-hook:
mkdir -p $(DESTDIR)$(OCAMLLIB)
mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
guestfs \
- META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli
+ $(data_hook_files)
rm $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.*
rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a
diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am
index 472e180..de647fc 100644
--- a/ocaml/examples/Makefile.am
+++ b/ocaml/examples/Makefile.am
@@ -58,16 +58,13 @@ inspect_vm: inspect_vm.ml
$(OCAMLFIND) ocamlopt $(OCAMLFINDFLAGS) -package unix -linkpkg \
-warn-error A -I .. mlguestfs.cmxa $< -o $@
else
-
-# This avoids:
-# Error: Error on dynamically loaded library: ../dllmlguestfs.so:
libguestfs.so.0: cannot open shared object file: No such file or directory
create_disk: create_disk.ml
- $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix
-linkpkg \
- -warn-error A -I .. mlguestfs.cma $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
+ -warn-error A -I .. mlguestfs.cma -custom $< -o $@
inspect_vm: inspect_vm.ml
- $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix
-linkpkg \
- -warn-error A -I .. mlguestfs.cma $< -o $@
+ $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \
+ -warn-error A -I .. mlguestfs.cma -custom $< -o $@
endif
endif
diff --git a/ocaml/run-bindtests b/ocaml/run-bindtests
index 3b73e8d..1fa54ec 100755
--- a/ocaml/run-bindtests
+++ b/ocaml/run-bindtests
@@ -21,5 +21,7 @@ set -e
./bindtests.bc > bindtests.tmp
diff -u $srcdir/../bindtests bindtests.tmp
+test -x ./bindtests.opt || exit 0
+
./bindtests.opt > bindtests.tmp
diff -u $srcdir/../bindtests bindtests.tmp
--
1.9.0
Hilko Bengen
2014-Mar-03 23:07 UTC
[Libguestfs] [PATCH 2/4] Fix out-of-tree appliance build
--- appliance/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appliance/Makefile.am b/appliance/Makefile.am index 7077d37..2e505fc 100644 --- a/appliance/Makefile.am +++ b/appliance/Makefile.am @@ -106,7 +106,7 @@ daemon.tar.gz: ../daemon/guestfsd guestfsd.suppressions init.tar.gz: init rm -f $@ $@-t - tar zcf $@-t init + ( cd $(srcdir) && tar zcf - init ) > $@-t mv $@-t $@ # We should put this file in /lib/udev/rules.d, but put it in /etc so -- 1.9.0
Hilko Bengen
2014-Mar-03 23:07 UTC
[Libguestfs] [PATCH 3/4] Fixes for various tests in out-of-tree builds
---
builder/test-config/virt-builder/repos.d/test-index.conf.in | 2 +-
tests/9p/Makefile.am | 3 ++-
tests/9p/test-9p.sh | 2 +-
tests/disks/Makefile.am | 1 +
tests/disks/test-qemu-drive-libvirt.sh | 11 ++++++++---
tests/disks/test-qemu-drive.sh | 4 ++--
tests/guests/guest-aux/make-fedora-img.pl | 6 +++---
tests/guests/guest-aux/make-windows-img.sh | 4 ++--
8 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/builder/test-config/virt-builder/repos.d/test-index.conf.in
b/builder/test-config/virt-builder/repos.d/test-index.conf.in
index 3755e75..22e03c4 100644
--- a/builder/test-config/virt-builder/repos.d/test-index.conf.in
+++ b/builder/test-config/virt-builder/repos.d/test-index.conf.in
@@ -1,2 +1,2 @@
[test-index]
-uri=file://@abs_top_srcdir@/builder/test-index
+uri=file://@abs_top_builddir@/builder/test-index
diff --git a/tests/9p/Makefile.am b/tests/9p/Makefile.am
index 949e6d5..9b3c880 100644
--- a/tests/9p/Makefile.am
+++ b/tests/9p/Makefile.am
@@ -21,4 +21,5 @@ EXTRA_DIST = $(TESTS)
TESTS = test-9p.sh
-TESTS_ENVIRONMENT = $(top_builddir)/run --test
+TESTS_ENVIRONMENT = abs_srcdir=$(abs_srcdir) \
+ $(top_builddir)/run --test
diff --git a/tests/9p/test-9p.sh b/tests/9p/test-9p.sh
index 16e9e4c..6733fd9 100755
--- a/tests/9p/test-9p.sh
+++ b/tests/9p/test-9p.sh
@@ -50,7 +50,7 @@ rm -f test-9p.img test-9p.out
sparse test-9p.img 1M
config -device '$virtio_9p,fsdev=test9p,mount_tag=test9p'
-config -fsdev 'local,id=test9p,path=$(pwd),security_model=passthrough'
+config -fsdev
'local,id=test9p,path=${abs_srcdir},security_model=passthrough'
run
diff --git a/tests/disks/Makefile.am b/tests/disks/Makefile.am
index 1315e71..2a94279 100644
--- a/tests/disks/Makefile.am
+++ b/tests/disks/Makefile.am
@@ -24,6 +24,7 @@ TESTS = \
TESTS_ENVIRONMENT = \
abs_srcdir=$(abs_srcdir) \
+ abs_builddir=$(abs_builddir) \
$(top_builddir)/run --test
EXTRA_DIST = \
diff --git a/tests/disks/test-qemu-drive-libvirt.sh
b/tests/disks/test-qemu-drive-libvirt.sh
index 8467fe4..1ba014b 100755
--- a/tests/disks/test-qemu-drive-libvirt.sh
+++ b/tests/disks/test-qemu-drive-libvirt.sh
@@ -26,6 +26,11 @@ if [ -z "$abs_srcdir" ]; then
exit 1
fi
+if [ -z "$abs_builddir" ]; then
+ echo "$0: abs_builddir environment variable must be set"
+ exit 1
+fi
+
if [ ! -x ../../src/libvirt-is-version ]; then
echo "$0: test skipped because libvirt-is-version is not built
yet"
exit 77
@@ -37,11 +42,11 @@ if ! ../../src/libvirt-is-version 1 1 3; then
fi
guestfish="\
- ../../fish/guestfish -c test://$abs_srcdir/test-qemu-drive-libvirt.xml"
+ ../../fish/guestfish -c
test://$abs_builddir/test-qemu-drive-libvirt.xml"
export LIBGUESTFS_BACKEND=direct
-export LIBGUESTFS_HV="$(pwd)/debug-qemu.sh"
-export DEBUG_QEMU_FILE="$(pwd)/test-qemu-drive-libvirt.out"
+export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh"
+export DEBUG_QEMU_FILE="${abs_builddir}/test-qemu-drive-libvirt.out"
function check_output ()
{
diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
index 4f10cdb..91677bd 100755
--- a/tests/disks/test-qemu-drive.sh
+++ b/tests/disks/test-qemu-drive.sh
@@ -24,8 +24,8 @@ set -e
guestfish=../../fish/guestfish
export LIBGUESTFS_BACKEND=direct
-export LIBGUESTFS_HV="$(pwd)/debug-qemu.sh"
-export DEBUG_QEMU_FILE="$(pwd)/test-qemu-drive.out"
+export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh"
+export DEBUG_QEMU_FILE="${abs_builddir}/test-qemu-drive.out"
function check_output ()
{
diff --git a/tests/guests/guest-aux/make-fedora-img.pl
b/tests/guests/guest-aux/make-fedora-img.pl
index 4eb08b5..1c23b6d 100755
--- a/tests/guests/guest-aux/make-fedora-img.pl
+++ b/tests/guests/guest-aux/make-fedora-img.pl
@@ -217,12 +217,12 @@ if (-f "mdadm.tmp.$$") {
unlink ("mdadm.tmp.$$") or die;
}
-$g->upload ('guest-aux/fedora-name.db',
'/var/lib/rpm/Name');
-$g->upload ('guest-aux/fedora-packages.db',
'/var/lib/rpm/Packages');
+$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-name.db',
'/var/lib/rpm/Name');
+$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-packages.db',
'/var/lib/rpm/Packages');
$g->upload ($ENV{SRCDIR}.'/../data/bin-x86_64-dynamic',
'/bin/ls');
-$g->txz_in ('guest-aux/fedora-journal.tar.xz',
'/var/log/journal');
+$g->txz_in ($ENV{SRCDIR}.'/guest-aux/fedora-journal.tar.xz',
'/var/log/journal');
$g->mkdir ('/boot/grub');
$g->touch ('/boot/grub/grub.conf');
diff --git a/tests/guests/guest-aux/make-windows-img.sh
b/tests/guests/guest-aux/make-windows-img.sh
index 41b1d48..860ec06 100755
--- a/tests/guests/guest-aux/make-windows-img.sh
+++ b/tests/guests/guest-aux/make-windows-img.sh
@@ -58,8 +58,8 @@ mkfs ntfs /dev/sda2
mount /dev/sda2 /
mkdir-p /Windows/System32/Config
-upload guest-aux/windows-software /Windows/System32/Config/SOFTWARE
-upload guest-aux/windows-system /Windows/System32/Config/SYSTEM
+upload $SRCDIR/guest-aux/windows-software /Windows/System32/Config/SOFTWARE
+upload $SRCDIR/guest-aux/windows-system /Windows/System32/Config/SYSTEM
upload $SRCDIR/../data/bin-win32.exe /Windows/System32/cmd.exe
--
1.9.0
Hilko Bengen
2014-Mar-03 23:07 UTC
[Libguestfs] [PATCH 4/4] Fix out-of-tree build: Do not accidentally build mllib components in srcdir
--- builder/Makefile.am | 2 +- resize/Makefile.am | 2 +- sparsify/Makefile.am | 2 +- sysprep/Makefile.am | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index b3de967..387913c 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -226,7 +226,7 @@ depend: .depend .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) rm -f $@ $@-t - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ $(SED) 's/ *$$//' | \ $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ diff --git a/resize/Makefile.am b/resize/Makefile.am index ef35bf9..67cb8c9 100644 --- a/resize/Makefile.am +++ b/resize/Makefile.am @@ -147,7 +147,7 @@ depend: .depend .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) rm -f $@ $@-t - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ $(SED) 's/ *$$//' | \ $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am index bf6caf0..516069a 100644 --- a/sparsify/Makefile.am +++ b/sparsify/Makefile.am @@ -138,7 +138,7 @@ depend: .depend .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) rm -f $@ $@-t - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ $(SED) 's/ *$$//' | \ $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am index 22da6fd..d20ad08 100644 --- a/sysprep/Makefile.am +++ b/sysprep/Makefile.am @@ -225,7 +225,7 @@ depend: .depend .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) rm -f $@ $@-t - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ $(SED) 's/ *$$//' | \ $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ -- 1.9.0
Richard W.M. Jones
2014-Mar-04 07:56 UTC
Re: [Libguestfs] [PATCH 1/4] More fixes for situations where ocamlopt is not available
On Tue, Mar 04, 2014 at 12:07:29AM +0100, Hilko Bengen wrote:> - run bindtests.opt only if available > - use ocamlc -custom > - Don't try to install native code if it hasn't been built (Thanks to Olaf Hering) > --- > mllib/Makefile.am | 2 +- > ocaml/Makefile.am | 7 ++++++- > ocaml/examples/Makefile.am | 11 ++++------- > ocaml/run-bindtests | 2 ++ > 4 files changed, 13 insertions(+), 9 deletions(-) > > diff --git a/mllib/Makefile.am b/mllib/Makefile.am > index 2e35d1e..0e317b2 100644 > --- a/mllib/Makefile.am > +++ b/mllib/Makefile.am > @@ -176,7 +176,7 @@ common_utils_tests: common_gettext.cmx common_utils.cmx common_utils_tests.cmx > else > common_utils_tests: common_gettext.cmo common_utils.cmo common_utils_tests.cmo > $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \ > - mlguestfs.cma -linkpkg $^ -cclib -lncurses -o $@ > + mlguestfs.cma -linkpkg $^ -cclib -lncurses -custom -o $@ > endif > > TESTS_ENVIRONMENT = $(top_builddir)/run --test > diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am > index 708b2e7..7c8e515 100644 > --- a/ocaml/Makefile.am > +++ b/ocaml/Makefile.am > @@ -171,13 +171,18 @@ depend: .depend > SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly > > # Do the installation by hand, because we want to run ocamlfind. > +data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli > +if HAVE_OCAMLOPT > +data_hook_files += *.cmx *.cmxa > +endif > + > install-data-hook: > mkdir -p $(DESTDIR)$(OCAMLLIB) > mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs > $(OCAMLFIND) install \ > -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ > guestfs \ > - META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli > + $(data_hook_files) > rm $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.* > rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a > > diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am > index 472e180..de647fc 100644 > --- a/ocaml/examples/Makefile.am > +++ b/ocaml/examples/Makefile.am > @@ -58,16 +58,13 @@ inspect_vm: inspect_vm.ml > $(OCAMLFIND) ocamlopt $(OCAMLFINDFLAGS) -package unix -linkpkg \ > -warn-error A -I .. mlguestfs.cmxa $< -o $@ > else > - > -# This avoids: > -# Error: Error on dynamically loaded library: ../dllmlguestfs.so: libguestfs.so.0: cannot open shared object file: No such file or directory > create_disk: create_disk.ml > - $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ > - -warn-error A -I .. mlguestfs.cma $< -o $@ > + $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ > + -warn-error A -I .. mlguestfs.cma -custom $< -o $@ > > inspect_vm: inspect_vm.ml > - $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ > - -warn-error A -I .. mlguestfs.cma $< -o $@ > + $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ > + -warn-error A -I .. mlguestfs.cma -custom $< -o $@ > endif > > endif > diff --git a/ocaml/run-bindtests b/ocaml/run-bindtests > index 3b73e8d..1fa54ec 100755 > --- a/ocaml/run-bindtests > +++ b/ocaml/run-bindtests > @@ -21,5 +21,7 @@ set -e > ./bindtests.bc > bindtests.tmp > diff -u $srcdir/../bindtests bindtests.tmp > > +test -x ./bindtests.opt || exit 0 > + > ./bindtests.opt > bindtests.tmp > diff -u $srcdir/../bindtests bindtests.tmp > -- > 1.9.0ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2014-Mar-04 07:56 UTC
Re: [Libguestfs] [PATCH 2/4] Fix out-of-tree appliance build
On Tue, Mar 04, 2014 at 12:07:30AM +0100, Hilko Bengen wrote:> --- > appliance/Makefile.am | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/appliance/Makefile.am b/appliance/Makefile.am > index 7077d37..2e505fc 100644 > --- a/appliance/Makefile.am > +++ b/appliance/Makefile.am > @@ -106,7 +106,7 @@ daemon.tar.gz: ../daemon/guestfsd guestfsd.suppressions > > init.tar.gz: init > rm -f $@ $@-t > - tar zcf $@-t init > + ( cd $(srcdir) && tar zcf - init ) > $@-t > mv $@-t $@ > > # We should put this file in /lib/udev/rules.d, but put it in /etc soACK. I should have spotted this one! Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Richard W.M. Jones
2014-Mar-04 07:57 UTC
Re: [Libguestfs] [PATCH 3/4] Fixes for various tests in out-of-tree builds
On Tue, Mar 04, 2014 at 12:07:31AM +0100, Hilko Bengen wrote:> --- > builder/test-config/virt-builder/repos.d/test-index.conf.in | 2 +- > tests/9p/Makefile.am | 3 ++- > tests/9p/test-9p.sh | 2 +- > tests/disks/Makefile.am | 1 + > tests/disks/test-qemu-drive-libvirt.sh | 11 ++++++++--- > tests/disks/test-qemu-drive.sh | 4 ++-- > tests/guests/guest-aux/make-fedora-img.pl | 6 +++--- > tests/guests/guest-aux/make-windows-img.sh | 4 ++-- > 8 files changed, 20 insertions(+), 13 deletions(-) > > diff --git a/builder/test-config/virt-builder/repos.d/test-index.conf.in b/builder/test-config/virt-builder/repos.d/test-index.conf.in > index 3755e75..22e03c4 100644 > --- a/builder/test-config/virt-builder/repos.d/test-index.conf.in > +++ b/builder/test-config/virt-builder/repos.d/test-index.conf.in > @@ -1,2 +1,2 @@ > [test-index] > -uri=file://@abs_top_srcdir@/builder/test-index > +uri=file://@abs_top_builddir@/builder/test-index > diff --git a/tests/9p/Makefile.am b/tests/9p/Makefile.am > index 949e6d5..9b3c880 100644 > --- a/tests/9p/Makefile.am > +++ b/tests/9p/Makefile.am > @@ -21,4 +21,5 @@ EXTRA_DIST = $(TESTS) > > TESTS = test-9p.sh > > -TESTS_ENVIRONMENT = $(top_builddir)/run --test > +TESTS_ENVIRONMENT = abs_srcdir=$(abs_srcdir) \ > + $(top_builddir)/run --test > diff --git a/tests/9p/test-9p.sh b/tests/9p/test-9p.sh > index 16e9e4c..6733fd9 100755 > --- a/tests/9p/test-9p.sh > +++ b/tests/9p/test-9p.sh > @@ -50,7 +50,7 @@ rm -f test-9p.img test-9p.out > sparse test-9p.img 1M > > config -device '$virtio_9p,fsdev=test9p,mount_tag=test9p' > -config -fsdev 'local,id=test9p,path=$(pwd),security_model=passthrough' > +config -fsdev 'local,id=test9p,path=${abs_srcdir},security_model=passthrough' > > run > > diff --git a/tests/disks/Makefile.am b/tests/disks/Makefile.am > index 1315e71..2a94279 100644 > --- a/tests/disks/Makefile.am > +++ b/tests/disks/Makefile.am > @@ -24,6 +24,7 @@ TESTS = \ > > TESTS_ENVIRONMENT = \ > abs_srcdir=$(abs_srcdir) \ > + abs_builddir=$(abs_builddir) \ > $(top_builddir)/run --test > > EXTRA_DIST = \ > diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh > index 8467fe4..1ba014b 100755 > --- a/tests/disks/test-qemu-drive-libvirt.sh > +++ b/tests/disks/test-qemu-drive-libvirt.sh > @@ -26,6 +26,11 @@ if [ -z "$abs_srcdir" ]; then > exit 1 > fi > > +if [ -z "$abs_builddir" ]; then > + echo "$0: abs_builddir environment variable must be set" > + exit 1 > +fi > + > if [ ! -x ../../src/libvirt-is-version ]; then > echo "$0: test skipped because libvirt-is-version is not built yet" > exit 77 > @@ -37,11 +42,11 @@ if ! ../../src/libvirt-is-version 1 1 3; then > fi > > guestfish="\ > - ../../fish/guestfish -c test://$abs_srcdir/test-qemu-drive-libvirt.xml" > + ../../fish/guestfish -c test://$abs_builddir/test-qemu-drive-libvirt.xml" > > export LIBGUESTFS_BACKEND=direct > -export LIBGUESTFS_HV="$(pwd)/debug-qemu.sh" > -export DEBUG_QEMU_FILE="$(pwd)/test-qemu-drive-libvirt.out" > +export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh" > +export DEBUG_QEMU_FILE="${abs_builddir}/test-qemu-drive-libvirt.out" > > function check_output () > { > diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh > index 4f10cdb..91677bd 100755 > --- a/tests/disks/test-qemu-drive.sh > +++ b/tests/disks/test-qemu-drive.sh > @@ -24,8 +24,8 @@ set -e > guestfish=../../fish/guestfish > > export LIBGUESTFS_BACKEND=direct > -export LIBGUESTFS_HV="$(pwd)/debug-qemu.sh" > -export DEBUG_QEMU_FILE="$(pwd)/test-qemu-drive.out" > +export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh" > +export DEBUG_QEMU_FILE="${abs_builddir}/test-qemu-drive.out" > > function check_output () > { > diff --git a/tests/guests/guest-aux/make-fedora-img.pl b/tests/guests/guest-aux/make-fedora-img.pl > index 4eb08b5..1c23b6d 100755 > --- a/tests/guests/guest-aux/make-fedora-img.pl > +++ b/tests/guests/guest-aux/make-fedora-img.pl > @@ -217,12 +217,12 @@ if (-f "mdadm.tmp.$$") { > unlink ("mdadm.tmp.$$") or die; > } > > -$g->upload ('guest-aux/fedora-name.db', '/var/lib/rpm/Name'); > -$g->upload ('guest-aux/fedora-packages.db', '/var/lib/rpm/Packages'); > +$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-name.db', '/var/lib/rpm/Name'); > +$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-packages.db', '/var/lib/rpm/Packages'); > > $g->upload ($ENV{SRCDIR}.'/../data/bin-x86_64-dynamic', '/bin/ls'); > > -$g->txz_in ('guest-aux/fedora-journal.tar.xz', '/var/log/journal'); > +$g->txz_in ($ENV{SRCDIR}.'/guest-aux/fedora-journal.tar.xz', '/var/log/journal'); > > $g->mkdir ('/boot/grub'); > $g->touch ('/boot/grub/grub.conf'); > diff --git a/tests/guests/guest-aux/make-windows-img.sh b/tests/guests/guest-aux/make-windows-img.sh > index 41b1d48..860ec06 100755 > --- a/tests/guests/guest-aux/make-windows-img.sh > +++ b/tests/guests/guest-aux/make-windows-img.sh > @@ -58,8 +58,8 @@ mkfs ntfs /dev/sda2 > mount /dev/sda2 / > mkdir-p /Windows/System32/Config > > -upload guest-aux/windows-software /Windows/System32/Config/SOFTWARE > -upload guest-aux/windows-system /Windows/System32/Config/SYSTEM > +upload $SRCDIR/guest-aux/windows-software /Windows/System32/Config/SOFTWARE > +upload $SRCDIR/guest-aux/windows-system /Windows/System32/Config/SYSTEM > > upload $SRCDIR/../data/bin-win32.exe /Windows/System32/cmd.exeACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Richard W.M. Jones
2014-Mar-04 07:58 UTC
Re: [Libguestfs] [PATCH 4/4] Fix out-of-tree build: Do not accidentally build mllib components in srcdir
On Tue, Mar 04, 2014 at 12:07:32AM +0100, Hilko Bengen wrote:> --- > builder/Makefile.am | 2 +- > resize/Makefile.am | 2 +- > sparsify/Makefile.am | 2 +- > sysprep/Makefile.am | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/builder/Makefile.am b/builder/Makefile.am > index b3de967..387913c 100644 > --- a/builder/Makefile.am > +++ b/builder/Makefile.am > @@ -226,7 +226,7 @@ depend: .depend > > .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) > rm -f $@ $@-t > - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ > + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ > $(SED) 's/ *$$//' | \ > $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ > $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ > diff --git a/resize/Makefile.am b/resize/Makefile.am > index ef35bf9..67cb8c9 100644 > --- a/resize/Makefile.am > +++ b/resize/Makefile.am > @@ -147,7 +147,7 @@ depend: .depend > > .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) > rm -f $@ $@-t > - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ > + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ > $(SED) 's/ *$$//' | \ > $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ > $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ > diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am > index bf6caf0..516069a 100644 > --- a/sparsify/Makefile.am > +++ b/sparsify/Makefile.am > @@ -138,7 +138,7 @@ depend: .depend > > .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) > rm -f $@ $@-t > - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ > + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ > $(SED) 's/ *$$//' | \ > $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ > $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ > diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am > index 22da6fd..d20ad08 100644 > --- a/sysprep/Makefile.am > +++ b/sysprep/Makefile.am > @@ -225,7 +225,7 @@ depend: .depend > > .depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) > rm -f $@ $@-t > - $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(top_srcdir)/mllib $^ | \ > + $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I $(abs_top_builddir)/mllib $^ | \ > $(SED) 's/ *$$//' | \ > $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \ > $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \ACK. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW