File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -846,8 +846,9 @@ if test "$PHP_GCOV" = "yes"; then
846846
847847 dnl Remove all optimization flags from CFLAGS.
848848 changequote ( { ,} )
849- CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
850- CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
849+ dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
850+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
851+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
851852 changequote ( [ ,] )
852853
853854 dnl Add the special gcc flags.
@@ -866,8 +867,9 @@ if test "$PHP_DEBUG" = "yes"; then
866867 PHP_DEBUG=1
867868 ZEND_DEBUG=yes
868869 changequote ( { ,} )
869- CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
870- CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
870+ dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
871+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
872+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
871873 changequote ( [ ,] )
872874 dnl Add -O0 only if GCC or ICC is used.
873875 if test "$GCC" = "yes" || test "$ICC" = "yes"; then
Original file line number Diff line number Diff line change @@ -116,8 +116,9 @@ if test "$PHP_DEBUG" = "yes"; then
116116 PHP_DEBUG=1
117117 ZEND_DEBUG=yes
118118 changequote ( { ,} )
119- CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[ 0-9s] *//g'`
120- CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[ 0-9s] *//g'`
119+ dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
120+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
121+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
121122 changequote ( [ ,] )
122123 dnl Add -O0 only if GCC or ICC is used.
123124 if test "$GCC" = "yes" || test "$ICC" = "yes"; then
You can’t perform that action at this time.
0 commit comments