libtool-patches
[Top][All Lists]
Advanced

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

Re: make libtool faster v2


From: Ralf Wildenhues
Subject: Re: make libtool faster v2
Date: Tue, 30 Nov 2004 15:18:37 +0100
User-agent: Mutt/1.4.1i

* Peter O'Gorman wrote on Tue, Nov 30, 2004 at 03:09:10PM CET:
> Ralf Wildenhues wrote:
> >I apologize for turning 30% into 40% within one of my last mails.
> >
> >That's only true after this change. :-)))
> 
> And presumably only true under certain conditions, but all the same, great 
> work.

Sure.  I still have my one benchmark test.  The next things will be more
all-over.

> >OK to apply to HEAD?
> 
> Yes, looks good to me.

Thanks.  Unfortunately, I hit :wq too early, sorry.  No need to use
three variables in func_quote_for_eval.

So, here's the updated patch (same ChangeLog entry).

Cheers,
Ralf


Index: config/general.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/general.m4sh,v
retrieving revision 1.10
diff -u -r1.10 general.m4sh
--- config/general.m4sh 24 Nov 2004 14:04:15 -0000      1.10
+++ config/general.m4sh 30 Nov 2004 14:22:50 -0000
@@ -52,7 +52,7 @@
        "}
 
 dirname="s,/[[^/]]*$,,"
-basename="s,^.*/,,g"
+basename="s,^.*/,,"
 
 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 # is ksh but when the shell is invoked as "sh" and the current value of
@@ -265,22 +265,26 @@
 
 # func_quote_for_eval arg
 # Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
 func_quote_for_eval ()
 {
-    my_arg=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"`
+    func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e 
"$sed_quote_subst"`
 
-    case $my_arg in
+    case $func_quote_for_eval_unquoted_result in
       # Double-quote args containing shell metacharacters to delay
       # word splitting, command substitution and and variable
       # expansion for a subsequent eval.
       # Many Bourne shells cannot handle close brackets correctly
       # in scan sets, so we specify it separately.
       *[[\@<:@\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \        ]]*|*@:>@*|"")
-        my_arg="\"$my_arg\""
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
         ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     esac
-
-    func_quote_for_eval_result="$my_arg"
 }
 
 
Index: config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
retrieving revision 1.28
diff -u -r1.28 ltmain.m4sh
--- config/ltmain.m4sh  29 Nov 2004 21:18:26 -0000      1.28
+++ config/ltmain.m4sh  30 Nov 2004 14:22:50 -0000
@@ -2226,8 +2226,8 @@
     while test "$#" -gt 0; do
       arg="$1"
       shift
-      qarg=`$ECHO "X$arg" | $Xsed -e "$sed_quote_subst"`
       func_quote_for_eval "$arg"
+      qarg="$func_quote_for_eval_unquoted_result"
       libtool_args="$libtool_args $func_quote_for_eval_result"
 
       # If the previous option needs an argument, assign it.




reply via email to

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