summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2021-09-29 13:03:29 -0700
committerTianon Gravi <admwiggin@gmail.com>2021-09-29 13:03:29 -0700
commit47ddfe108a8818677571833bf5313bdde3f9c8bc (patch)
tree9c2b3d6194960e8a16769d30cfa038f7f8f30801
parent1b0a9a039a1d078c8e4f25f3eaa765259b256ace (diff)
downloaderlang-47ddfe108a8818677571833bf5313bdde3f9c8bc.tar.gz
Replace "expr --" usage with sed
Ideally, this would use POSIX shell parameter expansions (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02), but as noted in https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Shell-Substitutions.html these are not supported properly on many platforms where Erlang still is.
-rwxr-xr-xconfigure10
-rw-r--r--configure.src10
2 files changed, 10 insertions, 10 deletions
diff --git a/configure b/configure
index de7045e377..19b4b01ec8 100755
--- a/configure
+++ b/configure
@@ -55,7 +55,7 @@ skip_applications=
while test $# != 0; do
case $1 in
-srcdir=* | --srcdir=*)
- user_srcdir=`expr -- "$1" : '[^=]*=\(.*\)'`
+ user_srcdir=`echo "$1" | sed 's/^[^=]*=//'`
if test "$ERL_TOP" != ""; then
echo "WARNING: Overriding ERL_TOP with $user_srcdir" 1>&2
echo "" 1>&2
@@ -95,7 +95,7 @@ while test $# != 0; do
echo "" 1>&2
;;
-cache-file=* | --cache-file=* )
- static_cache=`expr -- "$1" : '[^=]*=\(.*\)'`
+ static_cache=`echo "$1" | sed 's/^[^=]*=//'`
if test "$static_cache" != "/dev/null"; then
echo "WARNING: Only using config cache file '$static_cache' as static cache" 1>&2
echo "" 1>&2
@@ -140,8 +140,8 @@ while test $# != 0; do
pie_ldflags="-no-pie"
;;
CFLAGS=* | LDFLAGS=*)
- flgs_var=`expr -- "$1" : '\([^=]*\)=.*'`
- flgs_val=`expr -- "$1" : '[^=]*=\(.*\)'`
+ flgs_var=`echo "$1" | sed 's/=.*$//'`
+ flgs_val=`echo "$1" | sed 's/^[^=]*=//'`
eval $flgs_var=\$flgs_val
;;
--help=r* | -help=r*)
@@ -151,7 +151,7 @@ while test $# != 0; do
*)
case $1 in
--without-*)
- skip_app=`expr -- "$1" : '--without-\(.*\)'`
+ skip_app=`echo "$1" | sed 's/^--without-//'`
if [ "$skip_app" = "stdlib" ] ||
[ "$skip_app" = "kernel" ] ||
[ "$skip_app" = "sasl" ] ||
diff --git a/configure.src b/configure.src
index 03bc4b3947..f0afd5c6ee 100644
--- a/configure.src
+++ b/configure.src
@@ -55,7 +55,7 @@ skip_applications=
while test $# != 0; do
case $1 in
-srcdir=* | --srcdir=*)
- user_srcdir=`expr -- "$1" : '[^=]*=\(.*\)'`
+ user_srcdir=`echo "$1" | sed 's/^[^=]*=//'`
if test "$ERL_TOP" != ""; then
echo "WARNING: Overriding ERL_TOP with $user_srcdir" 1>&2
echo "" 1>&2
@@ -95,7 +95,7 @@ while test $# != 0; do
echo "" 1>&2
;;
-cache-file=* | --cache-file=* )
- static_cache=`expr -- "$1" : '[^=]*=\(.*\)'`
+ static_cache=`echo "$1" | sed 's/^[^=]*=//'`
if test "$static_cache" != "/dev/null"; then
echo "WARNING: Only using config cache file '$static_cache' as static cache" 1>&2
echo "" 1>&2
@@ -140,8 +140,8 @@ while test $# != 0; do
pie_ldflags="-no-pie"
;;
CFLAGS=* | LDFLAGS=*)
- flgs_var=`expr -- "$1" : '\([^=]*\)=.*'`
- flgs_val=`expr -- "$1" : '[^=]*=\(.*\)'`
+ flgs_var=`echo "$1" | sed 's/=.*$//'`
+ flgs_val=`echo "$1" | sed 's/^[^=]*=//'`
eval $flgs_var=\$flgs_val
;;
--help=r* | -help=r*)
@@ -151,7 +151,7 @@ while test $# != 0; do
*)
case $1 in
--without-*)
- skip_app=`expr -- "$1" : '--without-\(.*\)'`
+ skip_app=`echo "$1" | sed 's/^--without-//'`
if [ "$skip_app" = "stdlib" ] ||
[ "$skip_app" = "kernel" ] ||
[ "$skip_app" = "sasl" ] ||