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 <ebb9@byu.net>
This commit is contained in:
Eric Blake 2007-10-04 07:13:50 -06:00
parent e76d30be25
commit 4c7d289c7d
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-10-04 Eric Blake <ebb9@byu.net>
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 <ebb9@byu.net>
Optimize checking for identifiers.

View File

@ -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)