]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Speed up building testsuites.
authorEric Blake <ebb9@byu.net>
Thu, 4 Oct 2007 13:13:50 +0000 (07:13 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 4 Oct 2007 13:13:50 +0000 (07:13 -0600)
* 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>
ChangeLog
lib/autotest/general.m4

index 40d3fb834d25c724c81de9174ab3c33eb93d3e4b..b98cf3e527348bfed7ee4ebb43a43e1fcd33c065 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index a0de28530cb1e821c28ff7be12bf6e833c3d56dd..ac41c14b232d4fbb9736423cab8bd938e9a7d4f9 100644 (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)