automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tiny cosmetic configure_input changes


From: Alexandre Duret-Lutz
Subject: Re: [PATCH] tiny cosmetic configure_input changes
Date: Tue, 09 Dec 2003 22:23:47 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

>>> "Ralf" == Ralf Wildenhues <address@hidden> writes:

 Ralf> The following patch against CVS adjusts the comments inside the
 Ralf> automake and aclocal perl scripts to be somewhat more descriptive.
 Ralf> On my system, e.g. in automake it used to misleadingly read:
 Ralf> # Makefile.  Generated from Makefile.in by configure.

Good catch.  I'm installing this variation instead.  This gets
us closer to the idiom Autoconf uses.

2003-12-09  Ralf Wildenhues  <address@hidden>  (tiny change)
            Alexandre Duret-Lutz  <address@hidden>

        * Makefile.am (do_subst): Fix the substitution of @address@hidden
        (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
        @address@hidden
        (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.

Index: Makefile.am
===================================================================
RCS file: /cvs/automake/automake/Makefile.am,v
retrieving revision 1.224
diff -u -r1.224 Makefile.am
--- Makefile.am 11 Nov 2003 22:48:53 -0000      1.224
+++ Makefile.am 9 Dec 2003 21:22:39 -0000
@@ -58,20 +58,31 @@
 ## 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,address@hidden@],$(datadir),g' -e 
's,address@hidden@],$(PERL),g' \
-           -e 's,address@hidden@],@configure_input@,g' \
-           -e 's,address@hidden@],$(PACKAGE),g' \
-           -e 's,address@hidden@],$(VERSION),g' \
-           -e 's,address@hidden@],$(APIVERSION),g' \
-           -e 's,address@hidden@],$(SHELL),g'
+do_subst = sed \
+  -e 's,address@hidden@],$(APIVERSION),g' \
+  -e 's,address@hidden@],$(PACKAGE),g' \
+  -e 's,address@hidden@],$(PERL),g' \
+  -e 's,address@hidden@],$(SHELL),g' \
+  -e 's,address@hidden@],$(VERSION),g' \
+  -e 's,address@hidden@],Generated from address@hidden; do not edit by 
hand.,g' \
+  -e 's,address@hidden@],$(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 $@ address@hidden
+       $(do_subst) $(srcdir)/automake.in >address@hidden
+       chmod +x address@hidden
+       chmod -w address@hidden
+       mv -f address@hidden $@
 
 aclocal: aclocal.in Makefile
-       $(do_subst) < $(srcdir)/aclocal.in > aclocal
-       chmod +x aclocal
+       rm -f $@ address@hidden
+       $(do_subst) $(srcdir)/aclocal.in >address@hidden
+       chmod +x address@hidden
+       chmod -w address@hidden
+       mv -f address@hidden $@
 
 ## The master location for INSTALL is lib/INSTALL.
 ## This is where `make fetch' will install new versions.
Index: bootstrap
===================================================================
RCS file: /cvs/automake/automake/bootstrap,v
retrieving revision 1.14
diff -u -r1.14 bootstrap
--- bootstrap   17 Nov 2003 08:52:30 -0000      1.14
+++ bootstrap   9 Dec 2003 21:22:39 -0000
@@ -92,12 +92,17 @@
 
 dosubst ()
 {
-  sed -e "address@hidden@%$PERL%g" \
-      -e "address@hidden@%$VERSION%g" \
-      -e "address@hidden@%$APIVERSION%g" \
+  rm -f $2
+  in=`echo $1 | sed 's,^.*/,,'`
+  sed -e "address@hidden@%$APIVERSION%g" \
       -e "address@hidden@%$PACKAGE%g" \
+      -e "address@hidden@%$PERL%g" \
+      -e "address@hidden@%$BOOTSTRAP_SHELL%g" \
+      -e "address@hidden@%$VERSION%g" \
       -e "address@hidden@%$datadir%g" \
-      -e "address@hidden@%$BOOTSTRAP_SHELL%g" $1 > $2
+      -e "address@hidden@%Generated from $in; do not edit by hand.%g" \
+      $1 > $2
+  chmod -w $2
 }
 
 
Index: lib/Automake/Config.in
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Config.in,v
retrieving revision 1.1
diff -u -r1.1 Config.in
--- lib/Automake/Config.in      6 Aug 2003 21:20:15 -0000       1.1
+++ lib/Automake/Config.in      9 Dec 2003 21:22:41 -0000
@@ -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: lib/Automake/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/Makefile.am,v
retrieving revision 1.19
diff -u -r1.19 Makefile.am
--- lib/Automake/Makefile.am    12 Aug 2003 17:52:09 -0000      1.19
+++ lib/Automake/Makefile.am    9 Dec 2003 21:22:41 -0000
@@ -49,14 +49,23 @@
 ## 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,address@hidden@],$(datadir),g' -e 
's,address@hidden@],$(PERL),g' \
-           -e 's,address@hidden@],@configure_input@,g' \
-           -e 's,address@hidden@],$(PACKAGE),g' \
-           -e 's,address@hidden@],$(VERSION),g' \
-           -e 's,address@hidden@],$(APIVERSION),g' \
-           -e 's,address@hidden@],$(SHELL),g'
+do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \
+  -e 's,address@hidden@],$(APIVERSION),g' \
+  -e 's,address@hidden@],$(PACKAGE),g' \
+  -e 's,address@hidden@],$(PERL),g' \
+  -e 's,address@hidden@],$(SHELL),g' \
+  -e 's,address@hidden@],$(VERSION),g' \
+  -e "s,address@hidden@],Generated from $$in.in; do not edit by hand.,g" \
+  -e 's,address@hidden@],$(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: m4/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/m4/Makefile.am,v
retrieving revision 1.50
diff -u -r1.50 Makefile.am
--- m4/Makefile.am      10 Nov 2003 20:55:32 -0000      1.50
+++ m4/Makefile.am      9 Dec 2003 21:22:42 -0000
@@ -67,5 +67,7 @@
 $(top_srcdir)/m4/amversion.m4: $(srcdir)/amversion.in
        sed -e 's,address@hidden@],$(VERSION),g' \
            -e 's,address@hidden@],$(APIVERSION),g' \
+           -e "s,address@hidden@],Generated from amversion.in; do not edit by 
hand.,g" \
            $(srcdir)/amversion.in > address@hidden
+       chmod -w address@hidden
        mv -f address@hidden $@
Index: m4/amversion.in
===================================================================
RCS file: /cvs/automake/automake/m4/amversion.in,v
retrieving revision 1.5
diff -u -r1.5 amversion.in
--- m4/amversion.in     11 Nov 2003 22:06:17 -0000      1.5
+++ m4/amversion.in     9 Dec 2003 21:22:42 -0000
@@ -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: tests/aclocal.in
===================================================================
RCS file: /cvs/automake/automake/tests/aclocal.in,v
retrieving revision 1.1
diff -u -r1.1 aclocal.in
--- tests/aclocal.in    6 Sep 2003 21:10:39 -0000       1.1
+++ tests/aclocal.in    9 Dec 2003 21:22:42 -0000
@@ -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: tests/automake.in
===================================================================
RCS file: /cvs/automake/automake/tests/automake.in,v
retrieving revision 1.1
diff -u -r1.1 automake.in
--- tests/automake.in   6 Sep 2003 21:10:39 -0000       1.1
+++ tests/automake.in   9 Dec 2003 21:22:42 -0000
@@ -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: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.25
diff -u -r1.25 defs.in
--- tests/defs.in       10 Nov 2003 20:55:33 -0000      1.25
+++ tests/defs.in       9 Dec 2003 21:22:42 -0000
@@ -1,4 +1,6 @@
 # -*- shell-script -*-
+# @configure_input@
+#
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
 # Free Software Foundation, Inc.
 #

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]