* lib/autoconf/general.m4 (_AC_LIBOBJ): Move literal check... (AC_LIBOBJ): ...into callers. * lib/autoconf/functions.m4 (_AC_REPLACE_FUNC): Likewise, thus avoiding a second call to AS_LITERAL_IF.
Signed-off-by: Eric Blake <[email protected]> --- I noticed this while working on the previous patch. ChangeLog | 6 ++++++ lib/autoconf/functions.m4 | 2 +- lib/autoconf/general.m4 | 12 ++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27ab27d..a1a451a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-09-21 Eric Blake <[email protected]> + AC_LIBOBJ: optimize internal use + * lib/autoconf/general.m4 (_AC_LIBOBJ): Move literal check... + (AC_LIBOBJ): ...into callers. + * lib/autoconf/functions.m4 (_AC_REPLACE_FUNC): Likewise, thus + avoiding a second call to AS_LITERAL_IF. + AC_REPLACE_FUNCS: restore shell loop for non-literal * lib/autoconf/functions.m4 (AC_REPLACE_FUNCS): Handle non-literals, which was lost in 2010-02-26 optimization. diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index ca02712..70a7ddf 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -123,7 +123,7 @@ m4_define([_AC_FUNCS_EXPANSION], m4_define([_AC_REPLACE_FUNC], [AC_CHECK_FUNC([$1], [_AH_CHECK_FUNC([$1])AC_DEFINE(AS_TR_CPP([HAVE_$1]))], - [AC_LIBOBJ([$1])])]) + [_AC_LIBOBJ([$1])AC_LIBSOURCE([$1.c])])]) # AC_REPLACE_FUNCS(FUNCTION...) # ----------------------------- diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 1410921..59c47ab 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2926,10 +2926,7 @@ AC_DEFUN([AC_LIBSOURCES], # -------------------------------------------- # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. m4_define([_AC_LIBOBJ], -[AS_LITERAL_WORD_IF([$1], - [AC_LIBSOURCE([$1.c])], - [$2])dnl -case " $LIB@&t...@objs " in +[case " $LIB@&t...@objs " in *" $1.$ac_objext "* ) ;; *) AC_SUBST([LIB@&t...@objs], ["$LIB@&t...@objs $1.$ac_objext"]) ;; esac @@ -2940,10 +2937,9 @@ esac # -------------------------- # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. AC_DEFUN([AC_LIBOBJ], -[_AC_LIBOBJ([$1], - [AC_DIAGNOSE(syntax, - [$0($1): you should use literals])])dnl -]) +[_AC_LIBOBJ([$1])]dnl +[AS_LITERAL_WORD_IF([$1], [AC_LIBSOURCE([$1.c])], + [AC_DIAGNOSE([syntax], [$0($1): you should use literals])])]) # _AC_LIBOBJS_NORMALIZE -- 1.7.2.3
