File tree 2 files changed +9
-6
lines changed 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
846
846
847
847
dnl Remove all optimization flags from CFLAGS.
848
848
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'`
851
852
changequote ( [ ,] )
852
853
853
854
dnl Add the special gcc flags.
@@ -866,8 +867,9 @@ if test "$PHP_DEBUG" = "yes"; then
866
867
PHP_DEBUG=1
867
868
ZEND_DEBUG=yes
868
869
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'`
871
873
changequote ( [ ,] )
872
874
dnl Add -O0 only if GCC or ICC is used.
873
875
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