summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-11-28 23:07:09 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-11-30 20:25:22 -0600
commit4a8e692f6bab49de18d37f9fdf7ba998396523a5 (patch)
tree732069ad3fb6ae1144d1f4263ce3adb1cddf3f92 /autogen.sh
parent4ab516df62353d068e4ebf298d2f4e1df793dbcc (diff)
make autogen ability to remember the last command line work on MacOS
futhermore: the conf.log extraction method is no reliable. autoconf has changed and newer version don't put it there. furthermore, because of the post_download generation, the conf.log get crowded by a second autoconf...
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/autogen.sh b/autogen.sh
index c2572ebe57a9..27ea62aaa9b1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,14 +9,19 @@ if test "z$1" = "z--clean"; then
exit 1;
fi
-requote_args ()
+function requote
{
- sed -r -e 's/.*configure //' -e 's/(["'"'"'])/\\\1/g' -e 's/=(([^"'"'"'-]|-[^-]| )*)( |$)/="\1" /g'
+ local q=\'
+ set -- "${@//\'/$q\'$q}" # quote inner instances of '
+ set -- "${@/#/$q}" # add ' to start of each param
+ set -- "${@/%/$q}" # add ' to end of each param
+ echo "$*"
}
+
old_args=""
-if test $# -eq 0 && test -f config.log; then
- old_args=`grep '\$ ./configure' config.log | requote_args`
+if test $# -eq 0 && test -f autogen.lastrun; then
+ old_args=$(cat autogen.lastrun)
echo "re-using arguments from last configure: $old_args";
fi
@@ -37,6 +42,7 @@ if test "x$NOCONFIGURE" = "x"; then
if test -n "$old_args" ; then
eval `echo ./configure $old_args`
else
+ echo "$(requote "$@")" > autogen.lastrun
./configure "$@"
fi
else