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

"Eric Blake" <[email protected]> Fri, 26 Feb 2010 23:22:48 +0000
Newsgroups gmane.comp.sysutils.autoconf.cvs
Message-ID <[email protected]>
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=b4d3a51a96f83c2f5f6eefc34ec87a2eddfb5f45

The branch, master has been updated
       via  b4d3a51a96f83c2f5f6eefc34ec87a2eddfb5f45 (commit)
      from  534a64aef36c3d8e08febfdd2a625f122de3764b (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 b4d3a51a96f83c2f5f6eefc34ec87a2eddfb5f45
Author: Eric Blake <[email protected]>
Date:   Wed Sep 9 08:32:46 2009 -0600

    Optimize AC_REPLACE_FUNCS.
    
    * lib/autoconf/functions.m4 (_AC_REPLACE_FUNC): New helper macro.
    (AC_REPLACE_FUNCS): Use it to reduce forks when checking for
    replacements, by using literal rather than shell variable.
    
    Signed-off-by: Eric Blake <[email protected]>

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

Summary of changes:
 ChangeLog                 |    5 +++++
 lib/autoconf/functions.m4 |   17 ++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bb24886..98e0b31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-02-26  Eric Blake  <[email protected]>
 
+	Optimize AC_REPLACE_FUNCS.
+	* lib/autoconf/functions.m4 (_AC_REPLACE_FUNC): New helper macro.
+	(AC_REPLACE_FUNCS): Use it to reduce forks when checking for
+	replacements, by using literal rather than shell variable.
+
 	Document how to safely override CFLAGS default.
 	* doc/autoconf.texi (C Compiler) <AC_PROG_CC>: Document a way to
 	change the default CFLAGS.
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 24dcf86..aae7220 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -116,12 +116,23 @@ m4_define([_AC_FUNCS_EXPANSION],
 ])
 
 
+# _AC_REPLACE_FUNC(FUNCTION)
+# --------------------------
+# If FUNCTION exists, define HAVE_FUNCTION; else add FUNCTION.c
+# to the list of library objects.  FUNCTION must be literal.
+m4_define([_AC_REPLACE_FUNC],
+[AC_CHECK_FUNC([$1],
+  [_AH_CHECK_FUNC([$1])AC_DEFINE(AS_TR_CPP([HAVE_$1]))],
+  [AC_LIBOBJ([$1])])])
+
 # AC_REPLACE_FUNCS(FUNCTION...)
 # -----------------------------
+# For each FUNCTION in the whitespace separated list, perform the
+# equivalent of AC_CHECK_FUNC, then call AC_LIBOBJ if the function
+# was not found.
 AC_DEFUN([AC_REPLACE_FUNCS],
-[m4_map_args_w([$1], [AC_LIBSOURCE(], [.c)])]dnl
-[AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ($ac_func)])
-])
+[m4_map_args_w([$1], [_AC_REPLACE_FUNC(], [)
+])])
 
 
 # AC_TRY_LINK_FUNC(FUNC, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)


hooks/post-receive
-- 
GNU Autoconf source repository