diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2015-03-09 12:08:17 +0000 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-03-17 22:35:51 +0000 |
commit | ffb1e285306ae58f2861debb615047ca384710ba (patch) | |
tree | eb615e01075d59ff587cfcc1b9813f2023594cbd | |
parent | d8ea64d90b222b468c292d2c107a41a64ad5ce43 (diff) |
autogen.sh: handle out-of-tree invokation
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rwxr-xr-x | autogen.sh | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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 |