summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorMatthew Booth <mbooth@redhat.com>2009-07-03 11:52:50 +0100
committerMatthew Booth <mbooth@redhat.com>2009-07-03 16:16:51 +0100
commit349814e9d912c4f372b8fbdfb10b03749911021f (patch)
tree7168b6ee4dadd363a28a73e2a5ff26799395d75c /autogen.sh
parent5f9cb51f11879ece8b921d833850505d7e57d339 (diff)
downloadlibguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.tar.gz
libguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.tar.xz
libguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.zip
Make it possible to build in a separate directory
This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/autogen.sh b/autogen.sh
index a1d7e271..ba4612cd 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,12 +20,24 @@
set -e
set -v
-export AUTOMAKE='automake --foreign'
+
mkdir -p daemon/m4
-aclocal
-libtoolize
-autoreconf -i
-pushd daemon
autoreconf -i
-popd
-./configure "$@"
+
+CONFIGUREDIR=.
+
+# Run configure in BUILDDIR if it's set
+if [ ! -z "$BUILDDIR" ]; then
+ mkdir -p $BUILDDIR
+ cd $BUILDDIR
+
+ CONFIGUREDIR=..
+fi
+
+# If no arguments were specified and configure has run before, use the previous
+# arguments
+if [ $# == 0 -a -x ./config.status ]; then
+ ./config.status --recheck
+else
+ $CONFIGUREDIR/configure "$@"
+fi