mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Autotools: Refactor debug checks (#15215)
- Added help text for ZEND_DEBUG preprocessor macro - CS synced
This commit is contained in:
parent
97eb89afd6
commit
18a99a4d33
3 changed files with 20 additions and 30 deletions
11
Zend/Zend.m4
11
Zend/Zend.m4
|
@ -168,16 +168,15 @@ AC_MSG_RESULT([$ZEND_ZTS])
|
|||
|
||||
AC_MSG_CHECKING([whether to enable Zend debugging])
|
||||
AC_MSG_RESULT([$ZEND_DEBUG])
|
||||
|
||||
if test "$ZEND_DEBUG" = "yes"; then
|
||||
AC_DEFINE(ZEND_DEBUG,1,[ ])
|
||||
AH_TEMPLATE([ZEND_DEBUG],
|
||||
[Define to 1 if debugging is enabled, and to 0 if not.])
|
||||
AS_VAR_IF([ZEND_DEBUG], [yes], [
|
||||
AC_DEFINE([ZEND_DEBUG], [1])
|
||||
echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
|
||||
if test "$CFLAGS" = "-g -O2"; then
|
||||
CFLAGS=-g
|
||||
fi
|
||||
else
|
||||
AC_DEFINE(ZEND_DEBUG,0,[ ])
|
||||
fi
|
||||
], [AC_DEFINE([ZEND_DEBUG], [0])])
|
||||
|
||||
test -n "$GCC" && CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare $CFLAGS"
|
||||
dnl Check if compiler supports -Wno-clobbered (only GCC)
|
||||
|
|
21
configure.ac
21
configure.ac
|
@ -802,7 +802,7 @@ PHP_ARG_ENABLE([debug],
|
|||
[no],
|
||||
[no])
|
||||
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
AS_VAR_IF([PHP_DEBUG], [yes], [
|
||||
PHP_DEBUG=1
|
||||
ZEND_DEBUG=yes
|
||||
changequote({,})
|
||||
|
@ -824,10 +824,10 @@ if test "$PHP_DEBUG" = "yes"; then
|
|||
CXXFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
], [
|
||||
PHP_DEBUG=0
|
||||
ZEND_DEBUG=no
|
||||
fi
|
||||
])
|
||||
|
||||
PHP_ARG_ENABLE([debug-assertions],
|
||||
[whether to enable debug assertions in release mode],
|
||||
|
@ -836,10 +836,10 @@ PHP_ARG_ENABLE([debug-assertions],
|
|||
[no],
|
||||
[no])
|
||||
|
||||
if test "$PHP_DEBUG_ASSERTIONS" = "yes"; then
|
||||
AS_VAR_IF([PHP_DEBUG_ASSERTIONS], [yes], [
|
||||
PHP_DEBUG=1
|
||||
ZEND_DEBUG=yes
|
||||
fi
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE([zts],
|
||||
[AS_HELP_STRING([--enable-zts],
|
||||
|
@ -1367,11 +1367,7 @@ ZEND_MODULE_API_NO=`$EGREP '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modul
|
|||
if test -z "$EXTENSION_DIR"; then
|
||||
extbasedir=$ZEND_MODULE_API_NO
|
||||
if test "$oldstyleextdir" = "yes"; then
|
||||
if test "$PHP_DEBUG" = "1"; then
|
||||
part1=debug
|
||||
else
|
||||
part1=no-debug
|
||||
fi
|
||||
AS_VAR_IF([PHP_DEBUG], [1], [part1=debug], [part1=no-debug])
|
||||
if test "$enable_zts" = "yes"; then
|
||||
part2=zts
|
||||
else
|
||||
|
@ -1383,10 +1379,7 @@ if test -z "$EXTENSION_DIR"; then
|
|||
if test "$enable_zts" = "yes"; then
|
||||
extbasedir=$extbasedir-zts
|
||||
fi
|
||||
|
||||
if test "$PHP_DEBUG" = "1"; then
|
||||
extbasedir=$extbasedir-debug
|
||||
fi
|
||||
AS_VAR_IF([PHP_DEBUG], [1], [extbasedir=$extbasedir-debug])
|
||||
EXTENSION_DIR=$libdir/$extbasedir
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -77,19 +77,17 @@ AC_MSG_CHECKING([for PHP installed headers prefix])
|
|||
AC_MSG_RESULT([$phpincludedir])
|
||||
|
||||
dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS.
|
||||
AC_MSG_CHECKING([if debug is enabled])
|
||||
AC_MSG_CHECKING([if debugging is enabled])
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="-I$phpincludedir"
|
||||
AC_EGREP_CPP(php_debug_is_enabled,[
|
||||
AC_EGREP_CPP([php_debug_is_enabled], [
|
||||
#include <main/php_config.h>
|
||||
#if ZEND_DEBUG
|
||||
php_debug_is_enabled
|
||||
#endif
|
||||
],[
|
||||
PHP_DEBUG=yes
|
||||
],[
|
||||
PHP_DEBUG=no
|
||||
])
|
||||
],
|
||||
[PHP_DEBUG=yes],
|
||||
[PHP_DEBUG=no])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
AC_MSG_RESULT([$PHP_DEBUG])
|
||||
|
||||
|
@ -110,7 +108,7 @@ CPPFLAGS=$old_CPPFLAGS
|
|||
AC_MSG_RESULT([$PHP_THREAD_SAFETY])
|
||||
|
||||
dnl Discard optimization flags when debugging is enabled.
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
AS_VAR_IF([PHP_DEBUG], [yes], [
|
||||
PHP_DEBUG=1
|
||||
ZEND_DEBUG=yes
|
||||
changequote({,})
|
||||
|
@ -132,10 +130,10 @@ if test "$PHP_DEBUG" = "yes"; then
|
|||
CXXFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
], [
|
||||
PHP_DEBUG=0
|
||||
ZEND_DEBUG=no
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Always shared.
|
||||
PHP_BUILD_SHARED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue