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.66-14-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.66-14-g77469e1
Date: Mon, 19 Jul 2010 23:42:33 +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=77469e1b540b69b1e89dabcebd7b271cce67e269

The branch, master has been updated
       via  77469e1b540b69b1e89dabcebd7b271cce67e269 (commit)
       via  f4f4a26c016f8d7859c8958cc20ec3d80fc10ceb (commit)
      from  1fc79ec3575bc15696254267a1b9130c83b2bfdb (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 77469e1b540b69b1e89dabcebd7b271cce67e269
Author: Eric Blake <address@hidden>
Date:   Mon Jul 19 16:39:45 2010 -0600

    Fix up AC_INIT vs. " issues, and document it.
    
    * doc/autoconf.texi (Initializing configure): Improve
    documentation on argument restrictions.
    * NEWS: Tweak information.
    * lib/autoconf/general.m4 (_AC_INIT_GENERAL): New macro, that also
    rejects literal ".
    (_AC_INIT_PACKAGE): Use it to plug hole in last patch.
    * tests/base.at (AC_INIT with unusual version strings): Enhance
    test.
    
    Signed-off-by: Eric Blake <address@hidden>

commit f4f4a26c016f8d7859c8958cc20ec3d80fc10ceb
Author: Ralf Wildenhues <address@hidden>
Date:   Mon Jul 19 15:50:45 2010 -0600

    Relax AC_INIT requirements for PACKAGE and VERSION strings again.
    
    * lib/m4sugar/m4sh.m4 (AS_LITERAL_HEREDOC_IF): New macro.
    (_AS_LITERAL_HEREDOC_IF, _AS_LITERAL_HEREDOC_IF_YES)
    (_AS_LITERAL_HEREDOC_IF_NO): New helper macros.
    * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Use
    AS_LITERAL_HEREDOC_IF for PACKAGE and VERSION strings.
    * tests/base.at (AC_INIT with unusual version strings): New test.
    * tests/m4sh.at (AS@&address@hidden): Extend test.
    * NEWS: Update.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 ChangeLog               |   25 +++++++++++++++++++++++
 NEWS                    |    8 +++++++
 doc/autoconf.texi       |    9 +++++--
 lib/autoconf/general.m4 |   13 +++++++++--
 lib/m4sugar/m4sh.m4     |   17 ++++++++++++++++
 tests/base.at           |   50 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/m4sh.at           |   19 ++++++++++++++++-
 7 files changed, 133 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca33877..a9ee195 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2010-07-19  Eric Blake  <address@hidden>
 
+       Fix up AC_INIT vs. " issues, and document it.
+       * doc/autoconf.texi (Initializing configure): Improve
+       documentation on argument restrictions.
+       * NEWS: Tweak information.
+       * lib/autoconf/general.m4 (_AC_INIT_GENERAL): New macro, that also
+       rejects literal ".
+       (_AC_INIT_PACKAGE): Use it to plug hole in last patch.
+       * tests/base.at (AC_INIT with unusual version strings): Enhance
+       test.
+
+2010-07-19  Eric Blake  <address@hidden>
+       and Ralf Wildenhues  <address@hidden>
+
+       Relax AC_INIT requirements for PACKAGE and VERSION strings again.
+       * lib/m4sugar/m4sh.m4 (AS_LITERAL_HEREDOC_IF): New macro.
+       (_AS_LITERAL_HEREDOC_IF, _AS_LITERAL_HEREDOC_IF_YES)
+       (_AS_LITERAL_HEREDOC_IF_NO): New helper macros.
+       * lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Use
+       AS_LITERAL_HEREDOC_IF for PACKAGE and VERSION strings.
+       * tests/base.at (AC_INIT with unusual version strings): New test.
+       * tests/m4sh.at (AS@&address@hidden): Extend test.
+       * NEWS: Update.
+
+2010-07-19  Eric Blake  <address@hidden>
+
        Fix testsuite failures from previous patch.
        * lib/autoconf/c.m4 (_AC_PROG_PREPROC_WORKS_IFELSE): Also remove
        conftest.i when preprocessor tests break out of a loop.
diff --git a/NEWS b/NEWS
index 97c5495..a8683c6 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,14 @@ GNU Autoconf NEWS - User visible changes.
 ** AC_PREPROC_IFELSE now keeps the preprocessed output in the conftest.i
    file for inspection by the commands in the ACTION-IF-TRUE argument.
 
+** AC_INIT again allows parentheses and other characters that are literal
+   in quoted and unquoted here-documents and in double-quoted strings
+   in its PACKAGE and VERSION arguments.  This is relevant for
+   packages not using these strings nor products like PACKAGE_STRING
+   in other contexts, e.g., for Automake, and may be subject to
+   further restrictions in the future.  Regression introduced in 2.66.
+
+
 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
   Released by Eric Blake, based on git versions 2.65.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index be7e3ef..8d0f7d3 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -1844,9 +1844,12 @@ distribution tar ball names (e.g., @samp{autoconf}).  It 
defaults to
 other than alphanumerics and underscores are changed to @samp{-}.  If
 provided, @var{url} should be the home page for the package.
 
-It is preferable that the arguments of @code{AC_INIT} be static, i.e.,
-there should not be any shell computation, but they can be computed by
-M4.
+The arguments of @code{AC_INIT} must be static, i.e., there should not
+be any shell computation, but they can be computed by M4 (the use of
address@hidden is permissible).  This is because the package
+information strings are expanded at M4 time into several contexts, and
+must give the same text at shell time whether used in double-quoted
+strings, quoted here-documents, or unquoted here-documents.
 
 The following M4 macros (e.g., @code{AC_PACKAGE_NAME}), output variables
 (e.g., @code{PACKAGE_NAME}), and preprocessor symbols (e.g.,
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 5706d69..477c4ab 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -224,13 +224,20 @@ AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])
 # The solution is to require AC_INIT in each of these macros.  AC_INIT
 # has the needed magic so that it can't be expanded twice.
 
-
+# _AC_INIT_LITERAL(STRING)
+# ------------------------
+# Reject STRING if it cannot be used as-is in double-quoted strings,
+# as well as quoted and unquoted here-docs.
+m4_define([_AC_INIT_LITERAL],
+[m4_if(m4_index([$1], dnl font-lock"
+["])AS_LITERAL_HEREDOC_IF([$1], [-]), [-1-], [],
+  [m4_warn([syntax], [AC_INIT: not a literal: $1])])])
 
 # _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL])
 # ---------------------------------------------------------------------
 m4_define([_AC_INIT_PACKAGE],
-[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])
-AS_LITERAL_IF([$2], [],  [m4_warn([syntax], [AC_INIT: not a literal: $2])])
+[_AC_INIT_LITERAL([$1])
+_AC_INIT_LITERAL([$2])
 AS_LITERAL_IF([$3], [],  [m4_warn([syntax], [AC_INIT: not a literal: $3])])
 m4_ifndef([AC_PACKAGE_NAME],
          [m4_define([AC_PACKAGE_NAME],     [$1])])
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 6fbc9e1..3cc868c 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1592,6 +1592,23 @@ m4_define([_AS_LITERAL_IF_NO], [$2])
 m4_define([AS_LITERAL_WORD_IF],
 [_AS_LITERAL_IF(m4_expand([$1]))([$4], [$3], [$2])])
 
+# AS_LITERAL_HEREDOC_IF(EXPRESSION, IF-LITERAL, IF-NOT-LITERAL)
+# -------------------------------------------------------------
+# Like AS_LITERAL_IF, except that a string is considered literal
+# if it results in the same output in both quoted and unquoted
+# here-documents.
+m4_define([AS_LITERAL_HEREDOC_IF],
+[_$0(m4_expand([$1]))([$2], [$3])])
+
+m4_define([_AS_LITERAL_HEREDOC_IF],
+[m4_if(m4_index([$1], address@hidden|@]), [-1],
+  [m4_if(m4_index(m4_translit([[$1]], [\`], [$]), [$]), [-1],
+    [$0_YES], [$0_NO])],
+  [$0_NO])])
+
+m4_define([_AS_LITERAL_HEREDOC_IF_YES], [$1])
+m4_define([_AS_LITERAL_HEREDOC_IF_NO], [$2])
+
 
 # AS_TMPDIR(PREFIX, [DIRECTORY = $TMPDIR [= /tmp]])
 # -------------------------------------------------
diff --git a/tests/base.at b/tests/base.at
index 8f6e30f..6dc9a17 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -219,6 +219,56 @@ AT_CHECK([grep "^PACKAGE_TARNAME='fu'\$" configure], [], 
[ignore])
 AT_CLEANUP
 
 
+## ------------------------------------- ##
+## AC_INIT with unusual version strings. ##
+## ------------------------------------- ##
+
+AT_SETUP([AC_INIT with unusual version strings])
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU String++ with  spaces (foo)],
+         [2.48++  (2010-07-03)], [http://clisp.cons.org/], [clisp])
+AC_OUTPUT
+]])
+
+if echo 'ab*c' | grep -F 'ab*c' >/dev/null 2>&1; then
+  FGREP="grep -F"
+else
+  FGREP=fgrep
+fi
+
+AT_CHECK_AUTOCONF([-Werror])
+AT_CHECK_CONFIGURE([-q])
+AT_CHECK_CONFIGURE([--help])
+AT_CHECK_CONFIGURE([--version], [], [stdout])
+AT_CHECK([$FGREP 'GNU String++ with  spaces (foo)' stdout], [], [ignore])
+AT_CHECK([$FGREP '2.48++  (2010-07-03)' stdout], [], [ignore])
+
+AT_CHECK([./config.status --version], [], [stdout])
+AT_CHECK([$FGREP 'GNU String++ with  spaces (foo)' stdout], [], [ignore])
+AT_CHECK([$FGREP '2.48++  (2010-07-03)' stdout], [], [ignore])
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU "String++"],
+         [2.48], [http://clisp.cons.org/], [clisp])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF([-Werror], [1], [ignore], [stderr])
+AT_CHECK([grep 'AC_INIT: not a literal: ' stderr], [], [ignore])
+
+AT_DATA([configure.ac],
+[[AC_INIT([GNU String++],
+         ["codename" 2.48], [http://clisp.cons.org/], [clisp])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF([-Werror], [1], [ignore], [stderr])
+AT_CHECK([grep 'AC_INIT: not a literal: ' stderr], [], [ignore])
+
+AT_CLEANUP
+
+
 ## -------------- ##
 ## AC_COPYRIGHT.  ##
 ## -------------- ##
diff --git a/tests/m4sh.at b/tests/m4sh.at
index 2f79332..52ab4ee 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -1119,7 +1119,7 @@ AT_CLEANUP
 ## --------------- ##
 
 AT_SETUP([AS@&address@hidden)
-AT_KEYWORDS([m4sh AS@&address@hidden)
+AT_KEYWORDS([m4sh AS@&address@hidden AS@&address@hidden)
 
 AT_DATA_M4SH([script.as], [[dnl
 AS_INIT
@@ -1141,9 +1141,17 @@ m4_define([mac], [l``it])
 echo AS_LITERAL_IF([mac], [ERR], [ok]) 13
 echo AS_LITERAL_IF([mac], [ERR1], [ok], [ERR2]) 14
 echo AS_LITERAL_IF([   a ][
-b], [ok], [ok]) 15
+b], [ok], [ERR]) 15
 echo AS_LITERAL_WORD_IF([      a ][
 b], [ERR], [ok]) 16
+echo AS_LITERAL_HEREDOC_IF([   a ][
+b], [ok], [ERR]) 17
+echo AS_LITERAL_IF([(a)], [ERR], [ok]) 18
+echo AS_LITERAL_WORD_IF([(a)], [ERR], [ok]) 19
+echo AS_LITERAL_HEREDOC_IF([(a)], [ok], [ERR]) 20
+echo AS_LITERAL_IF(address@hidden|@a], [ERR], [ok]) 21
+echo AS_LITERAL_WORD_IF(address@hidden|@a], [ERR], [ok]) 22
+echo AS_LITERAL_HEREDOC_IF(address@hidden|@a], [ERR], [ok]) 23
 ]])
 
 AT_CHECK_M4SH
@@ -1164,6 +1172,13 @@ ok 13
 ok 14
 ok 15
 ok 16
+ok 17
+ok 18
+ok 19
+ok 20
+ok 21
+ok 22
+ok 23
 ]])
 
 AT_CLEANUP


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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