Skip to content

Commit 7113885

Browse files
committed
Clean and sync debugging C flags
These are already better set in the main configure.ac file. Also check is done if optimization flags need to be adjusted. The unused DEBUG_CFLAGS variable has been removed from Zend.m4 macros and configure.ac file. DEBUG_CFLAGS has been once set in the build files similarly to Zend.m4 but was then removed and simplified. Also, this syncs phpize.m4 debug check with configure.ac so that #78788 is fixed there as well. Related to: 0988f69
1 parent dee6a8f commit 7113885

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

Zend/Zend.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ AC_MSG_RESULT($ZEND_DEBUG)
199199
200200
if test "$ZEND_DEBUG" = "yes"; then
201201
AC_DEFINE(ZEND_DEBUG,1,[ ])
202-
echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
203-
if test "$CFLAGS" = "-g -O2"; then
204-
CFLAGS=-g
205-
fi
206202
else
207203
AC_DEFINE(ZEND_DEBUG,0,[ ])
208204
fi
@@ -218,8 +214,6 @@ AX_CHECK_COMPILE_FLAG([-Wformat-truncation], CFLAGS="-Wformat-truncation $CFLAGS
218214
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], CFLAGS="-Wstrict-prototypes $CFLAGS", , [-Werror])
219215
AX_CHECK_COMPILE_FLAG([-fno-common], CFLAGS="-fno-common $CFLAGS", , [-Werror])
220216
221-
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
222-
223217
if test "$ZEND_ZTS" = "yes"; then
224218
AC_DEFINE(ZTS,1,[ ])
225219
CFLAGS="$CFLAGS -DZTS"

configure.ac

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,6 @@ if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
968968
fi
969969
AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DIR])
970970

971-
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
972-
973971
PHP_ARG_ENABLE([sigchild],
974972
[whether to enable PHP's own SIGCHLD handler],
975973
[AS_HELP_STRING([--enable-sigchild],
@@ -1549,7 +1547,6 @@ PHP_SUBST(CPPFLAGS)
15491547
PHP_SUBST(CXX)
15501548
PHP_SUBST(CXXFLAGS)
15511549
PHP_SUBST(CXXFLAGS_CLEAN)
1552-
PHP_SUBST_OLD(DEBUG_CFLAGS)
15531550
PHP_SUBST_OLD(EXTENSION_DIR)
15541551
PHP_SUBST_OLD(EXTRA_LDFLAGS)
15551552
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)

scripts/phpize.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ 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+
CFLAGS=`echo "$CFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
120+
CXXFLAGS=`echo "$CXXFLAGS" | "${SED}" -e 's/-O[0-9s]*//g'`
121121
changequote([,])
122122
dnl Add -O0 only if GCC or ICC is used.
123123
if test "$GCC" = "yes" || test "$ICC" = "yes"; then

0 commit comments

Comments
 (0)