Yang Yujie <yangyu...@loongson.cn> writes: > @@ -5171,25 +5213,21 @@ case "${target}" in > # ${with_multilib_list} should not contain whitespaces, > # consecutive commas or slashes. > if echo "${with_multilib_list}" \ > - | grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > > /dev/null; then > + | grep -E -e "[[:space:]]" -e '[,/][,/]' -e '[,/]$' -e '^[,/]' > > /dev/null 2>&1; then > echo "Invalid argument to --with-multilib-list." 1>&2 > exit 1 > fi > > - unset component idx elem_abi_base elem_abi_ext elem_tmp > + unset component elem_abi_base elem_abi_ext elem_tmp parse_state > all_abis > for elem in $(echo "${with_multilib_list}" | tr ',' ' '); do > - idx=0 > - while true; do > - idx=$((idx + 1)) > - component=$(echo "${elem}" | awk -F'/' '{print > $'"${idx}"'}') > - > - case ${idx} in > - 1) > - # Component 1: Base ABI type > + unset elem_abi_base elem_abi_ext > + parse_state="abi-base" > + > + for component in $(echo "${elem}" | tr '/' ' '); do > + if test x${parse_state} = x"abi-base"; then > + # Base ABI type > case ${component} in > - lp64d) elem_tmp="ABI_BASE_LP64D,";; > - lp64f) elem_tmp="ABI_BASE_LP64F,";; > - lp64s) elem_tmp="ABI_BASE_LP64S,";; > + lp64d | lp64f | lp64s) > elem_tmp="ABI_BASE_$(tr a-z A-Z <<< ${component}),";;
"<<<" isn't portable shell. Could you try with: echo ${component} | tr ... instead? As it stands, this causes a bootstrap failure with non-bash shells such as dash, even on non-Loongson targets. (Part of me wishes that we'd just standardise on bash. But since that isn't the policy, I sometimes use dash to pick up my own lapses.) Thanks, Richard