autogen.sh: Allow calling from out of tree
authorEdward Hervey <edward@collabora.com>
Fri, 20 Sep 2013 09:52:21 +0000 (11:52 +0200)
committerEdward Hervey <edward@collabora.com>
Fri, 20 Sep 2013 10:04:41 +0000 (12:04 +0200)
This is similar to the fix that was done for gstreamer

https://bugzilla.gnome.org/show_bug.cgi?id=667664

autogen.sh

index e43e0df..5611736 100755 (executable)
@@ -1,9 +1,20 @@
 #!/bin/sh
 
+set -e
+
 if [ `whoami` = ds ] ; then
   confargs="$confargs --enable-gtk-doc"
 fi
 
-autoreconf -i -f &&
-./configure --disable-static $confargs $@
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+
+olddir=`pwd`
+cd "$srcdir"
+
+autoreconf -i -f
+
+cd "$olddir"
+
+$srcdir/configure --disable-static $confargs $@