This is similar to the fix that was done for gstreamer
https://bugzilla.gnome.org/show_bug.cgi?id=667664
#!/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 $@