diff --git a/libs/optimize.lunar b/libs/optimize.lunar index e3355ffe7..ff5cc6879 100644 --- a/libs/optimize.lunar +++ b/libs/optimize.lunar @@ -24,11 +24,13 @@ bad_flags() unset LDFLAGS else for BAD_FLAG in "$@" ; do - # XXX should probably figure whether these variables are - # guaranteed to start and end with spaces or not + CFLAGS=" $CFLAGS " CFLAGS="${CFLAGS// $BAD_FLAG / }" + CXXFLAGS=" $CXXFLAGS " CXXFLAGS="${CXXFLAGS// $BAD_FLAG / }" + CPPFLAGS=" $CPPFLAGS " CPPFLAGS="${CPPFLAGS// $BAD_FLAG / }" + LDFLAGS=" $LDFLAGS " LDFLAGS="${LDFLAGS// $BAD_FLAG / }" done fi