From 70c033998e0e721dc4f9eb2a20348098b259752c Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Thu, 18 Aug 2011 00:14:46 +0200 Subject: [PATCH] out-of-tree build: generate ./run from template, fix image checks ./run can now be run in a separate build directory. Since some files needed in the image checks are found in the source tree (but not the build tree), the source tree location is passed to make-*-img.sh via an environment variable. --- .gitignore | 1 + configure.ac | 2 ++ images/Makefile.am | 14 ++++++-------- images/guest-aux/make-debian-img.sh | 6 +++--- images/guest-aux/make-fedora-img.sh | 4 ++-- images/guest-aux/make-ubuntu-img.sh | 6 +++--- images/guest-aux/make-windows-img.sh | 8 ++++---- run => run.in | 5 ++--- 8 files changed, 23 insertions(+), 23 deletions(-) rename run => run.in (96%) diff --git a/.gitignore b/.gitignore index fb04086..a4500fc 100644 --- a/.gitignore +++ b/.gitignore @@ -306,6 +306,7 @@ ruby/ext/guestfs/_guestfs.c ruby/ext/guestfs/_guestfs.so ruby/ext/guestfs/mkmf.log ruby/Rakefile +run src/actions.c src/bindtests.c src/errnostring_gperf.c diff --git a/configure.ac b/configure.ac index 54c2911..e45632d 100644 --- a/configure.ac +++ b/configure.ac @@ -909,6 +909,8 @@ AC_CONFIG_HEADERS([config.h]) dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html AC_CONFIG_FILES([podwrapper.sh], [chmod +x podwrapper.sh]) +AC_CONFIG_FILES([run], + [chmod +x run]) AC_CONFIG_FILES([Makefile appliance/Makefile capitests/Makefile diff --git a/images/Makefile.am b/images/Makefile.am index 68eb550..90c4ce3 100644 --- a/images/Makefile.am +++ b/images/Makefile.am @@ -173,41 +173,39 @@ $(builddir)/test-grep.txt.gz: test-grep.txt fedora.img: guest-aux/make-fedora-img.sh \ guest-aux/fedora-name.db \ guest-aux/fedora-packages.db - LIBGUESTFS_PATH=$(top_builddir)/appliance \ - LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ TMPDIR=$(top_builddir) \ + SRCDIR=$(srcdir) \ bash $< guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt rm -f $@ $@-t + mkdir -p guest-aux $(DB_LOAD) $@-t < $< mv $@-t $@ guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt rm -f $@ $@-t + mkdir -p guest-aux $(DB_LOAD) $@-t < $< mv $@-t $@ # Make a (dummy) Debian image. debian.img: guest-aux/make-debian-img.sh - LIBGUESTFS_PATH=$(top_builddir)/appliance \ - LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ TMPDIR=$(top_builddir) \ + SRCDIR=$(srcdir) \ bash $< # Make a (dummy) Ubuntu image. ubuntu.img: guest-aux/make-ubuntu-img.sh - LIBGUESTFS_PATH=$(top_builddir)/appliance \ - LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ TMPDIR=$(top_builddir) \ + SRCDIR=$(srcdir) \ bash $< # Make a (dummy) Windows image. windows.img: guest-aux/make-windows-img.sh \ guest-aux/windows-software guest-aux/windows-system - LIBGUESTFS_PATH=$(top_builddir)/appliance \ - LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ TMPDIR=$(top_builddir) \ + SRCDIR=$(srcdir) \ bash $< # Since users might not have the tools needed to create this, we diff --git a/images/guest-aux/make-debian-img.sh b/images/guest-aux/make-debian-img.sh index 9a01e93..4b0490d 100755 --- a/images/guest-aux/make-debian-img.sh +++ b/images/guest-aux/make-debian-img.sh @@ -31,7 +31,7 @@ LABEL=BOOT /boot ext2 default 0 0 EOF # Create a disk image. -../run ../fish/guestfish <<'EOF' +../run ../fish/guestfish <