configure.sh: Remove bashisms.

* configure.sh: Remove bashisms.  Fixes running with Gash 0.1.
This commit is contained in:
Jan Nieuwenhuizen 2019-09-16 21:12:56 +02:00
parent 9405075e09
commit 5de5853c76
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 15 additions and 19 deletions

View File

@ -25,8 +25,8 @@ srcdir=${srcdir-$(dirname $0)}
. ${srcdest}build-aux/trace.sh . ${srcdest}build-aux/trace.sh
# parse --with-system-libc # parse --with-system-libc
cmdline=$(echo " $@") cmdline=$(echo "$@")
p=${cmdline/ --with-system-libc/} p=$(echo $cmdline | sed s,--with-system-libc,,)
if test "$p" != "$cmdline"; then if test "$p" != "$cmdline"; then
mes_libc=${mes_libc-system} mes_libc=${mes_libc-system}
else else
@ -35,7 +35,7 @@ fi
# parse --with-courage # parse --with-courage
cmdline=$(echo " $@") cmdline=$(echo " $@")
p=${cmdline/ --with-courage/} p=$(echo $cmdline | sed s,--with-courage,,)
if test "$p" != "$cmdline"; then if test "$p" != "$cmdline"; then
courageous=true courageous=true
else else
@ -43,44 +43,40 @@ else
fi fi
# parse --prefix=PREFIX # parse --prefix=PREFIX
p=${cmdline/ --prefix=/ -prefix=} p=$(echo $cmdline | sed s,.*--prefix=,-prefix=,)
if test "$p" != "$cmdline"; then if test "$p" != "$cmdline"; then
p=${p##* -prefix=} p=$(echo $p | sed s,.*-prefix=,,)
p=${p% *} p=$(echo $p | sed 's, .*,,')
p=${p% -*}
prefix=${p-/usr/local} prefix=${p-/usr/local}
else else
prefix=${prefix-/usr/local} prefix=${prefix-/usr/local}
fi fi
# parse --build=BUILD # parse --build=BUILD
p=${cmdline/ --build=/ -build=} p=$(echo $cmdline | sed s,.*--build=,-build=,)
if [ "$p" != "$cmdline" ]; then if [ "$p" != "$cmdline" ]; then
p=${p##* -build=} p=$(echo $p | sed s,.*-build=,,)
p=${p% *} p=$(echo $p | sed 's, .*,,')
p=${p% -*}
build=${p-$build} build=${p-$build}
else else
build=$build build=$build
fi fi
# parse --host=HOST # parse --host=HOST
p=${cmdline/ --host=/ -host=} p=$(echo $cmdline | sed s,.*--host=,-host=,)
if [ "$p" != "$cmdline" ]; then if [ "$p" != "$cmdline" ]; then
p=${p##* -host=} p=$(echo $p | sed s,.*-host=,,)
p=${p% *} p=$(echo $p | sed 's, .*,,')
p=${p% -*}
host=${p-$build} host=${p-$build}
elif test -n "$build"; then elif test -n "$build"; then
host=${host-$build} host=${host-$build}
fi fi
# parse --program-prefix= # parse --program-prefix=
p=${cmdline/ --program-prefix=/ -program-prefix=} p=$(echo $cmdline | sed s,.*--program-prefix=,-program-prefix=,)
if test "$p" != "$cmdline"; then if test "$p" != "$cmdline"; then
p=${p##* -program-prefix=} p=$(echo $p | sed s,.*-program-prefix=,,)
p=${p% *} p=$(echo $p | sed 's, .*,,')
p=${p% -*}
program_prefix=$p program_prefix=$p
fi fi