]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* Makefile.am (do_subst): Fix the substitution of @configure_input@.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 9 Dec 2003 21:24:12 +0000 (21:24 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 9 Dec 2003 21:24:12 +0000 (21:24 +0000)
(automake, aclocal): Create the output atomically and make it
read-only, as done in the Autoconf package.
* lib/Automake/Makefile.am (do_subst): Fix the substitution of
@configure_input@.
(Config.pm): Create the output atomically and make it read-only.
* m4/Makefile.am ($(top_srcdir)/m4/amversion.m4): Substitute
@configure_input@ and make the output read-only.
* lib/Automake/Config.in, m4/amversion.in, tests/aclocal.in,
tests/automake.in, tests/defs.in: Add a @configure_input@ line.

14 files changed:
ChangeLog
Makefile.am
Makefile.in
bootstrap
lib/Automake/Config.in
lib/Automake/Makefile.am
lib/Automake/Makefile.in
m4/Makefile.am
m4/Makefile.in
m4/amversion.in
m4/amversion.m4
tests/aclocal.in
tests/automake.in
tests/defs.in

index 3dd2bdd5250a3cc95c446da8270fc5e5c15d9c4a..fecd2b98beb1819b1aedf9401f843de7071048d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2003-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
+           Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * Makefile.am (do_subst): Fix the substitution of @configure_input@.
+       (automake, aclocal): Create the output atomically and make it
+       read-only, as done in the Autoconf package.
+       * lib/Automake/Makefile.am (do_subst): Fix the substitution of
+       @configure_input@.
+       (Config.pm): Create the output atomically and make it read-only.
+       * m4/Makefile.am ($(top_srcdir)/m4/amversion.m4): Substitute
+       @configure_input@ and make the output read-only.
+       * lib/Automake/Config.in, m4/amversion.in, tests/aclocal.in,
+       tests/automake.in, tests/defs.in: Add a @configure_input@ line.
+
 2003-12-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
 
        * doc/automake.texi (Local Macros, CVS): Typos.
index b3229eb7a7a5cd7f60dc6abd6f4f1cc004c115e9..3442faf11882050bc153aca0697e9b21884dfb2f 100644 (file)
@@ -58,20 +58,31 @@ uninstall-hook:
 ## We can't use configure to do the substitution here; we must do it
 ## by hand.  We use a funny notation here to avoid configure
 ## substitutions in our text.
-do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
-           -e 's,[@]configure_input[@],@configure_input@,g' \
-           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-           -e 's,[@]VERSION[@],$(VERSION),g' \
-           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
-           -e 's,[@]SHELL[@],$(SHELL),g'
+do_subst = sed \
+  -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+  -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+  -e 's,[@]PERL[@],$(PERL),g' \
+  -e 's,[@]SHELL[@],$(SHELL),g' \
+  -e 's,[@]VERSION[@],$(VERSION),g' \
+  -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
+  -e 's,[@]datadir[@],$(datadir),g'
 
+## These files depend on Makefile so they are rebuilt if $(VERSION),
+## $(datadir) or other do_subst'ituted variables change.
+## Use chmod -w to prevent people from editing the wrong file by accident.
 automake: automake.in Makefile
-       $(do_subst) < $(srcdir)/automake.in > automake
-       chmod +x automake
+       rm -f $@ $@.tmp
+       $(do_subst) $(srcdir)/automake.in >$@.tmp
+       chmod +x $@.tmp
+       chmod -w $@.tmp
+       mv -f $@.tmp $@
 
 aclocal: aclocal.in Makefile
-       $(do_subst) < $(srcdir)/aclocal.in > aclocal
-       chmod +x aclocal
+       rm -f $@ $@.tmp
+       $(do_subst) $(srcdir)/aclocal.in >$@.tmp
+       chmod +x $@.tmp
+       chmod -w $@.tmp
+       mv -f $@.tmp $@
 
 ## The master location for INSTALL is lib/INSTALL.
 ## This is where `make fetch' will install new versions.
index a17a72f2219c0b55fef1bfb27e08e6e114d31726..247e04e5cfcafab19c7f2715e67cb8c7c11674af 100644 (file)
@@ -149,12 +149,14 @@ TAGS_FILES = $(AUTOMAKESOURCES)
 EXTRA_DIST = ChangeLog.96 ChangeLog.98 ChangeLog.00 ChangeLog.01 ChangeLog.02 \
   $(AUTOMAKESOURCES)
 
-do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
-           -e 's,[@]configure_input[@],@configure_input@,g' \
-           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-           -e 's,[@]VERSION[@],$(VERSION),g' \
-           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
-           -e 's,[@]SHELL[@],$(SHELL),g'
+do_subst = sed \
+  -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+  -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+  -e 's,[@]PERL[@],$(PERL),g' \
+  -e 's,[@]SHELL[@],$(SHELL),g' \
+  -e 's,[@]VERSION[@],$(VERSION),g' \
+  -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
+  -e 's,[@]datadir[@],$(datadir),g'
 
 WGET = wget
 WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
@@ -599,12 +601,18 @@ uninstall-hook:
        done
 
 automake: automake.in Makefile
-       $(do_subst) < $(srcdir)/automake.in > automake
-       chmod +x automake
+       rm -f $@ $@.tmp
+       $(do_subst) $(srcdir)/automake.in >$@.tmp
+       chmod +x $@.tmp
+       chmod -w $@.tmp
+       mv -f $@.tmp $@
 
 aclocal: aclocal.in Makefile
-       $(do_subst) < $(srcdir)/aclocal.in > aclocal
-       chmod +x aclocal
+       rm -f $@ $@.tmp
+       $(do_subst) $(srcdir)/aclocal.in >$@.tmp
+       chmod +x $@.tmp
+       chmod -w $@.tmp
+       mv -f $@.tmp $@
 
 INSTALL: lib/INSTALL
        cp lib/INSTALL $@
index 130fa8a34f20fff6d56b32073d29577aa65a1288..aae84976c6b16e5e18078787a46356da4cbdee49 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -92,12 +92,17 @@ cp -rf lib/* automake-$APIVERSION
 
 dosubst ()
 {
-  sed -e "s%@PERL@%$PERL%g" \
-      -e "s%@VERSION@%$VERSION%g" \
-      -e "s%@APIVERSION@%$APIVERSION%g" \
+  rm -f $2
+  in=`echo $1 | sed 's,^.*/,,'`
+  sed -e "s%@APIVERSION@%$APIVERSION%g" \
       -e "s%@PACKAGE@%$PACKAGE%g" \
+      -e "s%@PERL@%$PERL%g" \
+      -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
+      -e "s%@VERSION@%$VERSION%g" \
       -e "s%@datadir@%$datadir%g" \
-      -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" $1 > $2
+      -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
+      $1 > $2
+  chmod -w $2
 }
 
 
index e5d5f1aa0506b03183f2784c9f573ff10b54f479..5bd2c2e54b3631ab37eaf95ae77650e35055de34 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright (C) 2003  Free Software Foundation, Inc.      -*- Perl -*-
+# @configure_input@
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
index 1a950c1ce42b26264b60b8e97e70203177f399f6..c248d7cb3c76a499d2f50a9866961b97b9a26bab 100644 (file)
@@ -49,14 +49,23 @@ CLEANFILES = $(nodist_perllib_DATA)
 ## We can't use configure to do the substitution here; we must do it
 ## by hand.  We use a funny notation here to avoid configure
 ## substitutions in our text.
-do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
-           -e 's,[@]configure_input[@],@configure_input@,g' \
-           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-           -e 's,[@]VERSION[@],$(VERSION),g' \
-           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
-           -e 's,[@]SHELL[@],$(SHELL),g'
+do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \
+  -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+  -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+  -e 's,[@]PERL[@],$(PERL),g' \
+  -e 's,[@]SHELL[@],$(SHELL),g' \
+  -e 's,[@]VERSION[@],$(VERSION),g' \
+  -e "s,[@]configure_input[@],Generated from $$in.in; do not edit by hand.,g" \
+  -e 's,[@]datadir[@],$(datadir),g'
 
+## This file depend on Makefile so it is rebuilt if $(VERSION),
+## $(datadir) or other do_subst'ituted variables change.
+## Use chmod -w to prevent people from editing the wrong file by accident.
 Config.pm: Config.in Makefile
-       $(do_subst) <$(srcdir)/Config.in >$@
+       rm -f Config.tmp Config.pm
+       $(do_subst) $(srcdir)/Config.in >Config.tmp
+       chmod +x Config.tmp
+       chmod -w Config.tmp
+       mv -f Config.tmp Config.pm
 
 EXTRA_DIST = Config.in
index db9eccee1d9eabc799590c9265e9cb22dd292dbc..dee47491b9799ca863a98ff5e61a42af1d3e9d8a 100644 (file)
@@ -156,12 +156,14 @@ nodist_perllib_DATA = \
   Config.pm
 
 CLEANFILES = $(nodist_perllib_DATA)
-do_subst = sed -e 's,[@]datadir[@],$(datadir),g' -e 's,[@]PERL[@],$(PERL),g' \
-           -e 's,[@]configure_input[@],@configure_input@,g' \
-           -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-           -e 's,[@]VERSION[@],$(VERSION),g' \
-           -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
-           -e 's,[@]SHELL[@],$(SHELL),g'
+do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \
+  -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+  -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
+  -e 's,[@]PERL[@],$(PERL),g' \
+  -e 's,[@]SHELL[@],$(SHELL),g' \
+  -e 's,[@]VERSION[@],$(VERSION),g' \
+  -e "s,[@]configure_input[@],Generated from $$in.in; do not edit by hand.,g" \
+  -e 's,[@]datadir[@],$(datadir),g'
 
 EXTRA_DIST = Config.in
 all: all-recursive
@@ -485,7 +487,11 @@ uninstall-info: uninstall-info-recursive
 
 
 Config.pm: Config.in Makefile
-       $(do_subst) <$(srcdir)/Config.in >$@
+       rm -f Config.tmp Config.pm
+       $(do_subst) $(srcdir)/Config.in >Config.tmp
+       chmod +x Config.tmp
+       chmod -w Config.tmp
+       mv -f Config.tmp Config.pm
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 48edb2db8654f7f49d0089a8875a4a5c82fc683c..263b52caf166155b5001c464177d084c1bf765bb 100644 (file)
@@ -67,5 +67,7 @@ EXTRA_DIST = dirlist amversion.in
 $(top_srcdir)/m4/amversion.m4: $(srcdir)/amversion.in
        sed -e 's,[@]VERSION[@],$(VERSION),g' \
            -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+           -e "s,[@]configure_input[@],Generated from amversion.in; do not edit by hand.,g" \
            $(srcdir)/amversion.in > $@t
+       chmod -w $@t
        mv -f $@t $@
index cb78415f35191c92b41cd0f15fd413b5a53237b9..39bce61be5255c4116e5b85afc27bffcf93ec431 100644 (file)
@@ -335,7 +335,9 @@ uninstall-am: uninstall-dist_m4dataDATA uninstall-info-am
 $(top_srcdir)/m4/amversion.m4: $(srcdir)/amversion.in
        sed -e 's,[@]VERSION[@],$(VERSION),g' \
            -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
+           -e "s,[@]configure_input[@],Generated from amversion.in; do not edit by hand.,g" \
            $(srcdir)/amversion.in > $@t
+       chmod -w $@t
        mv -f $@t $@
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index c93fe0d970df3a78853d46f806f1c9b48804e30d..f3da7427788147a427ba3bfc23381c6c1c9c459b 100644 (file)
@@ -1,5 +1,6 @@
 #                                                        -*- Autoconf -*-
 # Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# @configure_input@
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
index 1c723debcbf9d83a58f9f1f63484615727754e70..bfa41521144e91cb0c5e8b7351ad3e8225f29c8c 100644 (file)
@@ -1,5 +1,6 @@
 #                                                        -*- Autoconf -*-
 # Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Generated from amversion.in; do not edit by hand.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
index 631f5b95e997b9cea6cc8fd9a55f163979947587..65ea11e484ea0a4c0f3aed3db5a2eb4e65f7d61f 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# @configure_input@
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
index 320be8d77eccc487c525933f5b95b0fabb0853e2..1df424e54f3c4700a52a142d1ef04b3814564bee 100644 (file)
@@ -1,4 +1,5 @@
 #!/bin/sh
+# @configure_input@
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
index f87ff9d14a5fcebfd45712f80052f5c76b05352a..d18829e370e3fd1e8eb6cc156d83a23e7d1b76c1 100644 (file)
@@ -1,4 +1,6 @@
 # -*- shell-script -*-
+# @configure_input@
+#
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 # Free Software Foundation, Inc.
 #