@@ -59,7 +59,7 @@ AC_MSG_RESULT([$EXTENSION_DIR])
59
59
AC_MSG_CHECKING ( [ for PHP installed headers prefix] )
60
60
AC_MSG_RESULT ( [ $phpincludedir] )
61
61
62
- dnl Check for PHP_DEBUG / ZEND_DEBUG
62
+ dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS
63
63
AC_MSG_CHECKING ( [ if debug is enabled] )
64
64
old_CPPFLAGS=$CPPFLAGS
65
65
CPPFLAGS="-I$phpincludedir"
@@ -73,9 +73,37 @@ php_debug_is_enabled
73
73
] ,[
74
74
PHP_DEBUG=no
75
75
] )
76
+ AC_MSG_RESULT ( [ $PHP_DEBUG] )
77
+
78
+ AC_MSG_CHECKING ( [ if zts is enabled] )
79
+ old_CPPFLAGS=$CPPFLAGS
80
+ CPPFLAGS="-I$phpincludedir"
81
+ AC_EGREP_CPP ( php_zts_is_enabled ,[
82
+ #include <main/php_config.h>
83
+ #if ZTS
84
+ php_zts_is_enabled
85
+ #endif
86
+ ] ,[
87
+ PHP_THREAD_SAFETY=yes
88
+ ] ,[
89
+ PHP_THREAD_SAFETY=no
90
+ ] )
76
91
CPPFLAGS=$old_CPPFLAGS
77
92
AC_MSG_RESULT ( [ $PHP_DEBUG] )
78
93
94
+ dnl Support for building and testing Zend extensions
95
+ if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then
96
+ ZEND_EXT_TYPE="zend_extension_debug_ts"
97
+ elif test "$PHP_DEBUG" = "yes"; then
98
+ ZEND_EXT_TYPE="zend_extension_debug"
99
+ elif test "$PHP_THREAD_SAFETY" = "yes; then
100
+ ZEND_EXT_TYPE="zend_extension_ts"
101
+ else
102
+ ZEND_EXT_TYPE="zend_extension"
103
+ fi
104
+ PHP_SUBST(ZEND_EXT_TYPE)
105
+
106
+ dnl Discard optimization flags when debugging is enabled
79
107
if test "$PHP_DEBUG" = "yes"; then
80
108
PHP_DEBUG=1
81
109
ZEND_DEBUG=yes
@@ -115,7 +143,7 @@ AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
115
143
] )
116
144
AC_PROG_LIBTOOL
117
145
118
- all_targets='$(PHP_MODULES)'
146
+ all_targets='$(PHP_MODULES) $(PHP_ZEND_EX) '
119
147
install_targets="install-modules install-headers"
120
148
phplibdir="`pwd`/modules"
121
149
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
@@ -126,6 +154,8 @@ test "$prefix" = "NONE" && prefix="/usr/local"
126
154
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
127
155
128
156
PHP_SUBST(PHP_MODULES)
157
+ PHP_SUBST(PHP_ZEND_EX)
158
+
129
159
PHP_SUBST(all_targets)
130
160
PHP_SUBST(install_targets)
131
161
0 commit comments