OSDN Git Service

autogen.sh: fix out of tree invocation
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 18 Sep 2014 16:45:39 +0000 (17:45 +0100)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 10 Nov 2014 01:59:33 +0000 (09:59 +0800)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
autogen.sh

index f5164d8..626d213 100755 (executable)
@@ -1,7 +1,14 @@
 #! /bin/sh
 
-autoreconf -v --install
+srcdir=`dirname "$0"`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd "$srcdir"
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
 
 if test -z "$NOCONFIGURE"; then
-    ./configure "$@"
+    "$srcdir"/configure "$@"
 fi