From: Eric Blake Date: Thu, 4 Oct 2007 13:13:50 +0000 (-0600) Subject: Speed up building testsuites. X-Git-Tag: v2.62~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c7d289c7d87cea66ca4dceef5c7d4f19feac91e;p=thirdparty%2Fautoconf.git Speed up building testsuites. * lib/autotest/general.m4 (AT_LINE): Only use regex when file changed since last time. Use simpler regex. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 40d3fb83..b98cf3e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-04 Eric Blake + + Speed up building testsuites. + * lib/autotest/general.m4 (AT_LINE): Only use regex when file + changed since last time. Use simpler regex. + 2007-10-03 Eric Blake Optimize checking for identifiers. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index a0de2853..ac41c14b 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -142,8 +142,19 @@ m4_define([_m4_divert(TEST_SCRIPT)], 403) # is one of the biggest junk in the whole universe wrt regexp, don't # even think about using `?' or `\?'. Bah, `*' will do. # Pleeeeeeeease, Gary, provide us with dirname and ERE! +# +# M4 recompiles the regular expression for every m4_bpatsubst, but __file__ +# rarely changes. Be fast - only compute the dirname when necessary; for +# autoconf alone, this shaves off several seconds in building testsuite. +m4_define([_AT_LINE_file]) +m4_define([_AT_LINE_base]) m4_define([AT_LINE], -[m4_bpatsubst(__file__, [^\(.*/\)*\(.*\)], [[\2]]):__line__]) +[m4_if(m4_defn([_AT_LINE_file]), __file__, [], + [m4_do([m4_define([_AT_LINE_file], __file__)], + [m4_define([_AT_LINE_base], + m4_bpatsubst(/__file__, [/\([^/]*\)$], + [[\1]]))])])dnl +m4_defn([_AT_LINE_base]):__line__]) # _AT_NORMALIZE_TEST_GROUP_NUMBER(SHELL-VAR)