autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clean up m4sh.m4, then optimize AS_PATH_WALK


From: Ralf Wildenhues
Subject: Re: clean up m4sh.m4, then optimize AS_PATH_WALK
Date: Fri, 7 Apr 2006 20:31:08 +0200
User-agent: Mutt/1.5.9i

* Ralf Wildenhues wrote on Tue, Apr 04, 2006 at 10:08:07AM CEST:
> * Stepan Kasal wrote on Tue, Apr 04, 2006 at 12:02:53AM CEST:
> > 
> > So I'd like to back out Eric's patch, including the autotest fix that I
> > added later.
> 
> I think this is ok if you back out Eric's comment change too, please
> apply and check in a regenerated `configure'.

FYI, I have applied the patch below.  (Not listing myself in the
ChangeLog entry because I only edited the ChangeLog entry, not the
patch.)  I hope you don't mind, Stepan.

Cheers,
Ralf

2006-04-07  Stepan Kasal  <address@hidden>

        Revert the patch from 2006-04-01 and only improve
        _AS_DETECT_BETTER_SHELL:

        * lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Do not optimize; do not
        skip nonexistent directories.
        (_AS_DETECT_BETTER_SHELL): The optimization is moved here--try
        only shell candidates which exist.
        (AS_UNAME): No need to give three parameters to _AS_PATH_WALK.
        * lib/autotest/general.m4 (AT_INIT): No need to give three
        parameters to _AS_PATH_WALK.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.205
diff -u -r1.205 general.m4
--- lib/autotest/general.m4     7 Apr 2006 12:33:05 -0000       1.205
+++ lib/autotest/general.m4     7 Apr 2006 17:54:37 -0000
@@ -558,7 +558,7 @@
       at_path=$at_path$at_top_srcdir/$as_dir
     fi
     ;;
-esac], [:])
+esac])
 
 # Now build and simplify PATH.
 #
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.175
diff -u -r1.175 m4sh.m4
--- lib/m4sugar/m4sh.m4 5 Apr 2006 08:01:05 -0000       1.175
+++ lib/m4sugar/m4sh.m4 7 Apr 2006 17:54:37 -0000
@@ -236,7 +238,9 @@
        esac])
 
       for as_shell in $as_candidate_shells $SHELL; do
-        AS_IF([_AS_RUN([_AS_DETECT_REQUIRED_BODY],
+        # Try only shells which exist, to save several forks.
+        AS_IF([test -f $as_shell &&
+               _AS_RUN([_AS_DETECT_REQUIRED_BODY],
                         [($as_shell) 2> /dev/null])],
               [CONFIG_SHELL=$as_shell
               as_have_required=yes
@@ -936,10 +939,9 @@
 ])# _AS_PATH_SEPARATOR_PREPARE
 
 
-# _AS_PATH_WALK([PATH = $PATH], BODY, [NO-OPTIMIZE])
-# --------------------------------------------------
-# Walk through PATH running BODY for each `as_dir'.  Skip nonexistent
-# directories unless NO-OPTIMIZE is specified.
+# _AS_PATH_WALK([PATH = $PATH], BODY)
+# -----------------------------------
+# Walk through PATH running BODY for each `as_dir'.
 #
 # Still very private as its interface looks quite bad.
 #
@@ -958,7 +960,6 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  m4_ifvaln([$3], [], [test -d "$as_dir" || continue])dnl
   $2
 done
 IFS=$as_save_IFS
@@ -1155,7 +1156,7 @@
 
 _ASUNAME
 
-_AS_PATH_WALK([$PATH], [echo "PATH: $as_dir"], [:])
+_AS_PATH_WALK([$PATH], [echo "PATH: $as_dir"])
 }])
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]