Skip to content

Commit

Permalink
build/flags-if: Fix sed expression on BSD
Browse files Browse the repository at this point in the history
`p` needs a terminating semicolon; otherwise we get

    sed: 1: "\|^///|{s|^/// ||; s|[^ ...": extra characters at the end of p command

Fixes: 3552b79 ("build/flags: Infrastructure to detect compiler flag support")
  • Loading branch information
tavianator committed Aug 28, 2024
1 parent c125f80 commit 34e6081
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/flags-if.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -eu

OLD_FLAGS="$XCC $XCPPFLAGS $XCFLAGS $XLDFLAGS $XLDLIBS"
NEW_FLAGS=$(sed -n '\|^///|{s|^/// ||; s|[^=]*= ||; p}' "$1")
NEW_FLAGS=$(sed -n '\|^///|{s|^/// ||; s|[^=]*= ||; p;}' "$1")
build/cc.sh "$@" $NEW_FLAGS || exit 1

# De-duplicate against the existing flags
Expand Down

0 comments on commit 34e6081

Please sign in to comment.