From: Kalle Sommer Nielsen Date: Mon, 4 Dec 2017 16:39:08 +0000 (+0100) Subject: Introduce ZEND_EXTENSION() to the Windows build system X-Git-Tag: php-7.3.0alpha1~886 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=525ab4198ee2b25fe309cf5dc2180f64ea14ae57;p=php Introduce ZEND_EXTENSION() to the Windows build system Zend Extensions should now be declared in their config.w32 with a ZEND_EXTENSION() call instead of EXTENSION(), the parameters sent is identical. For a cross version compatible config.w32, the following will do: if (typeof(ZEND_EXTENSION) == 'undefined') { EXTENSION(...); } else { ZEND_EXTENSION(...); } --- diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32 index 8a33fd906c..a54569485c 100644 --- a/ext/opcache/config.w32 +++ b/ext/opcache/config.w32 @@ -10,7 +10,7 @@ if (PHP_OPCACHE != "no") { AC_DEFINE('HAVE_OPCACHE_FILE_CACHE', 1, 'Define to enable file based caching (experimental)'); } - EXTENSION('opcache', "\ + ZEND_EXTENSION('opcache', "\ ZendAccelerator.c \ zend_accelerator_blacklist.c \ zend_accelerator_debug.c \ diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 7fb28d058c..d49f530bd8 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1373,6 +1373,13 @@ function ADD_EXTENSION_DEP(extname, dependson, optional) var static_pgo_enabled = false; +function ZEND_EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) +{ + EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir); + + extensions_enabled[extensions_enabled.length - 1][2] = true; +} + function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) { var objs = null; @@ -1509,7 +1516,8 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) } ADD_FLAG("CFLAGS_" + EXT, cflags); - extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static']; + // [extname, shared, zend] + extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static', false]; } function ADD_SOURCES(dir, file_list, target, obj_dir) @@ -1870,14 +1878,42 @@ function output_as_table(header, ar_out) STDOUT.WriteLine(sep); } +function write_extensions_summary() +{ + var exts = new Array(); + var zend_exts = new Array(); + + for(var x = 0; x < extensions_enabled.length; ++x) + { + var l = extensions_enabled[x]; + + if(l[2]) + { + zend_exts.push([l[0], l[1]]); + } + else + { + exts.push([l[0], l[1]]); + } + } + + STDOUT.WriteLine('Enabled extensions:'); + output_as_table(['Extension', 'Mode'], exts.sort()); + + if(zend_exts.length) + { + STDOUT.WriteBlankLines(2); + STDOUT.WriteLine('Enabled Zend extensions:'); + output_as_table(['Extension', 'Mode'], zend_exts.sort()); + } +} + function write_summary() { var ar = new Array(); STDOUT.WriteBlankLines(2); - - STDOUT.WriteLine("Enabled extensions:"); - output_as_table(["Extension", "Mode"], extensions_enabled.sort()); + write_extensions_summary(); STDOUT.WriteBlankLines(2); if (!MODE_PHPIZE) { STDOUT.WriteLine("Enabled SAPI:"); @@ -1947,8 +1983,10 @@ function generate_tmp_php_ini() continue; } - var directive = "extension"; - if ("opcache" == extensions_enabled[i][0] || "xdebug" == extensions_enabled[i][0]) { + var directive = (extensions_enabled[i][2] ? 'zend_extension' : 'extension'); + + // FIXME: Remove this once ZEND_EXTENSION() is merged to XDEBUG + if ("xdebug" == extensions_enabled[i][0]) { directive = "zend_extension"; } @@ -1962,7 +2000,7 @@ function generate_tmp_php_ini() } } - INI.Close();; + INI.Close(); } function generate_files()