diff --git a/acinclude.m4 b/acinclude.m4 index 49490a3047f..63f6b761e82 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -16,8 +16,7 @@ dnl dnl PHP_BUILD_THREAD_SAFE dnl AC_DEFUN(PHP_BUILD_THREAD_SAFE,[ - enable_thread_safety=yes - passthru="$passthru --enable-thread-safety" + PHP_THREAD_SAFETY=yes ]) dnl diff --git a/configure.in b/configure.in index 4a8067210fc..154c8454c7f 100644 --- a/configure.in +++ b/configure.in @@ -571,7 +571,15 @@ AC_ARG_ENABLE(dmalloc, ]) AC_MSG_RESULT($DMALLOC_RESULT) -dnl ## This is the default server API. +AC_MSG_CHECKING(whether to enable experimental ZTS mode) +AC_ARG_ENABLE(experimental-zts, +[ --enable-experimental-zts This will most likely break your build.],[ + PHP_EXPERIMENTAL_ZTS=$enableval +],[ + PHP_EXPERIMENTAL_ZTS=no +]) +AC_MSG_RESULT($PHP_EXPERIMENTAL_ZTS) + PHP_SAPI=cgi PHP_BUILD_PROGRAM dnl paths to the targets relative to the build directory @@ -591,19 +599,23 @@ esyscmd(./scripts/config-stubs ext) PHP_OUTPUT(sapi/$PHP_SAPI/Makefile) -RESULT=no AC_MSG_CHECKING(whether to enable versioning) AC_ARG_ENABLE(versioning, [ --enable-versioning Export only required symbols. - See INSTALL for more information], -[ - test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym" - if test "$enableval" = "yes" && test -f "$PHP_SYM_FILE"; then - EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE" - RESULT="yes" - fi + See INSTALL for more information],[ + PHP_VERSIONING=$enableval +],[ + PHP_VERSIONING=no ]) -AC_MSG_RESULT($RESULT) +AC_MSG_RESULT($PHP_VERSIONING) + +if test "$PHP_VERSIONING" = "yes"; then + test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym" + if test -f "$PHP_SYM_FILE"; then + EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE" + fi +fi + divert(4) @@ -639,22 +651,26 @@ PHP_REGEX dnl If we are using gcc and the user has not specified CFLAGS, add -O2. test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2" -AC_MSG_CHECKING(whether to build PHP thread-safe) + + CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" export CPPFLAGS -if test "$enable_thread_safety" = "yes"; then +if test "$PHP_THREAD_SAFETY" = "yes" || test "$PHP_EXPERIMENTAL_ZTS" = "yes"; then + passthru="$passthru --enable-thread-safety" TSRM_LIB='TSRM/libtsrm.la' TSRM_DIR=TSRM AC_DEFINE(ZTS) CPPFLAGS="$CPPFLAGS -D_REENTRANT" INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM -I\$(top_srcdir)/TSRM" -else - enable_thread_safety=no + PHP_THREAD_SAFETY=yes +else + PHP_THREAD_SAFETY=no fi -AC_MSG_RESULT($enable_thread_safety) +AC_MSG_CHECKING(whether to build PHP thread-safe) +AC_MSG_RESULT($PHP_THREAD_SAFETY) AC_SUBST(TSRM_DIR) AC_SUBST(TSRM_LIB)