Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  backport the basic code to properly recognize win 8.1 and 10
  backport the manifest changes for makefile
  backport the manifest changes in js
  add default manifest
  add test
This commit is contained in:
Anatol Belski committed 2015-05-31 19:32:21 +02:00
commit 021effbe97
5 files changed
+72 -5

No files matched your search

+17
View File
@@ -320,6 +320,17 @@ char* php_get_windows_name()
}
if (VER_PLATFORM_WIN32_NT==osvi.dwPlatformId && osvi.dwMajorVersion > 4 ) {
if (osvi.dwMajorVersion == 10) {
if( osvi.dwMinorVersion == 0 ) {
if( osvi.wProductType == VER_NT_WORKSTATION ) {
major = "Windows 10";
} else {
major = "Windows Server 2016";
}
}
}
if (osvi.dwMajorVersion == 6) {
if( osvi.dwMinorVersion == 0 ) {
if( osvi.wProductType == VER_NT_WORKSTATION ) {
@@ -366,6 +377,12 @@ char* php_get_windows_name()
major = "Windows Server 2012";
}
}
} else if (osvi.dwMinorVersion == 3) {
if( osvi.wProductType == VER_NT_WORKSTATION ) {
major = "Windows 8.1";
} else {
major = "Windows Server 2012 R2";
}
} else {
major = "Unknown Windows version";
}
@@ -0,0 +1,18 @@
--TEST--
Check that windows version constants are initialized
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip.. Windows only');
}
?>
--FILE--
<?php
var_dump(PHP_WINDOWS_VERSION_MAJOR > 0, PHP_WINDOWS_VERSION_MAJOR, PHP_WINDOWS_VERSION_MINOR);
?>
==DONE==
--EXPECTF--
bool(true)
int(%d)
int(%d)
==DONE==
+3 -1
View File
@@ -89,6 +89,7 @@ $(PHPDLL_RES): win32\build\template.rc
win32\build\template.rc
$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE)
@copy win32\build\default.manifest $(BUILD_DIR)\$(PHPDLL).manifest
@$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP5_PGD_OPTION) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
-@$(_VC_MANIFEST_EMBED_DLL)
@@ -115,7 +116,7 @@ clean: clean-sapi
@cd $(BUILD_DIR)
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
@cd "$(PHP_SRC_DIR)"
-@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
-@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
-rd /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
clean-pecl:
@@ -196,6 +197,7 @@ build-devel: build-headers build-lib
@copy win32\build\Makefile.phpize $(BUILD_DIR_DEV)\script\ /y >nul
@copy win32\build\phpize.bat $(BUILD_DIR_DEV)\ /y >nul
@copy win32\build\template.rc $(BUILD_DIR_DEV)\build\ /y >nul
@copy win32\build\default.manifest $(BUILD_DIR_DEV)\build\ /y >nul
@copy $(BUILD_DIR)\devel\config.phpize.js $(BUILD_DIR_DEV)\script\ /y >nul
@copy $(BUILD_DIR)\devel\phpize.js $(BUILD_DIR_DEV)\script\ /y >nul
@copy $(BUILD_DIR)\devel\ext_deps.js $(BUILD_DIR_DEV)\script\ /y >nul
+17 -4
View File
@@ -918,6 +918,16 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
return p;
}
function generate_version_info_manifest(makefiletarget)
{
var manifest_name = makefiletarget + ".manifest";
MFO.WriteLine("$(BUILD_DIR)\\" + manifest_name + ": win32\\build\\default.manifest");
MFO.WriteLine("\t@copy $(PHP_SRC_DIR)\\win32\\build\\default.manifest $(BUILD_DIR)\\" + makefiletarget + ".manifest");
return manifest_name;
}
/* emits rule to generate version info for a SAPI
* or extension. Returns the name of the .res file
* that will be generated */
@@ -1069,12 +1079,14 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
/* generate a .res file containing version information */
resname = generate_version_info_resource(makefiletarget, sapiname, configure_module_dirname, true);
manifest_name = generate_version_info_manifest(makefiletarget);
MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete");
if (MODE_PHPIZE) {
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
} else {
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
}
if (makefiletarget.match(new RegExp("\\.dll$"))) {
@@ -1284,6 +1296,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
var resname = generate_version_info_resource(dllname, extname, configure_module_dirname, false);
var ld = "@$(CC)";
var manifest_name = generate_version_info_manifest(dllname);
ldflags = "";
if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
@@ -1303,10 +1316,10 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
MFO.WriteBlankLines(1);
if (MODE_PHPIZE) {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
} else {
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname + " $(BUILD_DIR)\\" + manifest_name);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + ldflags + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
}
MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");
+17
View File
@@ -0,0 +1,17 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>