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 @@ -840,8 +840,9 @@ if test "$PHP_GCOV" = "yes"; then
840
840
841
841
dnl Remove all optimization flags from CFLAGS.
842
842
changequote ( { ,} )
843
- CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
844
- CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
843
+ dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
844
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
845
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
845
846
changequote ( [ ,] )
846
847
847
848
dnl Add the special gcc flags.
@@ -860,8 +861,9 @@ if test "$PHP_DEBUG" = "yes"; then
860
861
PHP_DEBUG=1
861
862
ZEND_DEBUG=yes
862
863
changequote ( { ,} )
863
- CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
864
- CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[ 0-9s] *//g'`
864
+ dnl Discard known '-O...' flags, including just '-O', but do not remove only '-O' in '-Ounknown'
865
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
866
+ CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O\([ 0-9gsz] \|fast\|\)\([ \t ] \|$\)//g'`
865
867
changequote ( [ ,] )
866
868
dnl Add -O0 only if GCC or ICC is used.
867
869
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
116
116
PHP_DEBUG=1
117
117
ZEND_DEBUG=yes
118
118
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'`
121
122
changequote ( [ ,] )
122
123
dnl Add -O0 only if GCC or ICC is used.
123
124
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
You can’t perform that action at this time.
0 commit comments