autogen.sh: allow calling from out-of-tree

https://bugzilla.gnome.org/show_bug.cgi?id=667664
This commit is contained in:
Ryan Lortie 2012-01-07 23:00:12 -05:00 committed by Tim-Philipp Müller
parent 3af9544f95
commit 1f1f6e0ed5

View file

@ -1,6 +1,12 @@
#!/bin/sh #!/bin/sh
# Run this to generate all the initial makefiles, etc. # Run this to generate all the initial makefiles, etc.
test -n "$srcdir" || srcdir=`dirname "$0"`
test -n "$srcdir" || srcdir=.
olddir=`pwd`
cd "$srcdir"
DIE=0 DIE=0
package=gstreamer package=gstreamer
srcfile=gst/gst.c srcfile=gst/gst.c
@ -97,13 +103,15 @@ test -n "$NOCONFIGURE" && {
exit 0 exit 0
} }
cd "$olddir"
echo "+ running configure ... " echo "+ running configure ... "
test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT" test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
echo echo
echo ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT echo "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT
./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || { "$srcdir/configure" $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT || {
echo " configure failed" echo " configure failed"
exit 1 exit 1
} }