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.69-45-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.69-45-g5269030
Date: Fri, 09 Nov 2012 23:19:58 +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=5269030d19da56c4b0a180e4a9793c959a28d9e9

The branch, master has been updated
       via  5269030d19da56c4b0a180e4a9793c959a28d9e9 (commit)
       via  1ed0548896e941b381e96724e41badc42ef7ec6e (commit)
       via  4f6345bda73fc081a57f4e733512cd946aeeb3fd (commit)
       via  d73770f879e29d11d0f03e092247be27234fc32a (commit)
      from  26cb0918d38d756b7c2a3f82226551f6facee47e (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 5269030d19da56c4b0a180e4a9793c959a28d9e9
Author: Eric Blake <address@hidden>
Date:   Fri Nov 9 15:41:18 2012 -0700

    AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks
    
    Too many legacy tools exist for us to unilaterally quit supporting
    AC_CONFIG_MACRO_DIR - it is feasible for someone to want their
    package to bootstrap with both automake 1.13 and libtool 2.4.2,
    where the newer automake will only trace the new style of multiple
    directory listings, but the older libtool does a sed and settles
    on the one use of the old name.  So, we let both macros forward
    to a new tracing macro, which also has the benefit of sanitizing
    calls into one directory per trace; we also ensure that the old
    macro is always traced, and appears at most once and before any
    use of the new macro.
    
    * doc/autoconf.texi (Input) <AC_CONFIG_MACRO_DIRS>: Document how
    to trace this macro.
    * lib/autom4te.in (Autoreconf-preselections)
    (Automake-preselections): Preselect this trace.
    * lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIR_TRACE): New trace.
    (_AC_CONFIG_MACRO_DIRS_USED, _AC_CONFIG_MACRO_DIRS): New internal
    macros.
    (AC_CONFIG_MACRO_DIRS, AC_CONFIG_MACRO_DIR): Use them.
    * tests/tools.at (autoconf --trace: AC_CONFIG_MACRO_DIRS): New
    test.

commit 1ed0548896e941b381e96724e41badc42ef7ec6e
Author: Stefano Lattarini <address@hidden>
Date:   Sat Nov 3 13:05:09 2012 +0100

    warn: allow aclocal to silence m4_require warnings
    
    We introduce a new witness macro, m4_require_silent_probe, for use by
    aclocal during the Autoconf-without-aclocal-m4 language.  This will let
    aclocal process AC_CONFIG_MACRO_DIRS without emitting spurious warnings.
    In fact, if aclocal doesn't suppress require warnings, then, when some macro
    expanded in configure.ac calls AC_REQUIRE on another macro that is defined
    in one of the local m4 macro dirs specified with AC_CONFIG_MACRO_DIRS, the
    *first* autom4te invocation issued by aclocal, not yet being able to "see"
    the m4 macro definitions in the local m4 dirs, will print spurious
    warnings like:
    
        configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd
        configure.ac:3: MY_FOO is expanded from...
    
    Expose the use of this macro in our testsuite.
    
    Originally reported by Nick Bowler; see point (4) of:
    <http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00000.html>
    
    * lib/m4sugar/m4sugar.m4 (_m4_require_call): Make warnings in the
    -Wsyntax category depend on the witness macro.
    * tests/m4sugar.at (m4@&address@hidden: warning message): New test.
    * doc/autoconf.texi (Prerequisite Macros): Document how aclocal
    can silence AC_REQUIRE (m4_require) warnings.
    
    Signed-off-by: Stefano Lattarini <address@hidden>
    Signed-off-by: Eric Blake <address@hidden>

commit 4f6345bda73fc081a57f4e733512cd946aeeb3fd
Author: Stefano Lattarini <address@hidden>
Date:   Sat Nov 3 13:05:08 2012 +0100

    docs: ACLOCAL_AMFLAGS will become obsolescent in Automake 1.13
    
    See commit 'v1.12.1-165-gcd1a9cc' "aclocal: deprecate ACLOCAL_AMFLAGS,
    trace AC_CONFIG_MACRO_DIR instead" in the Automake git repository.
    
    See also follow-up discussion at:
    <http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html>
    
    * doc/autoconf.texi (@node Input @defmac AC_CONFIG_MACRO_DIRS): Adjust.
    (autoreconf Invocation): Warn about the possible future removal of
    ACLOCAL_AMFLAGS support from Automake.
    
    Signed-off-by: Stefano Lattarini <address@hidden>
    Signed-off-by: Eric Blake <address@hidden>

commit d73770f879e29d11d0f03e092247be27234fc32a
Author: Stefano Lattarini <address@hidden>
Date:   Wed Oct 17 12:15:56 2012 +0200

    AC_CONFIG_MACRO_DIRS: new macro, mostly for aclocal
    
    Similar to AC_CONFIG_MACRO_DIR, but accepts more than one argument.
    This will allow projects to use several m4 macro local dirs.  This is
    especially important for projects that are used as nested subpackages
    of larger projects.
    
    See also:
    <http://lists.gnu.org/archive/html/autoconf/2011-12/msg00037.html>
    <http://lists.gnu.org/archive/html/automake-patches/2012-07/msg00010.html>
    
    * lib/autoconf/general.m4 (AC_CONFIG_MACRO_DIRS): New.  Expands to the
    empty anyway, since it is only meant to be traced by tools like aclocal
    and autoreconf.
    (AC_CONFIG_MACRO_DIR): Updated comments.
    * doc/autoconf.texi (@node "Input"): Document AC_CONFIG_MACRO_DIRS as
    preferred over AC_CONFIG_MACRO_DIR.
    * NEWS: Update.
    
    Suggested-by: Eric Blake <address@hidden>
    Helped-by: Nick Bowler <address@hidden>
    Signed-off-by: Stefano Lattarini <address@hidden>
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 NEWS                    |    8 +++++
 doc/autoconf.texi       |   58 ++++++++++++++++++++++++++++++--------
 lib/autoconf/general.m4 |   40 +++++++++++++++++++++++++-
 lib/autom4te.in         |    2 +
 lib/m4sugar/m4sugar.m4  |    8 ++++-
 tests/m4sugar.at        |   51 +++++++++++++++++++++++++++++++++
 tests/tools.at          |   71 +++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 223 insertions(+), 15 deletions(-)

diff --git a/NEWS b/NEWS
index d3ff4b9..6d5b5e9 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,14 @@ GNU Autoconf NEWS - User visible changes.
 
 ** Macros
 
+- AC_CONFIG_MACRO_DIRS
+  New macro, used to declare multiple directories when looking for
+  local M4 macros.  This macro overcomes some of the shortfalls in the
+  older AC_CONFIG_MACRO_DIR, which could only be used once; although
+  the older macro remains for compatibility with older tools.  The
+  newer macro will be used by the upcoming Automake 1.13 release to
+  eliminate the need to specify ACLOCAL_AMFLAGS in Makefile.am.
+
 - AC_PROG_CC now prefers C11 if available, falling back on C99 and
   then on C89 as before.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index a0c19d1..d1483b8 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -1816,7 +1816,9 @@ If you want @command{autoreconf} to pass flags that are 
not listed here
 on to @command{aclocal}, set @code{ACLOCAL_AMFLAGS} in your @file{Makefile.am}.
 Due to a limitation in the Autoconf implementation these flags currently
 must be set on a single line in @file{Makefile.am}, without any
-backslash-newlines.
+backslash-newlines.  Also, be aware that future Automake releases might
+start flagging @code{ACLOCAL_AMFLAGS} as obsolescent, or even remove
+support for it.
 
 @c ========================================= Initialization and Output Files.
 
@@ -2106,19 +2108,44 @@ files.  For instance it is called by macros like 
@code{AC_PROG_INSTALL}
 @end defmac
 
 Similarly, packages that use @command{aclocal} should declare where
-local macros can be found using @code{AC_CONFIG_MACRO_DIR}.
+local macros can be found using @code{AC_CONFIG_MACRO_DIRS}.
 
address@hidden AC_CONFIG_MACRO_DIR (@var{dir})
address@hidden AC_CONFIG_MACRO_DIRS (@var{dir1} address@hidden ... @var{dirN}])
address@hidden AC_CONFIG_MACRO_DIR (@var{dir})
address@hidden
 @acindex{CONFIG_MACRO_DIR}
-Specify @var{dir} as the location of additional local Autoconf macros.
-This macro is intended for use by future versions of commands like
address@hidden that trace macro calls.  It should be called
-directly from @file{configure.ac} so that tools that install macros for
address@hidden can find the macros' declarations.
-
-Note that if you use @command{aclocal} from Automake to generate
address@hidden, you must also set @code{ACLOCAL_AMFLAGS = -I
address@hidden in your top-level @file{Makefile.am}.  Due to a limitation in
address@hidden
+Specify the given directories as the location of additional local Autoconf
+macros.  These macros are intended for use by commands like
address@hidden or @command{aclocal} that trace macro calls; they should
+be called directly from @file{configure.ac} so that tools that install
+macros for @command{aclocal} can find the macros' declarations.  Tools
+that want to learn which directories have been selected should trace
address@hidden, which will be called once per directory.
+
+AC_CONFIG_MACRO_DIRS is the preferred form, and can be called multiple
+times and with multiple arguments; in such cases, directories in earlier
+calls are expected to be searched before directories in later calls, and
+directories appearing in the same call are expected to be searched in
+the order in which they appear in the call.  For historical reasons, the
+macro AC_CONFIG_MACRO_DIR can also be used once, if it appears first,
+for tools such as older @command{libtool} that weren't prepared to
+handle multiple directories.  For example, a usage like
+
address@hidden
+AC_CONFIG_MACRO_DIR([dir1])
+AC_CONFIG_MACRO_DIRS([dir2])
+AC_CONFIG_MACRO_DIRS([dir3 dir4])
address@hidden smallexample
+
+will cause the trace of AC_CONFIG_MACRO_DIR_TRACE to appear four times,
+and should cause the directories to be searched in this order:
address@hidden dir2 dir3 dir4}.
+
+Note that if you use @command{aclocal} from an Automake release prior to
+1.13 to generate @file{aclocal.m4}, you must also set
address@hidden = -I @var{dir1} [-I @var{dir2} ... -I @var{dirN}]}
+in your top-level @file{Makefile.am}.  Due to a limitation in
 the Autoconf implementation of @command{autoreconf}, these include
 directives currently must be set on a single line in @file{Makefile.am},
 without any backslash-newlines.
@@ -14613,6 +14640,13 @@ put all @code{AC_REQUIRE} calls
 at the beginning of a macro.  You can use @code{dnl} to avoid the empty
 lines they leave.
 
+Autoconf will normally warn if an @code{AC_REQUIRE} call refers to a
+macro that has not been defined.  However, the @command{aclocal} tool
+relies on parsing an incomplete set of input files to trace which macros
+have been required, in order to then pull in additional files that
+provide those macros; for this particular use case, pre-defining the
+macro @code{m4_require_silent_probe} will avoid the warnings.
+
 @node Suggested Ordering
 @subsection Suggested Ordering
 @cindex Macros, ordering
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 51cee30..5bc7f83 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1727,11 +1727,47 @@ AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ## ------------------------ ##
 
 
+# AC_CONFIG_MACRO_DIR_TRACE(DIR)
+# ------------------------------
+# This macro exists solely for tracing - never invoke it directly.
+# It will be called once per directory listed in either form of
+# AC_CONFIG_MACRO_DIR[S].
+m4_define([AC_CONFIG_MACRO_DIR_TRACE],
+[m4_fatal([Do not invoke $0 directly])])
+
+# _AC_CONFIG_MACRO_DIRS_USED
+# --------------------------
+# Internal witness macro, redefined to empty after first directory is traced.
+m4_define([_AC_CONFIG_MACRO_DIRS_USED], [-])
+
+# _AC_CONFIG_MACRO_DIRS(CALLER, DIR)
+# ----------------------------------
+# Internal workhorse macro to ensure a sane calling pattern of CALLER, and
+# eventually trace DIR through the documented public trace point.
+m4_define([_AC_CONFIG_MACRO_DIRS],
+[m4_if([$1], [-AC_CONFIG_MACRO_DIRS], [AC_CONFIG_MACRO_DIR([$2])],
+       [$1], [AC_CONFIG_MACRO_DIR], [m4_fatal([$1 can only be used once])],
+  [m4_define([$0_USED])m4_pushdef([AC_CONFIG_MACRO_DIR_TRACE])]]dnl
+[[AC_CONFIG_MACRO_DIR_TRACE([$2])m4_popdef([AC_CONFIG_MACRO_DIR_TRACE])])])
+
+# AC_CONFIG_MACRO_DIRS(DIR-1 [DIR-2 ... DIR-n])
+# --------------------------------------------
+# Declare directories containing additional macros for aclocal.
+# This macro can be called multiple times, and with multiple arguments.
+# Do not trace this macro; instead trace AC_CONFIG_MACRO_DIR_TRACE.
+# If no directory has been traced yet, then this macro also triggers
+# a trace of AC_CONFIG_MACRO_DIR on the first directory.
+AC_DEFUN([AC_CONFIG_MACRO_DIRS],
+[m4_map_args_w([$1], [_$0(_$0_USED()[$0], ], [)])])
+
 # AC_CONFIG_MACRO_DIR(DIR)
 # ------------------------
 # Declare directory containing additional macros for aclocal.
-AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
-
+# This macro exists for backward compatibility; while tools can trace this,
+# we recommend tracing AC_CONFIG_MACRO_DIR_TRACE instead.  This macro can
+# only be used once, and must not be used after AC_CONFIG_MACRO_DIRS.
+AC_DEFUN([AC_CONFIG_MACRO_DIR],
+[_$0S(_$0S_USED()[$0], [$1])])
 
 
 ## --------------------- ##
diff --git a/lib/autom4te.in b/lib/autom4te.in
index 1eb1709..cd621a2 100644
--- a/lib/autom4te.in
+++ b/lib/autom4te.in
@@ -42,6 +42,7 @@ args: --preselect AC_CONFIG_FILES
 args: --preselect AC_CONFIG_HEADERS
 args: --preselect AC_CONFIG_LIBOBJ_DIR
 args: --preselect AC_CONFIG_LINKS
+args: --preselect AC_CONFIG_MACRO_DIR_TRACE
 args: --preselect AC_FC_FREEFORM
 args: --preselect AC_FC_SRCEXT
 args: --preselect AC_FC_PP_DEFINE
@@ -93,6 +94,7 @@ end-language: "Automake-preselections"
 begin-language: "Autoreconf-preselections"
 args: --preselect AC_CONFIG_AUX_DIR
 args: --preselect AC_CONFIG_HEADERS
+args: --preselect AC_CONFIG_MACRO_DIR_TRACE
 args: --preselect AC_CONFIG_SUBDIRS
 args: --preselect AC_INIT
 args: --preselect AC_PROG_LIBTOOL
diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4
index 12a9ab7..94c4ba8 100644
--- a/lib/m4sugar/m4sugar.m4
+++ b/lib/m4sugar/m4sugar.m4
@@ -2080,13 +2080,19 @@ m4_if([$0], [m4_require], [[m4_defun]], 
[[AC_DEFUN]])['d macro])])]dnl
 #
 # This is called frequently, so minimize the number of macro invocations
 # by avoiding dnl and other overhead on the common path.
+# The use of a witness macro protecting the warning allows aclocal
+# to silence any warnings when probing for what macros are required
+# and must therefore be located, when using the Autoconf-without-aclocal-m4
+# autom4te language.  For more background, see:
+# https://lists.gnu.org/archive/html/automake-patches/2012-11/msg00035.html
 m4_define([_m4_require_call],
 [m4_pushdef([_m4_divert_grow], m4_decr(_m4_divert_grow))]dnl
 [m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl
 [m4_divert_push(_m4_divert_grow, [-])]dnl
 [m4_if([$2], [], [$1], [$2])
 m4_provide_if([$1], [m4_set_remove([_m4_provide], [$1])],
-  [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])]dnl
+  [m4_ifndef([m4_require_silent_probe],
+    [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])])]dnl
 [_m4_divert_raw($3)_m4_undivert(_m4_divert_grow)]dnl
 [m4_divert_pop(_m4_divert_grow)_m4_popdef([_m4_divert_grow],
 [_m4_diverting([$1])], [_m4_diverting])])
diff --git a/tests/m4sugar.at b/tests/m4sugar.at
index 997e2dd..56927b9 100644
--- a/tests/m4sugar.at
+++ b/tests/m4sugar.at
@@ -429,6 +429,57 @@ autom4te: m4 failed with exit status: 1
 AT_CLEANUP
 
 
+## ----------------------------- ##
+## m4_require: warning message.  ##
+## ----------------------------- ##
+
+AT_SETUP([m4@&address@hidden: warning message])
+AT_KEYWORDS([m4@&address@hidden m4@&address@hidden)
+
+# Mirror the job of aclocal on a typical scenario: the user invokes a
+# single macro that comes from one included file, which in turn requires
+# another macro from a second file.  When using the incomplete set of
+# files, we want a warning, unless we are merely learning which additional
+# macros are needed in order to regenerate the list of files to include.
+AT_DATA_M4SUGAR([script.4s],
+[[m4_init
+m4_include([script1.4s])
+foo
+]])
+
+AT_DATA_M4SUGAR([script1.4s],
+[[m4_defun([foo], [m4_require([bar])])
+]])
+
+AT_DATA_M4SUGAR([script2.4s],
+[[m4_defun([bar], [BAR])
+]])
+
+AT_CHECK_M4SUGAR([], [0], [],
+[[script.4s:3: warning: bar is m4@&address@hidden'd but not 
m4@&address@hidden'd
+script1.4s:1: foo is expanded from...
+script.4s:3: the top level
+]])
+
+# Inline expansion of AT_CHECK_M4SUGAR, mirroring how aclocal will
+# inject a definition of our witness macro for a silent run.
+echo 'm4@&address@hidden([m4@&address@hidden)' |
+  AT_CHECK_AUTOM4TE([--language=m4sugar - script.4s -o script],
+[0], [], [])
+
+# Now that we have recomputed the set of include files, things should work.
+AT_DATA_M4SUGAR([script.4s],
+[[m4_init
+m4_include([script1.4s])
+m4_include([script2.4s])
+foo
+]])
+
+AT_CHECK_M4SUGAR([], [0], [], [])
+
+AT_CLEANUP
+
+
 ## ----------------------------------- ##
 ## m4_require: circular dependencies.  ##
 ## ----------------------------------- ##
diff --git a/tests/tools.at b/tests/tools.at
index 4ffe3da..675cdfd 100644
--- a/tests/tools.at
+++ b/tests/tools.at
@@ -358,6 +358,77 @@ AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
 AT_CLEANUP
 
 
+# autoconf --trace: AC_CONFIG_MACRO_DIRS
+# --------------------------------------
+AT_SETUP([autoconf --trace: AC_CONFIG_MACRO_DIRS])
+AT_KEYWORDS([AC_CONFIG_MACRO_DIR AC_CONFIG_MACRO_DIR_TRACE])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_MACRO_DIR([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3 \
+dir4])
+AC_CONFIG_MACRO_DIRS([dir5])
+]])
+
+# Legacy tracing
+AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR], 0,
+[[configure.ac:2:AC_CONFIG_MACRO_DIR:dir1
+]])
+
+# Preferred tracing
+AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR_TRACE], 0,
+[[configure.ac:2:AC_CONFIG_MACRO_DIR_TRACE:dir1
+configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir2
+configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir3
+configure.ac:3:AC_CONFIG_MACRO_DIR_TRACE:dir4
+configure.ac:5:AC_CONFIG_MACRO_DIR_TRACE:dir5
+]])
+
+# Legacy macro can only be used once
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_MACRO_DIR([dir1])
+AC_CONFIG_MACRO_DIR([dir2])
+]])
+AT_CHECK_AUTOCONF([], [1], [], [stderr])
+AT_CHECK([grep 'error: AC_CONFIG_MACRO_DIR can only be used once' stderr],
+[], [ignore])
+
+# Legacy macro must be used first, if present
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIR([dir2])
+]])
+AT_CHECK_AUTOCONF([], [1], [], [stderr])
+AT_CHECK([grep 'error: AC_CONFIG_MACRO_DIR can only be used once' stderr],
+[], [ignore])
+
+# Only use the public macros
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_MACRO_DIR_TRACE([dir1])
+]])
+AT_CHECK_AUTOCONF([], [1], [],
+[[configure.ac:2: error: Do not invoke AC_CONFIG_MACRO_DIR_TRACE directly
+configure.ac:2: the top level
+autom4te: m4 failed with exit status: 1
+]])
+
+# Legacy macro use is not required, but still gets traced
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2])
+]])
+AT_CHECK_AUTOCONF([], [0], [], [])
+AT_CHECK_AUTOCONF([-t AC_CONFIG_MACRO_DIR], [0],
+[[configure.ac:2:AC_CONFIG_MACRO_DIR:dir1
+]])
+
+AT_CLEANUP
+
 
 ## ---------------------------- ##
 ## autoconf: forbidden tokens.  ##


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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