[PATCH 3/4] maint: don't leak developer GREP, SED etc into distribution file.

2010-09-22 Thread Gary V. Vaughan
This is the second part of the patch I've split since the last
time I posted.  I added Joerg as reporter, and he is already
named in THANKS.

Okay to push?

* Makefile.am: Having rearranged the file, now apply the actual
changes to follow-up.
(LT_M4SH): Call $(M4SH) with the libtool m4sh directory at the
front of the search path.
(rebuild): Set the shell variable `revision' rather than
`correctver' for clarity.
(edit): Split into two parts...
(bootstrap_edit): ...substitutions that should happen at bootstrap
time...
(configure_edit): ...and substitutions that should not happen until
configure time.
* libtoolize.m4sh (package_revision): For consistency, and ease of
extraction when deciding whether libtoolize needs to be
regenerated.
* Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh)
(libtoolize.in): Much simplified - only rebuild if the
recalculated timestamp is newer than the timestamp recorded in the
target already; regenerate in one step without changing
directories, using `$(bootstrap_edit)'.
(libtoolize, libtool): Hugely simplified - since we already depend
on `libtoolize.in' and `libltdl/config/ltmain.sh' respectively,
no need to recheck version numbers; also they have the
`$(bootstrap_edit)' substitutions made already, so we can just
go ahead and process with `$(configure_edit)' whenever the
dependencies go out of date.
* Makefile.maint (commit, libltdl/config/mailnotify, bootstrap):
Likewise.
* HACKING (Release Procedure): Remove the note to workaround the
bug fixed by this changeset.
* NEWS (Bug fixes): Mention that this bug is now fixed.
Reported by Joerg Sonnenberger.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 ChangeLog   |   33 ++
 HACKING |9 ---
 Makefile.am |  178 +-
 NEWS|3 +-
 libtoolize.m4sh |1 +
 5 files changed, 118 insertions(+), 106 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 14866a9..fe75e0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,38 @@
 2010-08-31  Gary V. Vaughan  g...@gnu.org
 
+   maint: don't leak developer GREP, SED etc into distribution file.
+   * Makefile.am: Having rearranged the file, now apply the actual
+   changes to follow-up.
+   (LT_M4SH): Call $(M4SH) with the libtool m4sh directory at the
+   front of the search path.
+   (rebuild): Set the shell variable `revision' rather than
+   `correctver' for clarity.
+   (edit): Split into two parts...
+   (bootstrap_edit): ...substitutions that should happen at bootstrap
+   time...
+   (configure_edit): ...and substitutions that should not happen until
+   configure time.
+   * libtoolize.m4sh (package_revision): For consistency, and ease of
+   extraction when deciding whether libtoolize needs to be
+   regenerated.
+   * Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh)
+   (libtoolize.in): Much simplified - only rebuild if the
+   recalculated timestamp is newer than the timestamp recorded in the
+   target already; regenerate in one step without changing
+   directories, using `$(bootstrap_edit)'.
+   (libtoolize, libtool): Hugely simplified - since we already depend
+   on `libtoolize.in' and `libltdl/config/ltmain.sh' respectively,
+   no need to recheck version numbers; also they have the
+   `$(bootstrap_edit)' substitutions made already, so we can just
+   go ahead and process with `$(configure_edit)' whenever the
+   dependencies go out of date.
+   * Makefile.maint (commit, libltdl/config/mailnotify, bootstrap):
+   Likewise.
+   * HACKING (Release Procedure): Remove the note to workaround the
+   bug fixed by this changeset.
+   * NEWS (Bug fixes): Mention that this bug is now fixed.
+   Reported by Joerg Sonnenberger.
+
maint: rearrange Makefile.am in preparation for a follow-up patch.
* Makefile.am (Libtool scripts.): Move this section below the
`Bootstrap.' section...
diff --git a/HACKING b/HACKING
index 977be10..b17de29 100644
--- a/HACKING
+++ b/HACKING
@@ -619,15 +619,6 @@ or obtained by writing to the Free Software Foundation, 
Inc.,
 
 * Update NEWS, ChangeLog.
 
-* Until the bug that leaks developer tool paths into the release tarballs
-  from ./bootstrap is fixed, make sure the right tools are first in your
-  PATH and then:
-   export EGREP=egrep
-   export FGREP=fgrep
-   export GREP=grep
-   export MAKE=make
-   export SED=sed
-
 * Run ./bootstrap.
 
 * Run ./configure (or create a build directory first and run configure
diff --git a/Makefile.am b/Makefile.am
index 1f3c584..48cd3a7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,8 @@ noinst_LTLIBRARIES=
 lib_LTLIBRARIES=
 EXTRA_LTLIBRARIES  =
 
+LT_M4SH= $(M4SH) -B $(srcdir)/$(auxdir)
+
 auxdir = libltdl/config
 m4dir  = libltdl/m4
 
@@ 

Re: [PATCH 3/4] maint: don't leak developer GREP, SED etc into distribution file.

2010-09-22 Thread Ralf Wildenhues
Hi Gary,

* Gary V. Vaughan wrote on Wed, Sep 22, 2010 at 07:05:50PM CEST:
 This is the second part of the patch I've split since the last
 time I posted.  I added Joerg as reporter, and he is already
 named in THANKS.
 
 Okay to push?

With this patch applied, the generated libtool script still contains
the following lines:

: ${EGREP=@EGREP@}
: ${FGREP=@FGREP@}
: ${GREP=@GREP@}
: ${LN_S=@LN_S@}
[...]
: ${SED=@SED@}

Now, the lines are all ineffective, because the tag variables (which
will be expanded before these lines) will set all of these variables.
Kind of ugly, but alright if you prefer to clean that up later.


Secondly, with this patch, and with the nits I wrote inline in the patch
below fixed, still freebsd-make (which is from the freebsd-buildutils
7.0-2 Debian package, and is a somewhat older FreeBSD make built for
GNU/Linux) keeps on rerunning aclocal each time I invoke make.  This
means something is not quite right in the rebuild rules, and it will
probably show up with at least one of the major BSD systems' make
implementations.  Please fix and repost, I will finish review then.

In case of doubt it might be easier to not try to change the actual
dependency graph at all, but merely the rules, which should be enough
to fix the problem you are targeting.

Thanks,
Ralf


 * Makefile.am: Having rearranged the file, now apply the actual
 changes to follow-up.
 (LT_M4SH): Call $(M4SH) with the libtool m4sh directory at the
 front of the search path.
 (rebuild): Set the shell variable `revision' rather than
 `correctver' for clarity.
 (edit): Split into two parts...
 (bootstrap_edit): ...substitutions that should happen at bootstrap
 time...
 (configure_edit): ...and substitutions that should not happen until
 configure time.
 * libtoolize.m4sh (package_revision): For consistency, and ease of
 extraction when deciding whether libtoolize needs to be
 regenerated.
 * Makefile.am (libltdl/m4/ltversion.m4, libltdl/config/ltmain.sh)
 (libtoolize.in): Much simplified - only rebuild if the
 recalculated timestamp is newer than the timestamp recorded in the
 target already; regenerate in one step without changing
 directories, using `$(bootstrap_edit)'.
 (libtoolize, libtool): Hugely simplified - since we already depend
 on `libtoolize.in' and `libltdl/config/ltmain.sh' respectively,
 no need to recheck version numbers; also they have the
 `$(bootstrap_edit)' substitutions made already, so we can just
 go ahead and process with `$(configure_edit)' whenever the
 dependencies go out of date.
 * Makefile.maint (commit, libltdl/config/mailnotify, bootstrap):
 Likewise.
 * HACKING (Release Procedure): Remove the note to workaround the
 bug fixed by this changeset.
 * NEWS (Bug fixes): Mention that this bug is now fixed.
 Reported by Joerg Sonnenberger.

 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -43,6 +43,8 @@ noinst_LTLIBRARIES  =
  lib_LTLIBRARIES  =
  EXTRA_LTLIBRARIES=
  
 +LT_M4SH  = $(M4SH) -B $(srcdir)/$(auxdir)
 +
  auxdir   = libltdl/config
  m4dir= libltdl/m4
  
 @@ -57,7 +59,7 @@ timestamp = set dummy `$(MKSTAMP) $(srcdir)`; shift; \
 *) TIMESTAMP= ;; \
   esac
  
 -rebuild = rebuild=:; $(timestamp); correctver=$$1
 +rebuild = rebuild=:; $(timestamp); revision=$$1
  
  
  # -- #
 @@ -75,26 +77,23 @@ EXTRA_DIST += bootstrap $(srcdir)/libtoolize.in 
 $(auxdir)/ltmain.m4sh \
  CLEANFILES += libtool libtoolize libtoolize.tmp \
 $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
  
 -edit = sed \
 - -e 's,@EGREP\@,$(EGREP),g' \
 - -e 's,@FGREP\@,$(FGREP),g' \
 - -e 's,@GREP\@,$(GREP),g' \
 - -e 's,@LN_S\@,$(LN_S),g' \
 - -e 's,@MACRO_VERSION\@,$(VERSION),g' \
 - -e 's,@PACKAGE\@,$(PACKAGE),g' \
 - -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
 - -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
 - -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
 - -e 's,@PACKAGE_STRING\@,$(PACKAGE_NAME) $(VERSION),g' \
 - -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
 - -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
 - -e 's,@SED\@,$(SED),g' \
 - -e 's,@VERSION\@,$(VERSION),g' \
 - -e 's,@aclocaldir\@,$(aclocaldir),g' \
 - -e 's,@datadir\@,$(datadir),g' \
 - -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
 - -e 's,@host_triplet\@,$(host_triplet),g' \
 - -e 's,@prefix\@,$(prefix),g'
 +## These are the replacements that need to be made at bootstrap time,
 +## because they must be static in distributed files, and not accidentally
 +## changed by configure running on the build machine.
 +bootstrap_edit  = \
 +   -e 's,@MACRO_VERSION\@,$(VERSION),g' \

How come the *_edit variables lost their 'sed' command?  Is that because
a later patch will use more than one of them inside one sed script?  In
that case, OK with me.

 +   -e s,@MACRO_REVISION\@,$$revision,g \
 +   -e s,@MACRO_SERIAL\@,$$serial,g \
 +   -e