From 7bfa847d01b9b4a6f6163f271d36ea5a24b907d3 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Thu, 6 Aug 2015 22:08:11 +0200 Subject: [PATCH] configure: don't depend on GNU sed Closes #3169. --- configure | 5 ++++- configure.ac | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0a8bae6c4..d0f221b73 100755 --- a/configure +++ b/configure @@ -5657,8 +5657,11 @@ extract() { return 1 fi + # BSD sed needs an actual newline character in the substitute command + new_line=' +' # Convert " -" to "\n" if not between quotes and remove possible leading white spaces - string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//') + string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//') SAVEIFS=$IFS IFS=$(printf "\n\b") for i in $string; do diff --git a/configure.ac b/configure.ac index 893d4fee6..f0ecfe3ad 100644 --- a/configure.ac +++ b/configure.ac @@ -222,8 +222,11 @@ extract() { return 1 fi + # BSD sed needs an actual newline character in the substitute command + new_line=' +' # Convert " -" to "\n" if not between quotes and remove possible leading white spaces - string=$(echo " $*" | $SED -e 's: -:\n:g' -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//') + string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//') SAVEIFS=$IFS IFS=$(printf "\n\b") for i in $string; do