diff options
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/autogen.sh b/autogen.sh index 13e663510..0ec876910 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e # # Copyright (C) 2000-2003 the xine project # @@ -37,12 +37,13 @@ case `echo -n` in *) _echo_n=-n _echo_c=;; esac +srcdir="`dirname "$0"`" + detect_configure_ac() { - srcdir=`dirname $0` test -z "$srcdir" && srcdir=. - (test -f $srcdir/configure.ac) || { + (test -f "$srcdir"/configure.ac) || { echo $_echo_n "*** Error ***: Directory "\`$srcdir\`" does not look like the" echo " top-level directory" exit 1 @@ -106,6 +107,7 @@ run_autoconf () { echo $_echo_n " + Running autoconf: $_echo_c"; autoconf; + sed -i -e '/gnu_ld/,/;;/ s/--rpath \${wl}/--rpath,/' configure echo "done." } @@ -248,7 +250,11 @@ run_configure () { echo " ** If you wish to pass arguments to ./configure, please" echo " ** specify them on the command line." fi - ./configure "$@" + if test -f configure; then + ./configure "$@" + else + "$srcdir"/configure "$@" + fi } @@ -256,6 +262,7 @@ run_configure () { # MAIN #--------------- detect_configure_ac +cd "$srcdir" detect_autoconf detect_libtool detect_automake @@ -283,18 +290,20 @@ case "$1" in run_libtoolize ;; noconfig) - run_aclocal run_libtoolize + run_aclocal run_autoheader run_automake run_autoconf ;; *) - run_aclocal run_libtoolize + run_aclocal run_autoheader run_automake run_autoconf + # return to our original directory + cd - >/dev/null run_configure "$@" ;; esac |