Skip to content

Commit 525ab41

Browse files
committed
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(...); }
1 parent 23cfe1f commit 525ab41

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

ext/opcache/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (PHP_OPCACHE != "no") {
1010
AC_DEFINE('HAVE_OPCACHE_FILE_CACHE', 1, 'Define to enable file based caching (experimental)');
1111
}
1212

13-
EXTENSION('opcache', "\
13+
ZEND_EXTENSION('opcache', "\
1414
ZendAccelerator.c \
1515
zend_accelerator_blacklist.c \
1616
zend_accelerator_debug.c \

win32/build/confutils.js

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,13 @@ function ADD_EXTENSION_DEP(extname, dependson, optional)
13731373

13741374
var static_pgo_enabled = false;
13751375

1376+
function ZEND_EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
1377+
{
1378+
EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir);
1379+
1380+
extensions_enabled[extensions_enabled.length - 1][2] = true;
1381+
}
1382+
13761383
function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
13771384
{
13781385
var objs = null;
@@ -1509,7 +1516,8 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
15091516
}
15101517
ADD_FLAG("CFLAGS_" + EXT, cflags);
15111518

1512-
extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static'];
1519+
// [extname, shared, zend]
1520+
extensions_enabled[extensions_enabled.length] = [extname, shared ? 'shared' : 'static', false];
15131521
}
15141522

15151523
function ADD_SOURCES(dir, file_list, target, obj_dir)
@@ -1870,14 +1878,42 @@ function output_as_table(header, ar_out)
18701878
STDOUT.WriteLine(sep);
18711879
}
18721880

1881+
function write_extensions_summary()
1882+
{
1883+
var exts = new Array();
1884+
var zend_exts = new Array();
1885+
1886+
for(var x = 0; x < extensions_enabled.length; ++x)
1887+
{
1888+
var l = extensions_enabled[x];
1889+
1890+
if(l[2])
1891+
{
1892+
zend_exts.push([l[0], l[1]]);
1893+
}
1894+
else
1895+
{
1896+
exts.push([l[0], l[1]]);
1897+
}
1898+
}
1899+
1900+
STDOUT.WriteLine('Enabled extensions:');
1901+
output_as_table(['Extension', 'Mode'], exts.sort());
1902+
1903+
if(zend_exts.length)
1904+
{
1905+
STDOUT.WriteBlankLines(2);
1906+
STDOUT.WriteLine('Enabled Zend extensions:');
1907+
output_as_table(['Extension', 'Mode'], zend_exts.sort());
1908+
}
1909+
}
1910+
18731911
function write_summary()
18741912
{
18751913
var ar = new Array();
18761914

18771915
STDOUT.WriteBlankLines(2);
1878-
1879-
STDOUT.WriteLine("Enabled extensions:");
1880-
output_as_table(["Extension", "Mode"], extensions_enabled.sort());
1916+
write_extensions_summary();
18811917
STDOUT.WriteBlankLines(2);
18821918
if (!MODE_PHPIZE) {
18831919
STDOUT.WriteLine("Enabled SAPI:");
@@ -1947,8 +1983,10 @@ function generate_tmp_php_ini()
19471983
continue;
19481984
}
19491985

1950-
var directive = "extension";
1951-
if ("opcache" == extensions_enabled[i][0] || "xdebug" == extensions_enabled[i][0]) {
1986+
var directive = (extensions_enabled[i][2] ? 'zend_extension' : 'extension');
1987+
1988+
// FIXME: Remove this once ZEND_EXTENSION() is merged to XDEBUG
1989+
if ("xdebug" == extensions_enabled[i][0]) {
19521990
directive = "zend_extension";
19531991
}
19541992

@@ -1962,7 +2000,7 @@ function generate_tmp_php_ini()
19622000
}
19632001
}
19642002

1965-
INI.Close();;
2003+
INI.Close();
19662004
}
19672005

19682006
function generate_files()

0 commit comments

Comments
 (0)