From ffb1e285306ae58f2861debb615047ca384710ba Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 9 Mar 2015 12:08:17 +0000 Subject: autogen.sh: handle out-of-tree invokation Signed-off-by: Emil Velikov --- autogen.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/autogen.sh b/autogen.sh index 30d679f4..c8960971 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,14 @@ #! /bin/sh -test -n "$srcdir" || srcdir=`dirname "$0"` -test -n "$srcdir" || srcdir=. -autoreconf --force --install --verbose "$srcdir" -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd "$srcdir" + +autoreconf --force --verbose --install || exit 1 +cd "$ORIGDIR" || exit $? + +if test -z "$NOCONFIGURE"; then + "$srcdir"/configure "$@" +fi -- cgit v1.2.3