]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Improve suggested test filtering.
authorEric Blake <ebb9@byu.net>
Fri, 17 Oct 2008 22:12:17 +0000 (16:12 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 17 Oct 2008 22:23:21 +0000 (16:23 -0600)
* lib/m4sugar/m4sh.m4 (_AS_DETECT_SUGGESTED_PRUNE): New macro,
extracted from...
(_AS_DETECT_BETTER_SHELL): ...here, to use faster API.  No need to
check for an empty required set.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/m4sugar/m4sh.m4

index 45a0434329dc9b1ffd159e725cd6d70619d8b62c..4e4127d4043455568d5777949d51832e91432873 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-10-17  Eric Blake  <ebb9@byu.net>
 
+       Improve suggested test filtering.
+       * lib/m4sugar/m4sh.m4 (_AS_DETECT_SUGGESTED_PRUNE): New macro,
+       extracted from...
+       (_AS_DETECT_BETTER_SHELL): ...here, to use faster API.  No need to
+       check for an empty required set.
+
        Add m4_set_map.
        * lib/m4sugar/m4sugar.m4 (m4_set_foreach): New macro.
        * tests/m4sugar.at (m4@&t@_set): Enhance test.
index 27ef2621956c4802e72158107378dd48cddb9185..75b8d8477a5d5d97ffa85379f05c3bc6058ca132 100644 (file)
@@ -173,6 +173,14 @@ m4_defun([_AS_DETECT_SUGGESTED],
 ])])
 
 
+# _AS_DETECT_SUGGESTED_PRUNE(TEST)
+# --------------------------------
+# If TEST is also a required test, remove it from the set of suggested tests.
+m4_define([_AS_DETECT_SUGGESTED_PRUNE],
+[m4_set_contains([_AS_DETECT_REQUIRED_BODY], [$1],
+                [m4_set_remove([_AS_DETECT_SUGGESTED_BODY], [$1])])])
+
+
 # _AS_DETECT_BETTER_SHELL
 # -----------------------
 # The real workhorse for detecting a shell with the correct
@@ -190,18 +198,13 @@ m4_defun([_AS_DETECT_SUGGESTED],
 m4_defun([_AS_DETECT_BETTER_SHELL],
 [if test "x$CONFIG_SHELL" = x; then
 dnl Remove any tests from suggested that are also required
-  m4_set_foreach([_AS_DETECT_SUGGESTED_BODY], [AS_snippet],
-                [m4_set_contains([_AS_DETECT_REQUIRED_BODY],
-                                 _m4_defn([AS_snippet]),
-                                 [m4_set_remove([_AS_DETECT_SUGGESTED_BODY],
-                                                _m4_defn([AS_snippet]))])])dnl
-  m4_set_empty([_AS_DETECT_REQUIRED_BODY], [as_have_required=yes],
-    [as_bourne_compatible="AS_ESCAPE(m4_expand([_AS_BOURNE_COMPATIBLE]))"
-    as_required="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_REQUIRED_BODY])))"
-    as_suggested="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_SUGGESTED_BODY])))"
-    AS_IF([_AS_RUN(["$as_required"])],
-         [as_have_required=yes],
-         [as_have_required=no])])
+  m4_set_map([_AS_DETECT_SUGGESTED_BODY], [_AS_DETECT_SUGGESTED_PRUNE])dnl
+  as_bourne_compatible="AS_ESCAPE(m4_expand([_AS_BOURNE_COMPATIBLE]))"
+  as_required="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_REQUIRED_BODY])))"
+  as_suggested="AS_ESCAPE(m4_expand(m4_set_contents([_AS_DETECT_SUGGESTED_BODY])))"
+  AS_IF([_AS_RUN(["$as_required"])],
+       [as_have_required=yes],
+       [as_have_required=no])
   AS_IF([test x$as_have_required = xyes && _AS_RUN(["$as_suggested"])],
     [],
     [as_candidate_shells=