diff --git a/NEWS b/NEWS index 171a437f53c..b723e8a1166 100644 --- a/NEWS +++ b/NEWS @@ -81,6 +81,7 @@ PHP NEWS - Windows: . Fixed bug GH-10992 (Improper long path support for relative paths). (cmb, nielsdos) + . Fixed bug GH-16843 (Windows phpize builds ignore source subfolders). (cmb) - XMLWriter: . Improved performance and reduce memory consumption. (nielsdos) diff --git a/UPGRADING b/UPGRADING index 37538739d6a..4b37e3e41a4 100644 --- a/UPGRADING +++ b/UPGRADING @@ -166,6 +166,10 @@ PHP 8.5 UPGRADE NOTES PHP_RELEASE_VERSION are now always numbers. Previously, they have been strings for buildconf builds. +* phpize builds now reflect the source tree in the build dir (like that already + worked for in-tree builds); some extension builds (especially when using + Makefile.frag.w32) may need adjustments. + * --enable-sanitzer is now supported for MSVC builds. This enables ASan and debug assertions, and is supported as of MSVC 16.10 and Windows 10. diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 438eb1d239c..cf1010266f2 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1616,8 +1616,15 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) if (obj_dir == null) { if (MODE_PHPIZE) { /* In the phpize mode, the subdirs are always relative to BUID_DIR. - No need to differentiate by extension, only one gets built. */ - var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), ""); + No need to differentiate by extension, only one gets built. + We still need to cater to subfolders, though. */ + if (dir.charAt(configure_module_dirname.length) === "\\" && + dir.substr(0, configure_module_dirname.length) === configure_module_dirname) { + var reldir = dir.substr(configure_module_dirname.length + 1); + var build_dir = (dirname ? (reldir + "\\" + dirname) : reldir).replace(new RegExp("^..\\\\"), ""); + } else { + var build_dir = (dirname ? dirname : "").replace(new RegExp("^..\\\\"), ""); + } } else { var build_dir = (dirname ? (dir + "\\" + dirname) : dir).replace(new RegExp("^..\\\\"), ""); }