Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,14 @@ AC_DEFUN([PHP_NEW_EXTENSION],[

ifelse($5,,ac_extra=,[ac_extra=$(echo "m4_normalize(m4_expand([$5]))"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g)])

dnl Statically linked extensions share the engine's _tsrm_ls_cache symbol,
dnl so in ZTS builds they can read the TSRMLS cache directly.
ac_extra_static="$ac_extra -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"

if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
dnl ---------------------------------------------- Static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra_static,)
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
if test "$3" != "nocli"; then
EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
Expand All @@ -962,11 +966,11 @@ dnl ---------------------------------------------- CLI static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
case "$PHP_SAPI" in
cgi|embed|phpdbg[)]
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra_static,)
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
;;
*[)]
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,cli)
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra_static,cli)
;;
esac
EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
Expand Down
2 changes: 1 addition & 1 deletion ext/date/config.w32
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// vim:ft=javascript

EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DHAVE_TIMELIB_CONFIG_H=1");
EXTENSION("date", "php_date.c", false, "/Iext/date/lib /DHAVE_TIMELIB_CONFIG_H=1");
PHP_DATE = "yes";
ADD_SOURCES("ext/date/lib", "astro.c timelib.c dow.c parse_date.c parse_posix.c parse_tz.c tm2unixtime.c unixtime2tm.c parse_iso_intervals.c interval.c", "date");

Expand Down
2 changes: 1 addition & 1 deletion ext/date/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AX_CHECK_COMPILE_FLAG([-Wno-implicit-fallthrough],

PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -DHAVE_TIMELIB_CONFIG_H=1"
PHP_TIMELIB_CFLAGS="$PHP_DATE_CFLAGS"
PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib"

AX_CHECK_COMPILE_FLAG([-fwrapv],
[PHP_TIMELIB_CFLAGS="$PHP_TIMELIB_CFLAGS -fwrapv"])
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PHP_NEW_EXTENSION([hash], m4_normalize([
murmur/PMurHash128.c
]),
[no],,
[$PHP_HASH_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[$PHP_HASH_CFLAGS])
PHP_ADD_BUILD_DIR([$ext_builddir/murmur])
AS_VAR_IF([SHA3_DIR],,, [PHP_ADD_BUILD_DIR([$ext_builddir/$SHA3_DIR])])
PHP_INSTALL_HEADERS([ext/hash], m4_normalize([
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (!CHECK_HEADER('KeccakHash.h', 'CFLAGS_HASH', hash_sha3_dir)) {
ERROR('Unable to locate SHA3 headers');
}

ADD_FLAG('CFLAGS_HASH', '/DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
ADD_FLAG('CFLAGS_HASH', '/DKeccakP200_excluded /DKeccakP400_excluded /DKeccakP800_excluded');

ADD_SOURCES('ext/hash/murmur', 'PMurHash.c PMurHash128.c', 'hash');

Expand Down
3 changes: 1 addition & 2 deletions ext/json/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ PHP_NEW_EXTENSION([json], m4_normalize([
json_scanner.c
json.c
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])
PHP_INSTALL_HEADERS([ext/json], m4_normalize([
php_json_parser.h
php_json_scanner.h
Expand Down
2 changes: 1 addition & 1 deletion ext/json/config.w32
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// vim:ft=javascript

EXTENSION('json', 'json.c', false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION('json', 'json.c', false /* never shared */);
PHP_JSON="yes";
ADD_SOURCES(configure_module_dirname, "json_encoder.c json_parser.tab.c json_scanner.c", "json");

Expand Down
2 changes: 1 addition & 1 deletion ext/lexbor/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ PHP_NEW_EXTENSION([lexbor], m4_normalize([
$LEXBOR_DIR/url/url.c
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $PHP_LEXBOR_CFLAGS])
[$PHP_LEXBOR_CFLAGS])

PHP_ADD_BUILD_DIR([
$ext_builddir/
Expand Down
2 changes: 1 addition & 1 deletion ext/lexbor/config.w32
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// vim:ft=javascript

EXTENSION("lexbor", "php_lexbor.c", false, "/I " + configure_module_dirname + " /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("lexbor", "php_lexbor.c", false, "/I " + configure_module_dirname);
PHP_LEXBOR="yes";
ADD_SOURCES("ext/lexbor/lexbor/ports/windows_nt/lexbor/core", "memory.c", "lexbor");
ADD_SOURCES("ext/lexbor/lexbor/core", "array_obj.c array.c avl.c bst.c diyfp.c conv.c dobject.c dtoa.c hash.c mem.c mraw.c plog.c print.c serialize.c shs.c str.c strtod.c", "lexbor");
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ PHP_NEW_EXTENSION([opcache], m4_normalize([
$ZEND_JIT_SRC
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $JIT_CFLAGS],,
[$JIT_CFLAGS],,
[yes])

PHP_ADD_EXTENSION_DEP(opcache, date)
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ZEND_EXTENSION('opcache', "\
zend_persist_calc.c \
zend_file_cache.c \
zend_shared_alloc.c \
shared_alloc_win32.c", false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
shared_alloc_win32.c", false);

ADD_EXTENSION_DEP('opcache', 'date');
ADD_EXTENSION_DEP('opcache', 'hash');
Expand Down
2 changes: 1 addition & 1 deletion ext/pcre/config.w32
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// vim:ft=javascript

EXTENSION("pcre", "php_pcre.c", false /* never shared */,
"-Iext/pcre/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
"-Iext/pcre/pcre2lib");
ADD_SOURCES("ext/pcre/pcre2lib", "pcre2_auto_possess.c pcre2_chartables.c pcre2_compile.c pcre2_config.c pcre2_context.c pcre2_chkdint.c pcre2_dfa_match.c pcre2_error.c pcre2_jit_compile.c pcre2_maketables.c pcre2_match.c pcre2_match_data.c pcre2_newline.c pcre2_ord2utf.c pcre2_pattern_info.c pcre2_serialize.c pcre2_string_utils.c pcre2_study.c pcre2_substitute.c pcre2_substring.c pcre2_tables.c pcre2_ucd.c pcre2_valid_utf.c pcre2_xclass.c pcre2_find_bracket.c pcre2_convert.c pcre2_extuni.c pcre2_script_run.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");

Expand Down
4 changes: 1 addition & 3 deletions ext/pcre/config0.m4
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ if test "$PHP_EXTERNAL_PCRE" != "no"; then

PHP_NEW_EXTENSION([pcre],
[php_pcre.c],
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
else
AC_MSG_CHECKING([for PCRE library to use])
Expand Down Expand Up @@ -101,7 +100,6 @@ else
$PHP_PCRE_CFLAGS
-DHAVE_CONFIG_H
-DHAVE_MEMMOVE
-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
-I@ext_srcdir@/pcre2lib
"])

Expand Down
3 changes: 1 addition & 2 deletions ext/random/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ PHP_NEW_EXTENSION([random], m4_normalize([
randomizer.c
zend_utils.c
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])
PHP_INSTALL_HEADERS([ext/random], m4_normalize([
php_random_csprng.h
php_random_uint128.h
Expand Down
2 changes: 1 addition & 1 deletion ext/random/config.w32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXTENSION("random", "random.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("random", "random.c", false /* never shared */);
PHP_RANDOM="yes";
ADD_SOURCES(configure_module_dirname, "csprng.c engine_mt19937.c engine_pcgoneseq128xslrr64.c engine_xoshiro256starstar.c engine_secure.c engine_user.c gammasection.c randomizer.c zend_utils.c", "random");
PHP_INSTALL_HEADERS("ext/random", "php_random.h php_random_csprng.h php_random_uint128.h random_decl.h");
3 changes: 1 addition & 2 deletions ext/reflection/config.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PHP_NEW_EXTENSION([reflection],
[php_reflection.c],
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])
2 changes: 1 addition & 1 deletion ext/reflection/config.w32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// vim:ft=javascript

EXTENSION("reflection", "php_reflection.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("reflection", "php_reflection.c", false /* never shared */);
PHP_REFLECTION="yes";
3 changes: 1 addition & 2 deletions ext/spl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ PHP_NEW_EXTENSION([spl], m4_normalize([
spl_iterators.c
spl_observer.c
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])
PHP_INSTALL_HEADERS([ext/spl], m4_normalize([
php_spl.h
spl_array.h
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/config.w32
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// vim:ft=javascript

EXTENSION("spl", "php_spl.c spl_functions.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("spl", "php_spl.c spl_functions.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */);
PHP_SPL="yes";
PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h");
3 changes: 1 addition & 2 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ PHP_NEW_EXTENSION([standard], m4_normalize([
versioning.c
$php_ext_standard_sources
]),
[no],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
[no])

PHP_ADD_BUILD_DIR([$ext_builddir/libavifinfo])

Expand Down
3 changes: 1 addition & 2 deletions ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c password.c \
streamsfuncs.c http.c flock_compat.c hrtime.c", false /* never shared */,
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
streamsfuncs.c http.c flock_compat.c hrtime.c", false /* never shared */);
ADD_SOURCES("ext/standard/libavifinfo", "avifinfo.c", "standard");
PHP_STANDARD = "yes";
ADD_MAKEFILE_FRAGMENT();
Expand Down
2 changes: 1 addition & 1 deletion ext/uri/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ else
PHP_EVAL_INCLINE([$LIBURIPARSER_CFLAGS])
fi

PHP_NEW_EXTENSION(uri, [php_uri.c php_uri_common.c uri_parser_rfc3986.c uri_parser_whatwg.c uri_parser_php_parse_url.c $URIPARSER_SOURCES], [no],,[$URI_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
PHP_NEW_EXTENSION(uri, [php_uri.c php_uri_common.c uri_parser_rfc3986.c uri_parser_whatwg.c uri_parser_php_parse_url.c $URIPARSER_SOURCES], [no],,[$URI_CFLAGS])
PHP_ADD_EXTENSION_DEP(uri, lexbor)

if test "$PHP_EXTERNAL_URIPARSER" = "no"; then
Expand Down
2 changes: 1 addition & 1 deletion ext/uri/config.w32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXTENSION("uri", "php_uri.c php_uri_common.c uri_parser_rfc3986.c uri_parser_whatwg.c uri_parser_php_parse_url.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
EXTENSION("uri", "php_uri.c php_uri_common.c uri_parser_rfc3986.c uri_parser_whatwg.c uri_parser_php_parse_url.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include");

AC_DEFINE("URI_ENABLE_ANSI", 1, "Define to 1 for enabling ANSI support of uriparser.")
AC_DEFINE("URI_NO_UNICODE", 1, "Define to 1 for disabling unicode support of uriparser.")
Expand Down
3 changes: 3 additions & 0 deletions win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT);
} else {
STDOUT.WriteLine("Enabling extension " + extname_for_printing);
/* Statically linked extensions share the engine's _tsrm_ls_cache symbol,
* so in ZTS builds they can read the TSRMLS cache directly. */
cflags = "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 " + cflags;
}

MFO.WriteBlankLines(1);
Expand Down
Loading