At Wednesday 28 July 2010, Ralf Wildenhues wrote: > Hello Stefano, > > * Stefano Lattarini wrote on Tue, Jul 27, 2010 at 10:58:24PM CEST: > > Subject: [PATCH 1/2] Bootstrap: let the user choose which > > autoconf to use. > > Well, you should change > > > +AUTOCONF=${AUTOCONF-autoconf} > > to > > : ${AUTOCONF=autoconf} OK. > But even then, when developing Automake you will need to be extra > careful to never let autoconf be invoked from the rebuild rules; > because then, it will run plain "autoconf" and not the $AUTOCONF > that you set. Why? AUTOCONF is AC_SUBST by configure, so if I do: AUTOCONF=autoconf-2.67 ./boostrap AUTOCONF=autoconf-2.67 ./configure there should be no problem. Am I missing something? (BTW, if my understanding is correct, this would make a nice addition to HACKING, too). > So the safe thing to do is to ensure you have the > right autoconf early in $PATH. > > The second patch is not ok. The code prior to your patch already > allows the person running bootstrap to set PERL. Oops. Right, sloppiness on my part. I'll fix the ChangeLog. > Changing that > from an absolute file name to a non-absolute one is a bad idea, it > breaks several test setups I have, How? The $PERL in bootstrap should be only substituted in the shebang lines of automake.tmp and aclocal.tmp, and both of these scripts are removed just after being run once by boostrap itself.
> and I've never had any complaints from people who move their perl > installation. I hope so :-)! The patch was only meant to remove "useless" code (the looping of $PATH looking for perl). The amended patches are attached, with a new follow-up patch doing some fixlets for bootstrap. Regards, Stefano
From bf4e7ecea7feae34056b2e4382a2bef94642cb07 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 27 Jul 2010 22:44:54 +0200 Subject: [PATCH 1/3] Bootstrap: let the user choose which autoconf to use. * bootstrap ($AUTOCONF): New variable, from the environment. Use it instead of calling "autoconf" directly. --- ChangeLog | 6 ++++++ bootstrap | 5 ++++- 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7edcae8..4107f75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-07-27 Stefano Lattarini <stefano.lattar...@gmail.com> + + Bootstrap: let the user choose which autoconf to use. + * bootstrap ($AUTOCONF): New variable, from the environment. + Use it instead of calling "autoconf" directly. + 2010-07-21 Stefano Lattarini <stefano.lattar...@gmail.com> Modernize and improve test scripts `subdir*.test'. diff --git a/bootstrap b/bootstrap index 7766bd3..5577eeb 100755 --- a/bootstrap +++ b/bootstrap @@ -35,6 +35,9 @@ set -e # Set program basename. me=`echo "$0" | sed 's,^.*/,,'` +# Let user choose which version of autoconf to use. +: ${AUTOCONF=autoconf} + # Find perl. Code based on Autoconf, but without non-POSIX support. if test -z "$PERL"; then save_IFS=$IFS @@ -133,7 +136,7 @@ cd .. # Run the autotools. $PERL ./aclocal.tmp -I m4 -autoconf +$AUTOCONF $PERL ./automake.tmp # Remove temporary files and directories. -- 1.7.1
From 06df685929e61f2c8af70fef3768b727f3f2e39a Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 27 Jul 2010 22:50:38 +0200 Subject: [PATCH 2/3] Bootstrap: don't search perl in $PATH. * bootstrap: Do not explicitly search perl in $PATH anymore. ($PATH_SEPARATOR): Removed, it's no more needed. --- ChangeLog | 4 ++++ bootstrap | 32 ++------------------------------ 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4107f75..08c5fe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-07-27 Stefano Lattarini <stefano.lattar...@gmail.com> + Bootstrap: don't search perl in $PATH. + * bootstrap: Do not explicitly search perl in $PATH anymore. + ($PATH_SEPARATOR): Removed, it's no more needed. + Bootstrap: let the user choose which autoconf to use. * bootstrap ($AUTOCONF): New variable, from the environment. Use it instead of calling "autoconf" directly. diff --git a/bootstrap b/bootstrap index 5577eeb..bee1bee 100755 --- a/bootstrap +++ b/bootstrap @@ -19,43 +19,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Find the path separator. -# (Snippet copied from configure's initialization in Autoconf 2.65) -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - # Don't ignore failures. set -e # Set program basename. me=`echo "$0" | sed 's,^.*/,,'` -# Let user choose which version of autoconf to use. +# Let user choose which version of autoconf and perl to use. : ${AUTOCONF=autoconf} - -# Find perl. Code based on Autoconf, but without non-POSIX support. -if test -z "$PERL"; then - save_IFS=$IFS - IFS=$PATH_SEPARATOR - for dir in $PATH; do - IFS=$save_IFS - test -z "$dir" && dir=. - if test -x "$dir/perl" && test ! -d "$dir/perl"; then - PERL="$dir/perl" - break - fi - done -fi - -if test -z "$PERL"; then - echo "$me: cannot find perl" >&2 - exit 1 -fi +: ${PERL=perl} # Variables to substitute. VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac` -- 1.7.1
From 8d6cd0eb8105c7f8ece82434c4355b593185d5ec Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Wed, 28 Jul 2010 11:02:50 +0200 Subject: [PATCH 3/3] Bootstrap: fixlet. * bootstrap: Do not remove `lib/Automake/Config.pm' anymore, since we don't generate it. Correctly quote arguments of `eval' builtin. Fixed a botched error message. Removed an extra blank line. --- ChangeLog | 6 ++++++ bootstrap | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08c5fe1..956e5db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-07-27 Stefano Lattarini <stefano.lattar...@gmail.com> + Bootstrap: fixlet. + * bootstrap: Do not remove `lib/Automake/Config.pm' anymore, + since we don't generate it. Correctly quote arguments of + `eval' builtin. Fixed a botched error message. Removed an + extra blank line. + Bootstrap: don't search perl in $PATH. * bootstrap: Do not explicitly search perl in $PATH anymore. ($PATH_SEPARATOR): Removed, it's no more needed. diff --git a/bootstrap b/bootstrap index bee1bee..12a7654 100755 --- a/bootstrap +++ b/bootstrap @@ -46,7 +46,7 @@ fi # Read the rule for calculating APIVERSION and execute it. apiver_cmd=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac` -eval $apiver_cmd +eval "$apiver_cmd" # Sanity checks. if test -z "$VERSION"; then @@ -55,7 +55,7 @@ if test -z "$VERSION"; then fi if test -z "$APIVERSION"; then - echo "$me: cannot find VERSION" >&2 + echo "$me: cannot find APIVERSION" >&2 exit 1 fi @@ -87,7 +87,6 @@ dosubst () chmod a-w $2 } - # Create temporary replacement for lib/Automake/Config.pm. dosubst automake-$APIVERSION/Automake/Config.in \ automake-$APIVERSION/Automake/Config.pm @@ -114,4 +113,3 @@ $PERL ./automake.tmp # Remove temporary files and directories. rm -rf aclocal-$APIVERSION automake-$APIVERSION rm -f aclocal.tmp automake.tmp -rm -f lib/Automake/Config.pm -- 1.7.1