autogen.sh: Sync behaviour with other GStreamer modules

Allows building from outside of tree amongst other things
This commit is contained in:
Edward Hervey 2013-09-20 16:47:56 +02:00
parent 59aedf8d63
commit c7bed54b87

View file

@ -1,6 +1,13 @@
#!/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=gst-rtsp package=gst-rtsp
srcfile=gst/rtsp-server/rtsp-server.c srcfile=gst/rtsp-server/rtsp-server.c
@ -35,13 +42,13 @@ autogen_options $@
printf "+ check for build tools" printf "+ check for build tools"
if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi if test ! -z "$NOCHECK"; then echo ": skipped version checks"; else echo; fi
version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 autoconf267 autoconf266 autoconf265 autoconf264 autoconf263 autoconf262" \ version_check "autoconf" "$AUTOCONF autoconf autoconf270 autoconf269 autoconf268 " \
"ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 62 || DIE=1 "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 68 || DIE=1
version_check "automake" "$AUTOMAKE automake automake-1.11" \ version_check "automake" "$AUTOMAKE automake automake-1.11" \
"ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1 "ftp://ftp.gnu.org/pub/gnu/automake/" 1 11 || DIE=1
version_check "autopoint" "autopoint" \ version_check "autopoint" "autopoint" \
"ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1 "ftp://ftp.gnu.org/pub/gnu/gettext/" 0 17 || DIE=1
version_check "libtoolize" "libtoolize glibtoolize" \ version_check "libtoolize" "$LIBTOOLIZE libtoolize glibtoolize" \
"ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1 "ftp://ftp.gnu.org/pub/gnu/libtool/" 2 2 6 || DIE=1
version_check "pkg-config" "" \ version_check "pkg-config" "" \
"http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1 "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
@ -54,7 +61,7 @@ autoheader_check || DIE=1
die_check $DIE die_check $DIE
# if no arguments specified then this will be printed # if no arguments specified then this will be printed
if test -z "$*"; then if test -z "$*" && test -z "$NOCONFIGURE"; then
echo "+ checking for autogen.sh options" echo "+ checking for autogen.sh options"
echo " This autogen script will automatically run ./configure as:" echo " This autogen script will automatically run ./configure as:"
echo " ./configure $CONFIGURE_DEF_OPT" echo " ./configure $CONFIGURE_DEF_OPT"
@ -90,21 +97,22 @@ debug "automake: $automake"
tool_run "$automake" "--add-missing --copy" tool_run "$automake" "--add-missing --copy"
test -n "$NOCONFIGURE" && { test -n "$NOCONFIGURE" && {
echo "skipping configure stage for package $package, as requested." echo "+ skipping configure stage for package $package, as requested."
echo "autogen.sh done." echo "+ autogen.sh done."
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 " default flags: $CONFIGURE_DEF_OPT"
test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT" test ! -z "$CONFIGURE_EXT_OPT" && echo " 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
} }
echo "Now type 'make' to compile $package." echo "Now type 'make' to compile $package."