aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJan Beich <[email protected]>2017-03-12 03:19:14 +0000
committerEric Engestrom <[email protected]>2017-03-14 17:07:04 +0000
commitfe56c745b8cb562445b318bacbb4267f07e43584 (patch)
treec594e5da1999d4df26897ec0004a2e6da96cb238 /configure.ac
parentaed27141452ab894ba62358e6a88fd681eff09c7 (diff)
Convert sed(1) syntax to be compatible with FreeBSD and OpenBSD
BSD regex library doesn't support extended RE escapes (e.g. \+) and shorthand character classes (e.g. \s, \S) and SVR4-style word delimiters[1] (on DragonFly and NetBSD). Both GNU and BSD sed support -E and -r to enable extended RE but OS X still lacks -r. [1] https://www.illumos.org/issues/516 Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Eric Engestrom <[email protected]> (GNU sed)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 10 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index a99684bd434..1d81fcceaee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -908,18 +908,18 @@ llvm_add_target() {
# $1 is the llvm-config command with arguments.
strip_unwanted_llvm_flags() {
# Use \> (marks the end of the word)
- echo " `$1`" | sed \
- -e 's/\s\+-m\S*//g' \
- -e 's/\s\+-DNDEBUG\>//g' \
- -e 's/\s\+-D_GNU_SOURCE\>//g' \
- -e 's/\s\+-pedantic\>//g' \
- -e 's/\s\+-W\S*//g' \
- -e 's/\s\+-O\S*//g' \
- -e 's/\s\+-g\S*//g' \
+ echo " `$1`" | sed -E \
+ -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \
+ -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
+ -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
+ -e 's/[[[:space:]]]+-pedantic\>//g' \
+ -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \
+ -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \
+ -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \
-e 's/-fno-rtti\>/-Fno-rtti/g' \
- -e 's/\s\+-f\S*//g' \
+ -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \
-e 's/-Fno-rtti\>/-fno-rtti/g' \
- -e 's/^ //'
+ -e 's/^[[[:space:]]]//'
}
llvm_set_environment_variables() {