diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-01-08 18:31:40 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2009-01-08 18:31:40 +0000 |
commit | fe62e82f6507741185596fbd5117438b41d8cf94 (patch) | |
tree | 5ee950007f43e572185f7c4f9514f052036ac4e3 | |
parent | 37a24a7db9901730f6709e802df0fef42884ddf9 (diff) | |
download | xine-lib-fe62e82f6507741185596fbd5117438b41d8cf94.tar.gz xine-lib-fe62e82f6507741185596fbd5117438b41d8cf94.tar.bz2 |
Allow autogen.sh to be run from a different directory.
-rwxr-xr-x | autogen.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh index 13e663510..ac99c9d98 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 @@ -248,7 +249,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 +261,7 @@ run_configure () { # MAIN #--------------- detect_configure_ac +cd "$srcdir" detect_autoconf detect_libtool detect_automake @@ -295,6 +301,8 @@ case "$1" in run_autoheader run_automake run_autoconf + # return to our original directory + cd - >/dev/null run_configure "$@" ;; esac |