+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.
## 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.
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~
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 $@
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
}
# 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
## 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
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
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:
$(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 $@
$(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.
# -*- 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
# -*- 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
#!/bin/sh
+# @configure_input@
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
#!/bin/sh
+# @configure_input@
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
# -*- shell-script -*-
+# @configure_input@
+#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
#