From: Eric Blake Date: Tue, 21 Sep 2010 23:09:09 +0000 (-0600) Subject: AC_LIBOBJ: optimize internal use X-Git-Tag: v2.68~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6117b5a630834020b77722acd7e76580e113b728;p=thirdparty%2Fautoconf.git 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 27ab27d5..a1a451a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-09-21 Eric Blake + 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 ca027124..70a7ddf3 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 14109213..59c47abb 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