summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2012-06-16 11:02:03 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2012-06-16 11:05:55 +0200
commit4e98bedef030b6163bb8d3d26053447a4f97f61a (patch)
treec01c9cf96f4e17ff7bb87b0bd6958fb69aea1c53
parent63afa288ccc950502ee32cff8a59f439bd2b1920 (diff)
autogen.sh: support calling from out of tree
https://bugzilla.gnome.org/show_bug.cgi?id=667572
-rwxr-xr-xautogen.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index b49795d..a345dc3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,13 @@
#!/bin/sh
+
+set -e
+
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+
+olddir=`pwd`
+cd "$srcdir"
+
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
echo "*** No gtk-doc support ***"
@@ -10,6 +19,6 @@ fi
ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf -v -i
-if test -z "$NOCONFIGURE"; then
- exec ./configure "$@"
-fi
+cd "$olddir"
+
+test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"