summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2003-12-09 21:24:12 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2003-12-09 21:24:12 +0000
commitc24bd61365fd90e46575f3192d4ae474fc6286df (patch)
tree35363da83a373957d63c4944e1137545463655c8
parent43d0360902c0ae72e61c19106f4a1d938ab0fb47 (diff)
downloadautomake-c24bd61365fd90e46575f3192d4ae474fc6286df.tar.gz
* 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.
-rw-r--r--ChangeLog14
-rw-r--r--Makefile.am31
-rw-r--r--Makefile.in28
-rwxr-xr-xbootstrap13
-rw-r--r--lib/Automake/Config.in1
-rw-r--r--lib/Automake/Makefile.am23
-rw-r--r--lib/Automake/Makefile.in20
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/Makefile.in2
-rw-r--r--m4/amversion.in1
-rw-r--r--m4/amversion.m41
-rw-r--r--tests/aclocal.in1
-rw-r--r--tests/automake.in1
-rw-r--r--tests/defs.in2
14 files changed, 102 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 3dd2bdd52..fecd2b98b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,18 @@
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.
diff --git a/Makefile.am b/Makefile.am
index b3229eb7a..3442faf11 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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.
diff --git a/Makefile.in b/Makefile.in
index a17a72f22..247e04e5c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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 $@
diff --git a/bootstrap b/bootstrap
index 130fa8a34..aae84976c 100755
--- 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
}
diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
index e5d5f1aa0..5bd2c2e54 100644
--- a/lib/Automake/Config.in
+++ b/lib/Automake/Config.in
@@ -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
diff --git a/lib/Automake/Makefile.am b/lib/Automake/Makefile.am
index 1a950c1ce..c248d7cb3 100644
--- a/lib/Automake/Makefile.am
+++ b/lib/Automake/Makefile.am
@@ -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
diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in
index db9eccee1..dee47491b 100644
--- a/lib/Automake/Makefile.in
+++ b/lib/Automake/Makefile.in
@@ -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:
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 48edb2db8..263b52caf 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -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 $@
diff --git a/m4/Makefile.in b/m4/Makefile.in
index cb78415f3..39bce61be 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -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.
diff --git a/m4/amversion.in b/m4/amversion.in
index c93fe0d97..f3da74277 100644
--- a/m4/amversion.in
+++ b/m4/amversion.in
@@ -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
diff --git a/m4/amversion.m4 b/m4/amversion.m4
index 1c723debc..bfa415211 100644
--- a/m4/amversion.m4
+++ b/m4/amversion.m4
@@ -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
diff --git a/tests/aclocal.in b/tests/aclocal.in
index 631f5b95e..65ea11e48 100644
--- a/tests/aclocal.in
+++ b/tests/aclocal.in
@@ -1,4 +1,5 @@
#!/bin/sh
+# @configure_input@
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
diff --git a/tests/automake.in b/tests/automake.in
index 320be8d77..1df424e54 100644
--- a/tests/automake.in
+++ b/tests/automake.in
@@ -1,4 +1,5 @@
#!/bin/sh
+# @configure_input@
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
diff --git a/tests/defs.in b/tests/defs.in
index f87ff9d14..d18829e37 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -1,4 +1,6 @@
# -*- shell-script -*-
+# @configure_input@
+#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
#