From ed8c8e7a7ea33bd706118c6704eaff7a4f93b086 Mon Sep 17 00:00:00 2001 From: Nikolai Kostrigin Date: Thu, 25 Jul 2019 11:46:10 +0300 Subject: [PATCH] Fix too agressive regexp for removing optimization flags Adding a space before the flag prevents other flags corruption: ./config.status:LTCFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2' ./config.status:S[CFLAGS]='-pipe -frecordcc-switches -Wall -O2' --- configure.ac | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 39a8d9a..14b6a61 100644 --- a/configure.ac +++ b/configure.ac @@ -59,13 +59,13 @@ AC_ARG_ENABLE([debug], if test "x$enable_debug" = xyes; then dnl Remove all optimization flags from CFLAGS changequote({,}) - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` - CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-O[0-9s]*//g'` - CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` + CFLAGS=`echo "$CFLAGS" | $SED -e 's/[[:space:]]-O[0-9s]*//g'` + CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/[[:space:]]-O[0-9s]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/[[:space:]]-O[0-9s]*//g'` - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-g[0-9]*//g'` - CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-g[0-9]*//g'` - CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-g[0-9]*//g'` + CFLAGS=`echo "$CFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` + CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` changequote([,]) CFLAGS="$CFLAGS -g -O0" @@ -75,9 +75,9 @@ if test "x$enable_debug" = xyes; then CXXFLAGS="$CXXFLAGS -g -O0" else changequote({,}) - CFLAGS=`echo "$CFLAGS" | $SED -e 's/-g[0-9]*//g'` - CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-g[0-9]*//g'` - CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-g[0-9]*//g'` + CFLAGS=`echo "$CFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` + CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` + CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/[[:space:]]-g[0-9]*//g'` changequote([,]) fi