2007-10-10 Eric Blake <ebb9@byu.net>
+ Another AC_DEFINE speedup.
+ * lib/autoconf/general.m4 (AC_DEFINE_TRACE): Move parameter
+ elision...
+ (_AC_DEFINE_Q): ...here, and only do it once.
+ * lib/autoconf/functions.m4 (AC_CHECK_FUNCS): Avoid overquoting.
+ * lib/m4sugar/m4sh.m4 (AS_LITERAL_IF): Fix m4_defn overquoting
+ introduced 2007-10-05.
+
Whitespace cleanup.
* lib/autoconf/general.m4: Use consistent indentation.
* configure: Regenerate.
# This file is part of Autoconf. -*- Autoconf -*-
# Checking for functions.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
for ac_func in $1
do
AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$ac_func])]) $2],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$ac_func])) $2],
[$3])dnl
done
])
# AC_DEFINE_TRACE(CPP-SYMBOL)
# ---------------------------
# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
-# out non literal symbols.
-#
-# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so only
-# use the regex when necessary.
+# out non literal symbols. CPP-SYMBOL must not include any parameters.
m4_define([AC_DEFINE_TRACE],
-[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL(
- m4_if(m4_index([$1], [(]), [-1], [[$1]],
- [m4_bpatsubst([[$1]], [(.*)])]))])])
+[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])])
# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
# _AC_DEFINE_Q(QUOTE, VARIABLE, [VALUE], [DESCRIPTION])
# -----------------------------------------------------
+# Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}.
+#
+# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so only
+# use the regex when necessary. AC_name is defined with over-quotation,
+# so that we can avoid m4_defn.
m4_define([_AC_DEFINE_Q],
-[AC_DEFINE_TRACE([$2])dnl
-m4_ifval([$4], [AH_TEMPLATE(m4_bpatsubst([[$2]], [(.*)]), [$4])])dnl
+[m4_pushdef([AC_name], m4_if(m4_index([$2], [(]), [-1], [[[$2]]],
+ [m4_bpatsubst([[[$2]]], [(.*)])]))dnl
+AC_DEFINE_TRACE(AC_name)dnl
+m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])])dnl
+m4_popdef([AC_name])dnl
cat >>confdefs.h <<$1_ACEOF
[@%:@define] $2 m4_if($#, 2, 1, [$3])
_ACEOF
m4_define([AS_LITERAL_IF],
[m4_cond([m4_eval(m4_index(m4_quote($1), [@S|@]) == -1)], [0], [$3],
[m4_index(m4_translit(m4_quote($1),
- [[]`,#]]m4_dquote(m4_defn([m4_cr_symbols2]))[,
+ [[]`,#]]]dnl
+m4_dquote(m4_dquote(m4_defn([m4_cr_symbols2])))[[,
[$$$]),
[$])], [-1], [$2],
[$3])])