summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2011-12-18 14:32:40 +0700
committerGary V. Vaughan <gary@gnu.org>2012-10-02 21:03:09 +0700
commit78385ffd8af73b927549c3596da67233f2f92f0e (patch)
tree2ca735bc99adde130c619ffeafc1bb3207f198ea /bootstrap
parent7d25536e80b68042a6d999c11a0c5c9dc948f82e (diff)
downloadlibtool-78385ffd8af73b927549c3596da67233f2f92f0e.tar.gz
bootstrap: adopt autoconf echo normalization code.
Dash shipped with Ubutu-11.10 as /bin/sh, among others, still has a crippled echo builtin that mis-handles backslashes. * build-aux/options-parser (bs_echo): Adopt the autoconf echo normalization code to find a suitable replacement for buggy echo commands. Adjust all uses of echo to $bs_echo. * build-aux/extract-trace (func_extract_trace, func_main): Likewise. * bootstrap: To retain some execution speed on platforms with buggy builtin echo, replace most occurrences of `echo' with `$bs_echo' - except where its arguments will obviously never contain backslashes or be overly long. Reported by Reuben Thomas. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap20
1 files changed, 10 insertions, 10 deletions
diff --git a/bootstrap b/bootstrap
index c5a18132..8e36780c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1051,7 +1051,7 @@ func_require_buildreq_automake ()
# ...and AM_INIT_AUTOMAKE is declared...
test -n "$func_extract_trace_result" && {
- automake_version=`echo "$func_extract_trace_result" \
+ automake_version=`$bs_echo "$func_extract_trace_result" \
|$SED 's|[^0-9]*||; s| .*$||'`
test -n "$automake_version" || automake_version=-
@@ -1798,8 +1798,8 @@ func_ifcontains ()
{
$debug_cmd
- # The embedded echo is to squase whitespace before globbing.
- _G_wslist=`echo " "$1" "`
+ # The embedded echo is to squash whitespace before globbing.
+ _G_wslist=`$bs_echo " "$1" "`
_G_member=$2
_G_yes_cmd=$3
_G_no_cmd=${4-":"}
@@ -1833,7 +1833,7 @@ func_append_u ()
{
$debug_cmd
- eval _G_current_value='`echo $'$1'`'
+ eval _G_current_value='`$bs_echo $'$1'`'
_G_delim=`expr "$2" : '\(.\)'`
case $_G_delim$_G_current_value$_G_delim in
@@ -1851,7 +1851,7 @@ func_strpad ()
$debug_cmd
_G_width=`expr "$2" - 1`
- func_strpad_result=`echo "$1" |$SED '
+ func_strpad_result=`$bs_echo "$1" |$SED '
:a
s|^.\{0,'"$_G_width"'\}$|&'"$3"'|
ta
@@ -1868,7 +1868,7 @@ func_strrpad ()
$debug_cmd
_G_width=`expr "$2" - 1`
- func_strrpad_result=`echo "$1" |$SED '
+ func_strrpad_result=`$bs_echo "$1" |$SED '
:a
s|^.\{0,'"$_G_width"'\}$|'"$3"'&|
ta
@@ -1953,7 +1953,7 @@ func_strtable ()
# Strip off the indent, and make a divider with `-' chars, then
# reindent.
- _G_divider=`echo "$func_strrow_result" \
+ _G_divider=`$bs_echo "$func_strrow_result" \
|$SED 's|[^ ]|-|g
:a
s|- |--|g
@@ -2111,8 +2111,8 @@ func_insert_sorted_if_absent ()
func_grep_q "$str" "$file" \
&& func_verbose "inserting \`$str' into \`$file'"
- echo "$str" |sort -u - "$file" |func_cmp_s - "$file" \
- || echo "$str" |sort -u - "$file" -o "$file" \
+ $bs_echo "$str" |sort -u - "$file" |func_cmp_s - "$file" \
+ || $bs_echo "$str" |sort -u - "$file" -o "$file" \
|| func_permissions_error "$file"
done
}
@@ -2177,7 +2177,7 @@ func_get_version ()
# Rather than uncomment the sed script in-situ, strip the comments
# programatically before passing the result to $SED for evaluation.
- sed_get_version=`echo '# extract version within line
+ sed_get_version=`$bs_echo '# extract version within line
s|.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*|\1|
t done