# ...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=-
{
$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-":"}
{
$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
$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
$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
# 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
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
}
# 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
$require_configure_ac
$require_gnu_m4
- _G_m4_traces=`echo "--trace=$1" |$SED 's%,% --trace=%g'`
- _G_re_macros=`echo "($1)" |$SED 's%,%|%g'`
+ _G_m4_traces=`$bs_echo "--trace=$1" |$SED 's%,% --trace=%g'`
+ _G_re_macros=`$bs_echo "($1)" |$SED 's%,%|%g'`
_G_macros="$1"; shift
test $# -gt 0 || {
set dummy $configure_ac
# Save the command pipeline results for further use by callers of
# this function.
- func_extract_trace_result=`echo "$_G_mini" \
+ func_extract_trace_result=`$bs_echo "$_G_mini" \
|$M4 -daq --prefix $_G_m4_traces - "$@" 2>&1 1>/dev/null \
|$SED -n -e "$_G_transform"`
}
# Display results.
test -n "$func_extract_trace_result" \
- && echo "$func_extract_trace_result"
+ && $bs_echo "$func_extract_trace_result"
# The End.
exit $EXIT_SUCCESS
nl='
'
+# There are still modern systems that have problems with `echo' mis-
+# handling backslashes, among others, so make sure $bs_echo is set to a
+# command that correctly interprets backslashes.
+# (this code from Autoconf 2.62)
+
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='print -r --'
+ bs_echo_n='print -rn --'
+elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then
+ bs_echo='printf %s\n'
+ bs_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then
+ bs_echo_body='eval /usr/ucb/echo -n "$1$nl"'
+ bs_echo_n='/usr/ucb/echo -n'
+ else
+ bs_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ bs_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$nl"*)
+ expr "X$arg" : "X\\(.*\\)$nl";
+ arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$nl"
+ '
+ export bs_echo_n_body
+ bs_echo_n='sh -c $bs_echo_n_body bs_echo'
+ fi
+ export bs_echo_body
+ bs_echo='sh -c $bs_echo_body bs_echo'
+fi
+
# 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
# the _XPG environment variable is not equal to 1 (one), the special
progpath=$0
# The name of this program.
-progname=`echo "$progpath" |$SED "$basename"`
+progname=`$bs_echo "$progpath" |$SED "$basename"`
## ------------------------- ##
{
$debug_cmd
- eval ${1}_hooks='`echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
+ eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
}
IFS=$nl
for _G_line in $_G_message; do
IFS=$save_IFS
- echo "$progname: $_G_line"
+ $bs_echo "$progname: $_G_line"
done
IFS=$save_IFS
}
IFS=$nl
for _G_line in $_G_message; do
IFS=$save_IFS
- echo "$_G_prefix$tc_bold$_G_line$tc_reset" 1>&2
+ $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" 1>&2
_G_prefix="$progname: "
done
IFS=$save_IFS
{
$debug_cmd
- eval echo \""Usage: $usage"\"
- eval echo \""$fatal_help"\"
+ eval $bs_echo \""Usage: $usage"\"
+ eval $bs_echo \""$fatal_help"\"
func_error ${1+"$@"}
exit $EXIT_FAILURE
}
$debug_cmd
func_usage_message
- echo "$long_help_message"
+ $bs_echo "$long_help_message"
exit 0
}
$debug_cmd
func_usage_message
- echo "Run \`$progname --help |${PAGER-more}' for full usage"
+ $bs_echo "Run \`$progname --help |${PAGER-more}' for full usage"
exit 0
}
{
$debug_cmd
- eval echo \""$usage"\"
+ eval $bs_echo \""$usage"\"
echo
$SED -n 's|^# ||;/^Written by/{x;p;x;};h' < "$progpath"
echo
- eval echo \""$usage_message"\"
+ eval $bs_echo \""$usage_message"\"
}