Skip to content

Commit d844e96

Browse files
committed
Merge branch 'master' of git.php.net:php-src
2 parents ed8d1ba + 7ab99ed commit d844e96

File tree

5 files changed

+63
-8
lines changed

5 files changed

+63
-8
lines changed

ext/standard/info.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,17 @@ char* php_get_windows_name()
307307
GetSystemInfo(&si);
308308
}
309309

310-
if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 6 ) {
310+
if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 10) {
311+
if (osvi.dwMajorVersion == 10) {
312+
if( osvi.dwMinorVersion == 0 ) {
313+
if( osvi.wProductType == VER_NT_WORKSTATION ) {
314+
major = "Windows 10";
315+
} else {
316+
major = "Windows Server 2016";
317+
}
318+
}
319+
}
320+
} else if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion >= 6) {
311321
if (osvi.dwMajorVersion == 6) {
312322
if( osvi.dwMinorVersion == 0 ) {
313323
if( osvi.wProductType == VER_NT_WORKSTATION ) {
@@ -323,6 +333,11 @@ char* php_get_windows_name()
323333
}
324334
} else if ( osvi.dwMinorVersion == 2 ) {
325335
/* could be Windows 8/Windows Server 2012, could be Windows 8.1/Windows Server 2012 R2 */
336+
/* XXX and one more X - the above comment is true if no manifest is used for two cases:
337+
- if the PHP build doesn't use the correct manifest
338+
- if PHP DLL loaded under some binary that doesn't use the correct manifest
339+
340+
So keep the handling here as is for now, even if we know 6.2 is win8 and nothing else, and think about an improvement. */
326341
OSVERSIONINFOEX osvi81;
327342
DWORDLONG dwlConditionMask = 0;
328343
int op = VER_GREATER_EQUAL;
@@ -353,6 +368,12 @@ char* php_get_windows_name()
353368
major = "Windows Server 2012";
354369
}
355370
}
371+
} else if (osvi.dwMinorVersion == 3) {
372+
if( osvi.wProductType == VER_NT_WORKSTATION ) {
373+
major = "Windows 8.1";
374+
} else {
375+
major = "Windows Server 2012 R2";
376+
}
356377
} else {
357378
major = "Unknown Windows version";
358379
}

win32/build/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ $(PHPDLL_RES): win32\build\template.rc
8989
win32\build\template.rc
9090

9191
$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE)
92+
@copy win32\build\default.manifest $(BUILD_DIR)\$(PHPDLL).manifest
9293
# @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
9394
@"$(LINK)" $(PHP_GLOBAL_OBJS_RESP) $(STATIC_EXT_OBJS_RESP) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP7_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
9495
-@$(_VC_MANIFEST_EMBED_DLL)
@@ -116,7 +117,7 @@ clean: clean-sapi
116117
@cd $(BUILD_DIR)
117118
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
118119
@cd "$(PHP_SRC_DIR)"
119-
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL
120+
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.manifest $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL
120121
-rd /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
121122

122123
clean-pecl:
@@ -192,6 +193,7 @@ build-devel: build-headers build-lib
192193
@copy win32\build\Makefile.phpize $(BUILD_DIR_DEV)\script\ /y >nul
193194
@copy win32\build\phpize.bat $(BUILD_DIR_DEV)\ /y >nul
194195
@copy win32\build\template.rc $(BUILD_DIR_DEV)\build\ /y >nul
196+
@copy win32\build\default.manifest $(BUILD_DIR_DEV)\build\ /y >nul
195197
@copy $(BUILD_DIR)\devel\config.phpize.js $(BUILD_DIR_DEV)\script\ /y >nul
196198
@copy $(BUILD_DIR)\devel\phpize.js $(BUILD_DIR_DEV)\script\ /y >nul
197199
@copy $(BUILD_DIR)\devel\ext_deps.js $(BUILD_DIR_DEV)\script\ /y >nul

win32/build/confutils.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ if (typeof(CWD) == "undefined") {
9999
}
100100

101101
/* defaults; we pick up the precise versions from configure.in */
102-
var PHP_VERSION = 5;
102+
var PHP_VERSION = 7;
103103
var PHP_MINOR_VERSION = 0;
104104
var PHP_RELEASE_VERSION = 0;
105105
var PHP_EXTRA_VERSION = "";
106-
var PHP_VERSION_STRING = "5.0.0";
106+
var PHP_VERSION_STRING = "7.0.0";
107107

108108
/* Get version numbers and DEFINE as a string */
109109
function get_version_numbers()
@@ -936,6 +936,17 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
936936
return p;
937937
}
938938

939+
/* XXX check whether some manifest was originally supplied, otherwise keep using the default. */
940+
function generate_version_info_manifest(makefiletarget)
941+
{
942+
var manifest_name = makefiletarget + ".manifest";
943+
944+
MFO.WriteLine("$(BUILD_DIR)\\" + manifest_name + ": win32\\build\\default.manifest");
945+
MFO.WriteLine("\t@copy $(PHP_SRC_DIR)\\win32\\build\\default.manifest $(BUILD_DIR)\\" + makefiletarget + ".manifest");
946+
947+
return manifest_name;
948+
}
949+
939950
/* Emits rule to generate version info for a SAPI
940951
* or extension. Returns the name of the .res file
941952
* that will be generated */
@@ -1086,13 +1097,15 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
10861097

10871098
/* generate a .res file containing version information */
10881099
resname = generate_version_info_resource(makefiletarget, sapiname, configure_module_dirname, true);
1100+
1101+
manifest_name = generate_version_info_manifest(makefiletarget);
10891102

10901103
MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
10911104
MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete");
10921105
if (MODE_PHPIZE) {
1093-
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
1106+
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
10941107
} else {
1095-
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
1108+
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
10961109
}
10971110

10981111
if (makefiletarget.match(new RegExp("\\.dll$"))) {
@@ -1303,6 +1316,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
13031316

13041317
var resname = generate_version_info_resource(dllname, extname, configure_module_dirname, false);
13051318
var ld = '@"$(LINK)"';
1319+
var manifest_name = generate_version_info_manifest(dllname);
13061320

13071321
ldflags = "";
13081322
if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
@@ -1322,10 +1336,10 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
13221336
MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
13231337
MFO.WriteBlankLines(1);
13241338
if (MODE_PHPIZE) {
1325-
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
1339+
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
13261340
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
13271341
} else {
1328-
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
1342+
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
13291343
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS_RESP) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
13301344
}
13311345
MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");

win32/build/default.manifest

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
3+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
4+
<application>
5+
<!-- Windows Vista -->
6+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
7+
<!-- Windows 7 -->
8+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
9+
<!-- Windows 8 -->
10+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
11+
<!-- Windows 8.1 -->
12+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
13+
<!-- Windows 10 -->
14+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
15+
</application>
16+
</compatibility>
17+
</assembly>

win32/build/deplister.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* module to it's stdout for use by distro/installer building tools */
2323

2424
#include <windows.h>
25+
#include <stdio.h>
2526
#include <imagehlp.h>
2627

2728
BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason,

0 commit comments

Comments
 (0)