autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-100-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-100-g60e32aa
Date: Wed, 23 Jun 2010 02:46:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=60e32aa3fc8a7c9c312aa6aed3187e4e943b559e

The branch, master has been updated
       via  60e32aa3fc8a7c9c312aa6aed3187e4e943b559e (commit)
       via  85b2b2056e4f77313bad613d7bf18ab63f942606 (commit)
       via  eb1ca4966a0046d9efd9d0935e58dd8469f1cef6 (commit)
       via  bea3f1684a2773ef711dc46ec341f4b8aef153c9 (commit)
      from  de8b1ecbdb42f7c66eaf2e11f61768df4f71a7cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 60e32aa3fc8a7c9c312aa6aed3187e4e943b559e
Author: Bruno Haible <address@hidden>
Date:   Sat Jun 19 00:49:48 2010 +0200

    Document how to use literal newlines in makefile rules.
    
    * doc/autoconf.texi (Newlines in Make Rules): New section.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 85b2b2056e4f77313bad613d7bf18ab63f942606
Author: Bruno Haible <address@hidden>
Date:   Sat Jun 19 00:06:37 2010 +0200

    Document how to write comments in makefile rules.
    
    * doc/autoconf.texi (Comments in Make Rules): Mention a workaround
    syntax.
    
    Signed-off-by: Eric Blake <address@hidden>

commit eb1ca4966a0046d9efd9d0935e58dd8469f1cef6
Author: Ben Pfaff <address@hidden>
Date:   Mon Jun 14 21:10:48 2010 -0700

    Document how to propogate variables to submakes.
    
    On bug-gnulib, archived at
         http://permalink.gmane.org/gmane.comp.lib.gnulib.bugs/22132
    Ralf Wildenhues taught me a bit about how Automake propagates
    variables to submakes.  I thought that it would good to document
    this in the Autoconf manual, which currently has no detail at
    all.
    
    * doc/autoconf.texi: Describe technique used by Automake to
    propagate variables to submakes in more detail.
    
    Signed-off-by: Eric Blake <address@hidden>

commit bea3f1684a2773ef711dc46ec341f4b8aef153c9
Author: Peter Johansson <address@hidden>
Date:   Tue Jun 22 21:09:04 2010 -0400

    Be consistent in doc example.
    
    * doc/autoconf.texi: (Polymorphic Variables) be consistent in code
    example and output
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   21 ++++++++++++++++
 doc/autoconf.texi |   67 ++++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 80 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d59487e..024a835 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2010-06-22  Bruno Haible  <address@hidden>
+
+       Document how to use literal newlines in makefile rules.
+       * doc/autoconf.texi (Newlines in Make Rules): New section.
+
+       Document how to write comments in makefile rules.
+       * doc/autoconf.texi (Comments in Make Rules): Mention a workaround
+       syntax.
+
+2010-06-22  Ben Pfaff  <address@hidden>
+
+       Document how to propogate variables to submakes.
+       * doc/autoconf.texi: Describe technique used by Automake to
+       propagate variables to submakes in more detail.
+
+2010-06-22  Peter Johansson  <address@hidden>  (tiny change)
+
+       Be consistent in doc example.
+       * doc/autoconf.texi: (Polymorphic Variables) be consistent in code
+       example and output
+
 2010-06-22  Ralf Wildenhues  <address@hidden>
 
        Add comments for vim syntax highlighting.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 77013d4..1060955 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -529,6 +529,7 @@ Portable Make Programming
 * The Make Macro SHELL::        @code{$(SHELL)} portability issues
 * Parallel Make::               Parallel @command{make} quirks
 * Comments in Make Rules::      Other problems with Make comments
+* Newlines in Make Rules::      Using literal newlines in rules
 * obj/ and Make::               Don't name a subdirectory @file{obj}
 * make -k Status::              Exit status of @samp{make -k}
 * VPATH and Make::              @code{VPATH} woes
@@ -13415,7 +13416,7 @@ can handle composed shell variable names:
 @example
 m4_define([MY_CHECK_HEADER],
 [AS_VAR_PUSHDEF([my_Header], [ac_cv_header_$1])dnl
-AS_VAR_IF([my_Header], [yes], [echo "header $1 available"])dnl
+AS_VAR_IF([my_Header], [yes], [echo "header $1 detected"])dnl
 AS_VAR_POPDEF([my_Header])dnl
 ])
 MY_CHECK_HEADER([stdint.h])
@@ -18561,6 +18562,7 @@ itself.
 * The Make Macro SHELL::        @code{$(SHELL)} portability issues
 * Parallel Make::               Parallel @command{make} quirks
 * Comments in Make Rules::      Other problems with Make comments
+* Newlines in Make Rules::      Using literal newlines in rules
 * obj/ and Make::               Don't name a subdirectory @file{obj}
 * make -k Status::              Exit status of @samp{make -k}
 * VPATH and Make::              @code{VPATH} woes
@@ -18753,8 +18755,8 @@ environment contains some other macros usually defined 
by the
 makefile.  (See also the note about @code{make -e} and @code{SHELL}
 below.)
 
-Another way to propagate overrides to submakes is to do it
-manually, from your makefile:
+If you can foresee all macros that a user might want to override, then
+you can propagate them to submakes manually, from your makefile:
 
 @example
 foo = foo
@@ -18765,12 +18767,25 @@ two:
         @@echo $(foo)
 @end example
 
-You need to foresee all macros that a user might want to override if
-you do that.
+Another way to propagate a variable to submakes in a portable way is to
+expand an extra variable in every invocation of @samp{$(MAKE)} within
+your makefile:
 
-Makefiles generated by @command{automake} expand @code{$(AM_MAKEFLAGS)}
-on the command line of submakes, which can be used for propagated overrides
-(@pxref{Subdirectories, , Automake, automake, GNU Automake}).
address@hidden
+foo = foo
+one:
+        @@echo $(foo)
+        $(MAKE) $(SUBMAKEFLAGS) two
+two:
+        @@echo $(foo)
address@hidden example
+
+Users must be aware that this technique is in use to take advantage of
+it, e.g.@: with @code{make foo=bar SUBMAKEFLAGS='foo=bar'}, but it
+allows any macro to be overridden.  Makefiles generated by
address@hidden use this technique, expanding @code{$(AM_MAKEFLAGS)}
+on the command lines of submakes (@pxref{Subdirectories, , Automake,
+automake, GNU Automake}).
 
 @node The Make Macro MAKEFLAGS
 @section The Make Macro MAKEFLAGS
@@ -18952,6 +18967,42 @@ all:
         # foo
 @end example
 
+As a workaround, you can use the @command{:} no-op command with a string
+argument that gets ignored:
+
address@hidden
+all:
+        : "foo"
address@hidden example
+
address@hidden Newlines in Make Rules
address@hidden Newlines in Make Rules
address@hidden Newlines in @file{Makefile} rules
address@hidden @file{Makefile} rules and newlines
+
+In shell scripts, newlines can be used inside string literals.  But in
+the shell statements of @file{Makefile} rules, this is not possible:
+A newline not preceded by a backslash is a separator between shell
+statements.  Whereas a newline that is preceded by a backslash becomes
+part of the shell statement according to POSIX, but gets replaced,
+together with the backslash that precedes it, by a space in GNU
address@hidden 3.80 and older.  So, how can a newline be used in a string
+literal?
+
+The trick is to set up a shell variable that contains a newline:
+
address@hidden
+nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"
address@hidden example
+
+For example, in order to create a multiline @samp{sed} expression that
+inserts a blank line after every line of a file, this code can be used:
+
address@hidden
+nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
+sed -e "s/\$$/address@hidden@}/" < input > output
address@hidden example
+
 @node obj/ and Make
 @section The @file{obj/} Subdirectory and Make
 @cindex @file{obj/}, subdirectory


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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