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-180-


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.69-180-g0e2eece
Date: Wed, 21 Dec 2016 14:33:05 +0000 (UTC)

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=0e2eecedb12dd472c9a008748be6edd6ea68fa0e

The branch, master has been updated
       via  0e2eecedb12dd472c9a008748be6edd6ea68fa0e (commit)
       via  c54beb85aa855ce2c817d4f7738748841bf6ad30 (commit)
       via  0848232967ea70448d3767f22ff2f7d359e67580 (commit)
       via  d068c0a5ac8ef095fe39b17fefe576b17fc3ab4a (commit)
       via  76183791a41bf8777cbce94e1b899529dc98e124 (commit)
       via  73770787510fc18ec3dde2ccf3281977ea6b750b (commit)
       via  501ccbbfdb43561537f377a2ac66cf89f975b1b1 (commit)
       via  4523f7c32b052e805c4081fa6a55c7414d94d791 (commit)
      from  eea950a012e8725da53e0444a43d508d0b645d8f (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 0e2eecedb12dd472c9a008748be6edd6ea68fa0e
Author: Paolo Bonzini <address@hidden>
Date:   Mon Oct 31 18:08:07 2016 +0100

    autoconf: prefer an unrolled loop for trivial AC_CHECK_HEADERS
    
    An unrolled loop avoids the cost of spawning sed in AS_TR_SH and
    AS_TR_CPP.  Prefer it if there is nothing in the second and third
    argument of AC_CHECK_HEADERS and the first argument is a literal.
    
    * lib/autoconf/headers.m4 (AC_CHECK_HEADERS): Unroll loop if safe.
    (_AC_CHECK_HEADERS): Move basic implementation here.
    (AC_CHECK_INCLUDES_DEFAULT): Remove unnecessary arguments after the first.
    
    Signed-off-by: Paolo Bonzini <address@hidden>
    Message-Id: <address@hidden>
    [eblake: perform AC_CHECK_HEADERS_ONCE changes separately, use
    dnl to reduce generated blank lines]
    Signed-off-by: Eric Blake <address@hidden>
    
    Signed-off-by: Eric Blake <address@hidden>

commit c54beb85aa855ce2c817d4f7738748841bf6ad30
Author: Paolo Bonzini <address@hidden>
Date:   Thu Nov 3 20:08:28 2016 -0500

    autoconf: prefer an unrolled loop for trivial AC_CHECK_FUNCS
    
    An unrolled loop avoids the cost of spawning sed in AS_TR_SH and
    AS_TR_CPP.  Prefer it if there is nothing in the second and third
    argument of AC_CHECK_FUNCS and the first argument is a literal.
    
    * lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Unroll loop if safe.
    (_AC_CHECK_FUNCS): Move basic implementation here.
    
    Signed-off-by: Paolo Bonzini <address@hidden>
    Message-Id: <address@hidden>
    [eblake: perform AC_CHECK_FUNCS_ONCE changes separately, use
    dnl to reduce generated blank lines]
    Signed-off-by: Eric Blake <address@hidden>

commit 0848232967ea70448d3767f22ff2f7d359e67580
Author: Eric Blake <address@hidden>
Date:   Wed Dec 21 08:32:43 2016 -0600

    AC_CHECK_HEADERS_ONCE: hoist cache name computation to m4 time
    
    Rather than perform a sed script on each element of the
    $ac_header_c_list to compute the corresponding cache name, we
    can inline enough of AC_CHECK_HEADER to bypass the normal
    polymorphic code, and instead directly use the literal
    header and cache name that we are consuming from the list.
    
    The resulting configure script is roughly unchanged in size,
    but performs slightly faster.
    
    * lib/autoconf/headers.m4 (AC_CHECK_HEADER_COMPILE): Split out shell
    function registration...
    (_AC_CHECK_HEADER_COMPILE_FN): ...to here.
    (_AC_HEADERS_EXPANSION): Use it to inline enough of AC_CHECK_HEADER
    to operate on a literal rather than a shell variable, for fewer sed
    calls.
    
    Signed-off-by: Eric Blake <address@hidden>

commit d068c0a5ac8ef095fe39b17fefe576b17fc3ab4a
Author: Eric Blake <address@hidden>
Date:   Thu Nov 3 20:03:06 2016 -0500

    AC_CHECK_FUNCS_ONCE: hoist cache name computation to m4 time
    
    Rather than perform a sed script on each element of the
    $ac_func_c_list to compute the corresponding cache name, we
    can inline enough of AC_CHECK_FUNC to bypass the normal
    polymorphic code, and instead directly use the literal
    function name that we are consuming from the list.
    
    While at it, we can use echo instead of cat to append to
    confdefs.h, for another process shaved.
    
    The resulting configure script is roughly unchanged in size,
    but performs slightly faster.
    
    * lib/autoconf/functions.m4 (AC_CHECK_FUNC): Split out shell
    function registration...
    (_AC_CHECK_FUNC_FN): ...to here.
    (_AC_FUNCS_EXPANSION): Use it to inline enough of AC_CHECK_FUNC to
    operate on a literal rather than a shell variable, for fewer sed
    calls.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 76183791a41bf8777cbce94e1b899529dc98e124
Author: Eric Blake <address@hidden>
Date:   Wed Dec 21 08:32:39 2016 -0600

    AC_CHECK_HEADERS_ONCE: hoist CPP name computation to m4 time
    
    Rather than perform a sed script on each element of the
    $ac_header_c_list to compute the corresponding CPP name, we can
    make the list store a series of triples of header names, shell-safe
    names, and CPP names all computed at m4 time.
    
    The resulting configure script is slightly larger based on
    how many headers are checked once, but also performs
    slightly faster.
    
    There is still a sed call in AC_CHECK_HEADER for computing the
    cache variable name; that will be dealt with next.  That patch
    will also be the one that takes advantage of the shell-safe name.
    
    * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_ONCE): Track the shell
    and CPP name in the list...
    (_AC_HEADERS_EXPANSION): ...and rewrite the list walk to parse off
    triples of arguments, for fewer sed calls.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 73770787510fc18ec3dde2ccf3281977ea6b750b
Author: Eric Blake <address@hidden>
Date:   Thu Nov 3 20:03:06 2016 -0500

    AC_CHECK_FUNCS_ONCE: hoist CPP name computation to m4 time
    
    Rather than perform a sed script on each element of the
    $ac_func_c_list to compute the corresponding CPP name, we can
    make the list store a series of pairs of function names and
    CPP names all computed at m4 time.
    
    The resulting configure script is slightly larger based on
    how many function names are checked once, but also performs
    slightly faster.
    
    There is still a sed call in AC_CHECK_FUNC for computing the
    cache variable name; that will be dealt with next.
    
    * lib/autoconf/functions.m4 (_AC_CHECK_FUNC_ONCE): Track the CPP
    name in the list...
    (_AC_FUNCS_EXPANSION): ...and rewrite the list walk to parse off
    pairs of arguments, for fewer sed calls.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 501ccbbfdb43561537f377a2ac66cf89f975b1b1
Author: Eric Blake <address@hidden>
Date:   Wed Dec 21 08:32:29 2016 -0600

    AC_CHECK_HEADERS_ONCE: honor current AC_LANG
    
    Previously, AC_CHECK_HEADERS_ONCE collected a list of header names
    to check, but ran the checks using the AC_LANG that was active
    during the first encounter of the macro.  In practice, this is
    usually the C language, and we haven't had actual reports of projects
    attempting to use AC_CHECK_HEADERS_ONCE across multiple languages,
    rather this was discovered by code inspection.
    
    With this patch, the code now tracks a separate per-language list of
    names to check.  Note, however, that it is only possible to check for
    a given header name in one language; attempting to add a name again
    under AC_CHECK_HEADERS_ONCE while a different language is active is a
    no-op (this still makes sense because the side-effect of defining
    the CPP macro HAVE_HEADER does not include a language prefix).
    
    * lib/autoconf/headers.m4 (_AC_CHECK_HEADER_ONCE)
    (_AC_HEADERS_EXPANSION):
    * NEWS: Mention it.
    
    Signed-off-by: Eric Blake <address@hidden>

commit 4523f7c32b052e805c4081fa6a55c7414d94d791
Author: Eric Blake <address@hidden>
Date:   Thu Nov 3 10:28:07 2016 -0500

    AC_CHECK_FUNCS_ONCE: honor current AC_LANG
    
    Previously, AC_CHECK_FUNCS_ONCE collected a list of function names
    to check, but ran the checks using the AC_LANG that was active
    during the first encounter of the macro.  In practice, this is
    usually the C language, and we haven't had actual reports of projects
    attempting to use AC_CHECK_FUNCS_ONCE across multiple languages,
    rather this was discovered by code inspection.
    
    With this patch, the code now tracks a separate per-language list of
    names to check.  Note, however, that it is only possible to check for
    a given function name in one language; attempting to add a name again
    under AC_CHECK_FUNCS_ONCE while a different language is active is a
    no-op (this still makes sense because the side-effect of defining
    the CPP macro HAVE_FUNC does not include a language prefix).
    
    * lib/autoconf/functions.m4 (_AC_CHECK_FUNC_ONCE)
    (_AC_FUNCS_EXPANSION):
    * NEWS: Mention it.
    
    Signed-off-by: Eric Blake <address@hidden>

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

Summary of changes:
 NEWS                      |    4 +++
 lib/autoconf/functions.m4 |   60 +++++++++++++++++++++++++++------------
 lib/autoconf/headers.m4   |   68 ++++++++++++++++++++++++++++++++-------------
 3 files changed, 95 insertions(+), 37 deletions(-)

diff --git a/NEWS b/NEWS
index a4c53dd..b82c1e3 100644
--- a/NEWS
+++ b/NEWS
@@ -111,6 +111,10 @@ GNU Autoconf NEWS - User visible changes.
   useful effect is to trigger those checks, with this macro.  It is
   unlikely to be useful otherwise.
 
+- The AC_CHECK_FUNCS_ONCE and AC_CHECK_HEADERS_ONCE macros now support
+  use with multiple languages, rather than forcing all checks in the
+  language used by the first encounter of the macro.
+
 ** Man pages for config.guess and config.sub are no longer provided.
 They were moved to the master source tree for config.guess and config.sub.
 
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 66abe29..a227cd4 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -51,17 +51,20 @@ m4_define([_AC_CHECK_FUNC_BODY],
 ])# _AC_CHECK_FUNC_BODY
 
 
+m4_define([_AC_CHECK_FUNC_FN],
+[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_func],
+  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_func],
+    [LINENO FUNC VAR],
+    [Tests whether FUNC exists, setting the cache variable VAR accordingly])],
+  [_AC_CHECK_FUNC_BODY])])
+
 # AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 # -----------------------------------------------------------------
 # Check whether FUNCTION links in the current language.  Set the cache
 # variable ac_cv_func_FUNCTION accordingly, then execute
 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
 AC_DEFUN([AC_CHECK_FUNC],
-[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_func],
-  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_func],
-    [LINENO FUNC VAR],
-    [Tests whether FUNC exists, setting the cache variable VAR accordingly])],
-  [_$0_BODY])]dnl
+[_AC_CHECK_FUNC_FN()]dnl
 [AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])]dnl
 [ac_fn_[]_AC_LANG_ABBREV[]_check_func "$LINENO" "$1" "ac_var"
 AS_VAR_IF([ac_var], [yes], [$2], [$3])
@@ -85,20 +88,26 @@ m4_define([_AH_CHECK_FUNC],
 # `break' to stop the search.
 AC_DEFUN([AC_CHECK_FUNCS],
 [m4_map_args_w([$1], [_AH_CHECK_FUNC(], [)])]dnl
-[AS_FOR([AC_func], [ac_func], [$1],
-[AC_CHECK_FUNC(AC_func,
-              [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_func)) $2],
-              [$3])dnl])
+[m4_if([$2$3]AS_LITERAL_IF([$1], [[yes]], [[no]]), [yes],
+       [m4_map_args_w([$1], [_$0(], [)])],
+       [AS_FOR([AC_func], [ac_func], [$1], [_$0(AC_func, [$2], [$3])])])dnl
 ])# AC_CHECK_FUNCS
 
+m4_define([_AC_CHECK_FUNCS],
+[AC_CHECK_FUNC([$1],
+              [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1)) $2],
+              [$3])dnl
+])
+
 
 # _AC_CHECK_FUNC_ONCE(FUNCTION)
 # -----------------------------
 # Check for a single FUNCTION once.
 m4_define([_AC_CHECK_FUNC_ONCE],
-[_AH_CHECK_FUNC([$1])AC_DEFUN([_AC_Func_$1],
-  [m4_divert_text([INIT_PREPARE], [AS_VAR_APPEND([ac_func_list], [" $1"])])
-_AC_FUNCS_EXPANSION])AC_REQUIRE([_AC_Func_$1])])
+[_AH_CHECK_FUNC([$1])AC_DEFUN([_AC_Func_$1], [m4_divert_text([INIT_PREPARE],
+  [AS_VAR_APPEND([ac_func_]]_AC_LANG_ABBREV[[_list],
+  [" $1 ]AS_TR_CPP([HAVE_$1])["])])]dnl
+[_AC_FUNCS_EXPANSION(_AC_LANG_ABBREV)])AC_REQUIRE([_AC_Func_$1])])
 
 # AC_CHECK_FUNCS_ONCE(FUNCTION...)
 # --------------------------------
@@ -107,12 +116,29 @@ _AC_FUNCS_EXPANSION])AC_REQUIRE([_AC_Func_$1])])
 AC_DEFUN([AC_CHECK_FUNCS_ONCE],
 [m4_map_args_w([$1], [_AC_CHECK_FUNC_ONCE(], [)])])
 
+# _AC_FUNCS_EXPANSION(LANG)
+# -------------------------
+# One-shot code per language LANG for checking all functions registered by
+# AC_CHECK_FUNCS_ONCE while that language was active.  We have to inline
+# portions of AC_CHECK_FUNC, because although we operate on shell
+# variables, we know they represent literals at that point in time,
+# where we don't want to trigger normal AS_VAR_PUSHDEF shell code.
 m4_define([_AC_FUNCS_EXPANSION],
-[
-  m4_divert_text([DEFAULTS], [ac_func_list=])
-  AC_CHECK_FUNCS([$ac_func_list])
-  m4_define([_AC_FUNCS_EXPANSION], [])
-])
+[m4_ifndef([$0($1)], [m4_define([$0($1)])m4_divert_text([DEFAULTS],
+[ac_func_$1_list=])ac_func=
+for ac_item in $ac_func_$1_list
+do
+  if test $ac_func; then
+    _AC_CHECK_FUNC_FN()ac_fn_$1_check_func "$LINENO" ]dnl
+[$ac_func ac_cv_func_$ac_func
+    if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then
+      echo "[#]define $ac_item 1" >> confdefs.h
+    fi
+    ac_func=
+  else
+    ac_func=$ac_item
+  fi
+done])])
 
 
 # _AC_REPLACE_FUNC(FUNCTION)
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 72262c1..8e2dbb0 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -73,18 +73,21 @@ m4_define([_AC_CHECK_HEADER_COMPILE_BODY],
 ])# _AC_CHECK_HEADER_COMPILE_BODY
 
 
+m4_define([_AC_CHECK_HEADER_COMPILE_FN],
+[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_header_compile],
+  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_header_compile],
+    [LINENO HEADER VAR INCLUDES],
+    [Tests whether HEADER exists and can be compiled using the include files
+     in INCLUDES, setting the cache variable VAR accordingly.])],
+  [_AC_CHECK_HEADER_COMPILE_BODY])])
+
 # _AC_CHECK_HEADER_COMPILE(HEADER-FILE,
 #                     [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
 #                     [INCLUDES = DEFAULT-INCLUDES])
 # --------------------------------------------------------------
 # Check the compiler accepts HEADER-FILE.  The INCLUDES are defaulted.
 AC_DEFUN([_AC_CHECK_HEADER_COMPILE],
-[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_header_compile],
-  [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_header_compile],
-    [LINENO HEADER VAR INCLUDES],
-    [Tests whether HEADER exists and can be compiled using the include files
-     in INCLUDES, setting the cache variable VAR accordingly.])],
-  [$0_BODY])]dnl
+[_AC_CHECK_HEADER_COMPILE_FN()]dnl
 [AS_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])]dnl
 [ac_fn_[]_AC_LANG_ABBREV[]_check_header_compile ]dnl
 ["$LINENO" "$1" "ac_Header" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])"
@@ -182,22 +185,28 @@ m4_define([AH_CHECK_HEADERS],
 # header.  Either ACTION may include `break' to stop the search.
 AC_DEFUN([AC_CHECK_HEADERS],
 [m4_map_args_w([$1], [_AH_CHECK_HEADER(], [)])]dnl
-[AS_FOR([AC_header], [ac_header], [$1],
-[AC_CHECK_HEADER(AC_header,
-                [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_header)) $2],
-                [$3], [$4])dnl])
+[m4_if([$2$3]AS_LITERAL_IF([$1], [[yes]], [[no]]), [yes],
+       [m4_map_args_w([$1], [_$0(], [, [], [], [$4])])],
+       [AS_FOR([AC_header], [ac_header], [$1], [_$0(AC_header, [$2], [$3], 
[$4])])])dnl
 ])# AC_CHECK_HEADERS
 
+m4_define([_AC_CHECK_HEADERS],
+[AC_CHECK_HEADER([$1],
+                [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]$1)) $2],
+                [$3], [$4])dnl
+])
+
 
 # _AC_CHECK_HEADER_ONCE(HEADER-FILE)
 # ----------------------------------
 # Check for a single HEADER-FILE once.
 m4_define([_AC_CHECK_HEADER_ONCE],
 [_AH_CHECK_HEADER([$1])AC_DEFUN([_AC_Header_]m4_translit([[$1]],
-    [./-], [___]),
-  [m4_divert_text([INIT_PREPARE], [AS_VAR_APPEND([ac_header_list], [" $1"])])
-_AC_HEADERS_EXPANSION])AC_REQUIRE([_AC_Header_]m4_translit([[$1]],
-    [./-], [___]))])
+    [./-], [___]), [m4_divert_text([INIT_PREPARE],
+  [AS_VAR_APPEND([ac_header_]]_AC_LANG_ABBREV[[_list],
+  [" $1 ]AS_TR_SH([$1]) AS_TR_CPP([HAVE_$1])["])])]dnl
+[_AC_HEADERS_EXPANSION(_AC_LANG_ABBREV)])AC_REQUIRE(
+  [_AC_Header_]m4_translit([[$1]], [./-], [___]))])
 
 
 # AC_CHECK_HEADERS_ONCE(HEADER-FILE...)
@@ -213,11 +222,31 @@ AC_DEFUN([AC_CHECK_HEADERS_ONCE],
 AC_DEFUN([_AC_CHECK_HEADERS_ONCE],
   [m4_map_args_w([$1], [_AC_CHECK_HEADER_ONCE(], [)])])
 
+# _AC_HEADERS_EXPANSION(LANG)
+# ---------------------------
+# One-shot code per language LANG for checking all headers registered by
+# AC_CHECK_HEADERS_ONCE while that language was active.  We have to inline
+# portions of AC_CHECK_HEADER_COMPILE, because although we operate on shell
+# variables, we know they represent literals at that point in time,
+# where we don't want to trigger normal AS_VAR_PUSHDEF shell code.
 m4_define([_AC_HEADERS_EXPANSION],
-  [m4_divert_text([DEFAULTS], [ac_header_list=])]dnl
-  [AC_CHECK_HEADERS([$ac_header_list], [], [], [$ac_includes_default])]dnl
-  [m4_define([_AC_HEADERS_EXPANSION], [])])
-
+[m4_ifndef([$0($1)], [m4_define([$0($1)])m4_divert_text([DEFAULTS],
+[ac_header_$1_list=])ac_header= ac_cache=
+for ac_item in $ac_header_$1_list
+do
+  if test $ac_cache; then
+    _AC_CHECK_HEADER_COMPILE_FN()ac_fn_$1_check_header_compile "$LINENO" ]dnl
+[$ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+    if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+      printf "%s\n" "[#]define $ac_item 1" >> confdefs.h
+    fi
+    ac_header= ac_cache=
+  elif test $ac_header; then
+    ac_cache=$ac_item
+  else
+    ac_header=$ac_item
+  fi
+done])])
 
 
 
@@ -261,8 +290,7 @@ ac_includes_default="\
 #endif"
 ])]dnl
 [_AC_CHECK_HEADERS_ONCE(
-  [sys/types.h sys/stat.h strings.h inttypes.h stdint.h unistd.h],
-  [], [], [$ac_includes_default])]dnl
+  [sys/types.h sys/stat.h strings.h inttypes.h stdint.h unistd.h])]dnl
 dnl For backward compatibility, provide unconditional AC_DEFINEs of
 dnl HAVE_STDLIB_H, HAVE_STRING_H, and STDC_HEADERS.
 [AC_DEFINE([HAVE_STDLIB_H], [1],


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

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