[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make libtool faster v2
From: |
Ralf Wildenhues |
Subject: |
make libtool faster v2 |
Date: |
Tue, 30 Nov 2004 14:54:27 +0100 |
User-agent: |
Mutt/1.4.1i |
I apologize for turning 30% into 40% within one of my last mails.
That's only true after this change. :-)))
And I got two more in store.
OK to apply to HEAD?
* config/general.m4sh: basename sed-subst is anchored and thus
does not need the `g' flag.
(func_quote_for_eval): Return both the possibly double-quoted
backslashified as well as only the backslashified argument.
* config/ltmain.m4sh (func_mode_link): Use both return values,
to save another sed_quote_subst application per cmdline arg.
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 13:59:09 -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,6 +265,10 @@
# 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"`
@@ -276,11 +280,13 @@
# 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="\"$my_arg\""
;;
+ *)
+ func_quote_for_eval_result="$my_arg"
esac
- func_quote_for_eval_result="$my_arg"
+ func_quote_for_eval_unquoted_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 13:59:09 -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.