mapbox / mason

Cross platform package manager for C/C++ apps
BSD 2-Clause "Simplified" License
254 stars 69 forks source link

sed: invalid option -- 'E' #266

Open eek001c opened 8 years ago

eek001c commented 8 years ago

On Sailfish SDK, I get an invalid usage error for sed (GNU sed version 4.1.5) when trying to build mapbox-gl-native.

Based on http://blog.dmitryleskov.com/small-hacks/mysterious-gnu-sed-option-e/ it looks like -r is equivalent to -E

Possible fix for /mapbox/mason/mason.sh:

if test | sed -E 's///g' 2>/dev/null; then
  SED_REGEX_ARG="E"
else
  SED_REGEX_ARG="r"
fi

...

 MASON_CONFIG_INCLUDE_DIRS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n 's/^-(I|isystem) *([^ ]+)/\2/p' | uniq)
 MASON_CONFIG_DEFINITIONS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n 's/^-(D) *([^ ]+)/\2/p')
 MASON_CONFIG_OPTIONS=$(echo -n "${MASON_CONFIG_CFLAGS}" | sed -$SED_REGEX_ARG -n '/^-(D|I|isystem) *([^ ]+)/!p')
springmeyer commented 8 years ago

Thank you for reporting this. /cc @kkaefer who wrote those sed lines and will have the best idea of how to test/land this fix.