From: Darren S. <li...@yo...> - 2009-01-08 22:37:35
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1231439500 0 # Node ID 88413cc906c60d800479ffb6583d77c52157ca57 # Parent c20ec3a8802d8f71d4ad9dc26a413716efe2d71a Allow autogen.sh to be run from a different directory. diff -r 88413cc906c60d800479ffb6583d77c52157ca57 -r c20ec3a8802d8f71d4ad9dc26a413716efe2d71a autogen.sh --- a/autogen.sh Thu Jan 08 18:31:40 2009 +0000 +++ b/autogen.sh Thu Jan 08 21:44:24 2009 +0000 @@ -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 |