patch: configure: nonstandard use of `expr'
At least FreeBSD's expr(1) doesnt understand the syntax now used in configure:
Index: qemu/configure
@@ -157,7 +157,7 @@
fi
for opt do
- optarg=expr "$opt" : '[^=]*=\(.*\)'
+ optarg=echo "$opt" |sed 's/^[^=]*=//'
case "$opt" in
--help|-h) show_help=yes
;;
Review line 163
Quoted 13 lines · Juergen Lock
At least FreeBSD's expr(1) doesnt understand the syntax now used in configure:
Index: qemu/configure
(quoted diff) +1
-1@@ -157,7 +157,7 @@ fi for opt do - optarg=`expr "$opt" : '[^=]*=\(.*\)'` + optarg=`echo "$opt" |sed 's/^[^=]*=//'` case "$opt" in --help|-h) show_help=yes ;;
The GNU Autoconf manual, and its code, recommends something like this (note the "x" prefix):
optarg=expr "x$opt" : 'x[^=]*=\(.*\)'
Your echo version suffers from non-portable results when opt matches "-n*", "-e*", "-E*", or something with a backslash in.
-- Jamie
In article <[email protected]> you write:
Quoted 18 lines
Review line 163
Quoted 13 lines · Juergen Lock
At least FreeBSD's expr(1) doesnt understand the syntax now used in configure:
Index: qemu/configure
(quoted diff) +1
-1@@ -157,7 +157,7 @@ fi for opt do - optarg=`expr "$opt" : '[^=]*=\(.*\)'` + optarg=`echo "$opt" |sed 's/^[^=]*=//'` case "$opt" in --help|-h) show_help=yes ;;The GNU Autoconf manual, and its code, recommends something like this (note the "x" prefix):
Quoted 4 lines
optarg=
expr "x$opt" : 'x[^=]*=\(.*\)'Your echo version suffers from non-portable results when opt matches "-n*", "-e*", "-E*", or something with a backslash in.
Oh, indeed. Better version:
Index: qemu/configure
@@ -157,7 +157,7 @@
fi
for opt do
- optarg=expr "$opt" : '[^=]*=\(.*\)'
+ optarg=echo "x$opt" |sed 's/^[^=]*=//'
case "$opt" in
--help|-h) show_help=yes
;;