Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-08-08 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Aug 08, 2010 at 12:53:21PM CEST:
 At Sunday 08 August 2010, Ralf Wildenhues wrote:
  Also, regenerating the tree with Autoconf 2.67 and committing that
  separately is preapproved for maint.
 Couldn't this cause problems when later merging to master?  If yes, 
 how would those be better solved?

This is solved most easily by having one commit in maint that
regenerates the tree, and merging that in the active branches.
You may want to do a fake merge in this case to force a correctly
created configure script for the branches ...

Wait a couple of minutes, I'll do it and push right away.

Cheers,
Ralf



Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-08-08 Thread Stefano Lattarini
At Sunday 08 August 2010, Ralf Wildenhues wrote:
 * Stefano Lattarini wrote on Sun, Aug 08, 2010 at 12:09:52PM CEST:
  I squashed the following into the first patch:
  
  It's OK for you?
 
 Sure.
 
(BTW, if my understanding is correct, this would make a nice
addition to HACKING, too).
   
   Yep.
  
  Attached is a follow-up patch that does that.  Comments and
  criticism are welcome.
 
 OK with typos fixed.
 
  P.S. I'll fix the dates in the ChangeLog entried before pushing.
 
 Fine with me.  If you have all your patches in branches
Yes, a branch for every patch (series).
 or otherwise ordered, you can also just wait until I'm done
 reviewing and commit or merge them in your preferred order.  
 Whatever seems easier for you.
I should have no problem with my workflow; git is very flexible.
But thanks for your concerns.

 Also, regenerating the tree with Autoconf 2.67 and committing that
 separately is preapproved for maint.
Couldn't this cause problems when later merging to master?  If yes, 
how would those be better solved?

 
 Thanks,
 Ralf
 
  Subject: [PATCH] Bootstrap: updated HACKING entry.
  
  * HACKING (Working with git): Tell how to override the autoconf
 
 I think  s/Tell/Explain/  is the right term.
Yes. Better.
 
  and autom4te used by the bootstrap process.
 
 s/used/programs /  ?
Better.

 
  --- a/HACKING
  +++ b/HACKING
  @@ -96,7 +96,12 @@
  
 tree, so the resulting files (aclocal.m4 and Makefile.in)
 should be the same as you would get if you install this
 version of automake and use it to generate those files.  Be
 sure to have the
  
  -  latest stable version of Autoconf installed.
  +  latest stable version of Autoconf installed.  If such version
  is +  not installed as the default autoconf command, you'll
  have to
 
 I think more common would be
   s/the default autoconf command/autoconf/
   s/you'll have to//
Yes, less verbosity is better.

  +  pass it explicitly (along with the accompanying autom4te)
  when +  calling `bootstrap' and `configure'.  For example:
  +$ AUTOCONF=autoconf2.65 AUTOM4TE=autom4te2.65 ./boostrap
 
 s/boo/t/
Oops. Fixed.

Thanks,
  Stefano



Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-08-08 Thread Ralf Wildenhues
[ the gnu list server seems down ATM; expect delays ]

Hi Stefano,

* Stefano Lattarini wrote on Wed, Jul 28, 2010 at 11:07:20AM CEST:
 At Wednesday 28 July 2010, Ralf Wildenhues wrote:
  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

(please pass variables as arguments to configure, so config.status
--recheck remembers them.)

 there should be no problem.  Am I missing something?

You're right.  Only, that AUTOM4TE should be set, too, so that
aclocal.tmp uses the right one.  Maybe it's prudent to set that here,
too.

 (BTW, if my understanding is correct, this would make a nice addition 
 to HACKING, too).

Yep.

  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.

Overlooked by me.

 The amended patches are attached, with a new follow-up patch doing 
 some fixlets for bootstrap.

Thanks, OK for maint with $AUTOM4TE handling folded in as above.

Cheers,
Ralf

 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.
[...]



Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-07-28 Thread Stefano Lattarini
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 21  {
-(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) /dev/null 21 ||
-  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; 

Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-07-27 Thread Eric Blake
On 07/27/2010 02:58 PM, Stefano Lattarini wrote:
 +# Let user choose which version of autoconf to use.
 +AUTOCONF=${AUTOCONF-autoconf}
 +

I'm used to this variant, with less typing:

: ${AUTOCONF=autoconf}

But your way works, too.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-07-27 Thread Eric Blake
On 07/27/2010 03:08 PM, Eric Blake wrote:
 On 07/27/2010 02:58 PM, Stefano Lattarini wrote:
 +# Let user choose which version of autoconf to use.
 +AUTOCONF=${AUTOCONF-autoconf}
 +
 
 I'm used to this variant, with less typing:
 
 : ${AUTOCONF=autoconf}
 
 But your way works, too.

Huh, I just realized that:

: ${var=val}

might be less efficient, if $var is already defined and contains
globbing characters.  To avoid wasting time on (unnecessary) file name
expansion, it is faster to use

: ${var=val}

even though both variants should (normally) have the same end result.

In particular, on cygwin, doing globs can cause a side effect - if you
ever cause a glob() to take place on a string containing a backslash,
cygwin will warn on the console (but thankfully not pollute stderr)
about your potential use of non-POSIX filenames.  The bash-completion
package applied several patches earlier this year to avoid globs, in
part because of that cygwin side-effect.  I should probably document
that in the autoconf manual.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-07-27 Thread Stefano Lattarini
Hi Eric.

At Tuesday 27 July 2010, Eric Blake wrote:
 On 07/27/2010 03:08 PM, Eric Blake wrote:
  On 07/27/2010 02:58 PM, Stefano Lattarini wrote:
  +# Let user choose which version of autoconf to use.
  +AUTOCONF=${AUTOCONF-autoconf}
  +
  
  I'm used to this variant, with less typing:
  : ${AUTOCONF=autoconf}
  
  But your way works, too.
Can you confirm it's as portable as the ways suggested in the autoconf 
manual?  If yes, do you think it could be an useful addition to that 
manual?

Thanks,
   Stefano



Re: [PATCHES] Bootstrap: Allow user overriding of $AUTOCONF and $PERL.

2010-07-27 Thread Eric Blake
On 07/27/2010 03:37 PM, Stefano Lattarini wrote:
 I'm used to this variant, with less typing:
 : ${AUTOCONF=autoconf}

 But your way works, too.
 Can you confirm it's as portable as the ways suggested in the autoconf 
 manual?  If yes, do you think it could be an useful addition to that 
 manual?

The autoconf manual already states that ${var:=value} doesn't work, and
that if value occupies more than one word, then you need to use quotes
or an intermediate shell variable.  Then there is the Ultrix bug, where
you need var=${var=$val} to avoid 8-bit cleanliness issues, and the
Solaris bug where $val containing } causes parse problems, leading to
this recommended construct when you are defaulting to an unknown
intermediate value:

  test ${var+set} = set || var={value}

But by itself, ${var=value} is portable, where value is not a shell
substitution.

http://www.gnu.org/software/autoconf/manual/autoconf.html#Shell-Substitutions

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature