Instead of having to run autogen.sh inside the source directory
first, before moving to a build directory and run configure there,
it's now possible to run everything from the build directory.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
autogen.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/autogen.sh b/autogen.sh
index a04e4e6..ebe6fe2 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,6 +8,14 @@ die()
exit 1
}
+curdir=$(pwd)
+test "$curdir" || curdir=.
+
+srcdir=$(dirname "$0")
+test "$srcdir" || srcdir=.
+
+cd "$srcdir" || die "Failed to cd into $srcdir"
+
echo "Running libtool ..."
libtoolize --copy --force --automake || die
@@ -31,6 +39,8 @@ else
echo "0" > .revision
fi
+cd "$curdir" || die "Failed to cd into $curdir"
+
if test "$#" -eq 0; then
echo "Running configure without arguments ..."
echo "(If you want to pass any, specify them on the $0 command line)"
--
2.14.3