diff options
author | Ondřej Surý <ondrej@sury.org> | 2014-04-17 11:11:51 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2014-04-17 11:11:51 +0200 |
commit | 9566c3fcaf4cfaa866ea395ee5d1a480785fef0d (patch) | |
tree | d053b8b66afe080ea2250d5fbcdfc21c243d54ab /win32/build | |
parent | 30bdcf2392ef8cc7b8b4a07b49367571ae1db286 (diff) | |
download | php-9566c3fcaf4cfaa866ea395ee5d1a480785fef0d.tar.gz |
New upstream version 5.6.0~beta1+dfsgupstream/5.6.0_beta1+dfsg
Diffstat (limited to 'win32/build')
-rw-r--r-- | win32/build/config.w32 | 39 | ||||
-rw-r--r-- | win32/build/confutils.js | 75 | ||||
-rw-r--r-- | win32/build/libs_version.txt | 14 |
3 files changed, 113 insertions, 15 deletions
diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 0caa3c66f..3fe8469a9 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -255,13 +255,11 @@ if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") { // CFLAGS, LDFLAGS and BUILD_DIR are defined // Add compiler and link flags if PGO options are selected if (PHP_DEBUG != "yes" && PHP_PGI == "yes") { - ADD_FLAG('CFLAGS', "/GL /O2"); - ADD_FLAG('LDFLAGS', "/LTCG:PGINSTRUMENT"); + ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2"); DEFINE("PGOPGD_DIR", "$(BUILD_DIR)"); } else if (PHP_DEBUG != "yes" && PHP_PGO != "no") { - ADD_FLAG('CFLAGS', "/GL /O2"); - ADD_FLAG('LDFLAGS', "/LTCG:PGUPDATE"); + ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2"); DEFINE("PGOPGD_DIR", ((PHP_PGO.length == 0 || PHP_PGO == "yes") ? "$(BUILD_DIR)" : PHP_PGO)); } @@ -444,8 +442,37 @@ if (PHP_SECURITY_FLAGS == "yes") { ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE "); } -ARG_ENABLE("static-analyze", "Enable the VC compiler static analyze", "no"); -if (PHP_STATIC_ANALYZE == "yes") { +/* XXX add and implement clang keyword for clang analyzer */ +ARG_WITH("analyzer", "Enable static analyzer. Pass vs for Visual Studio, pvs for PVS-Studio", "no"); +if (PHP_ANALYZER == "vs") { ADD_FLAG("CFLAGS", " /analyze "); ADD_FLAG("CFLAGS", " /wd6308 "); +} else if (PHP_ANALYZER == "pvs") { + var pvs_studio = false; + + if (FSO.FileExists(PROGRAM_FILES + "\\PVS-Studio\\x64\\PVS-Studio.exe")) { + pvs_studio = PROGRAM_FILES + "\\PVS-Studio\\x86\\PVS-Studio.exe"; + } else if (FSO.FileExists(PROGRAM_FILESx86 + "\\PVS-Studio\\x64\\PVS-Studio.exe")) { + pvs_studio = PROGRAM_FILESx86 + "\\PVS-Studio\\x64\\PVS-Studio.exe"; + } + + if (!pvs_studio) { + WARNING("Couldn't find PVS-Studio binaries, static analyze was disabled"); + PHP_ANALYZER = "no"; + } else { + var pvscfg = FSO.CreateTextFile("PVS-Studio.conf", true); + DEFINE("PVS_STUDIO", pvs_studio); + + pvscfg.WriteLine("exclude-path = " + VCINSTALLDIR); + if (FSO.FolderExists(PROGRAM_FILESx86 + "\\windows kits\\")) { + pvscfg.WriteLine("exclude-path = " + PROGRAM_FILESx86 + "\\windows kits\\"); + } else if (FSO.FolderExists(PROGRAM_FILES + "\\windows kits\\")) { + pvscfg.WriteLine("exclude-path = " + PROGRAM_FILES + "\\windows kits\\"); + } + pvscfg.WriteLine("vcinstalldir = " + VCINSTALLDIR); + pvscfg.WriteLine("platform = " + (X64 ? 'x64' : 'Win32')); + pvscfg.WriteLine("preprocessor = visualcpp"); + pvscfg.WriteLine("language = C"); + } } + diff --git a/win32/build/confutils.js b/win32/build/confutils.js index e0df4f621..1dbc75b28 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -26,6 +26,8 @@ var FSO = WScript.CreateObject("Scripting.FileSystemObject"); var MFO = null;
var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive");
var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles");
+var PROGRAM_FILESx86 = WshShell.Environment("Process").Item("ProgramFiles(x86)");
+var VCINSTALLDIR = WshShell.Environment("Process").Item("VCINSTALLDIR");
var DSP_FLAGS = new Array();
var PHP_SRC_DIR=FSO.GetParentFolderName(WScript.ScriptFullName);
@@ -1015,6 +1017,21 @@ function generate_version_info_resource(makefiletarget, basename, creditspath, s return resname;
}
+/* Check if PGO is enabled for given module. To disable PGO for a particular module,
+define a global variable by the following name scheme before SAPI() or EXTENSION() call
+ var PHP_MYMODULE_PGO = false; */
+function is_pgo_desired(mod)
+{
+ var varname = "PHP_" + mod.toUpperCase() + "_PGO";
+
+ /* don't disable if there's no mention of the varname */
+ if (eval("typeof " + varname + " == 'undefined'")) {
+ return true;
+ }
+
+ return eval("!!" + varname);
+}
+
function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
{
var SAPI = sapiname.toUpperCase();
@@ -1066,7 +1083,17 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) manifest = "-@$(_VC_MANIFEST_EMBED_EXE)";
}
- if(PHP_PGI == "yes" || PHP_PGO != "no") {
+ if(is_pgo_desired(sapiname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
+ // Add compiler and link flags if PGO options are selected
+ if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
+ ADD_FLAG('CFLAGS_' + SAPI, "/GL /O2");
+ ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG:PGINSTRUMENT");
+ }
+ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
+ ADD_FLAG('CFLAGS_' + SAPI, "/GL /O2");
+ ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG:PGUPDATE");
+ }
+
ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
}
@@ -1203,6 +1230,8 @@ function ADD_EXTENSION_DEP(extname, dependson, optional) return true;
}
+var static_pgo_enabled = false;
+
function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
{
var objs = null;
@@ -1252,7 +1281,17 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) var ld = "@$(CC)";
ldflags = "";
- if (PHP_PGI == "yes" || PHP_PGO != "no") {
+ if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
+ // Add compiler and link flags if PGO options are selected
+ if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
+ ADD_FLAG('LDFLAGS_' + EXT, "/LTCG:PGINSTRUMENT");
+ }
+ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
+ ADD_FLAG('LDFLAGS_' + EXT, "/LTCG:PGUPDATE");
+ }
+
+ ADD_FLAG('CFLAGS_' + EXT, "/GL /O2");
+
ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
}
@@ -1283,6 +1322,19 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");
+ if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
+ if (!static_pgo_enabled) {
+ if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
+ ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGINSTRUMENT");
+ }
+ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
+ ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGUPDATE");
+ }
+
+ ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
+ static_pgo_enabled = true;
+ }
+ }
/* find the header that declares the module pointer,
* so we can include it in internal_functions.c */
@@ -1388,6 +1440,11 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) }
} else {
MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src);
+
+ if (PHP_ANALYZER == "pvs") {
+ MFO.WriteLine("\t@\"$(PVS_STUDIO)\" --cl-params $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " --source-file " + dir + "\\" + src
+ + " --cfg PVS-Studio.conf --errors-off \"V122 V117 V111\" ");
+ }
MFO.WriteLine("\t@$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + obj);
}
}
@@ -1548,6 +1605,20 @@ function write_summary() ar[1] = ['Thread Safety', PHP_ZTS == "yes" ? "Yes" : "No"];
ar[2] = ['Compiler', VC_VERSIONS[VCVERS]];
ar[3] = ['Architecture', X64 ? 'x64' : 'x86'];
+ if (PHP_PGO == "yes") {
+ ar[4] = ['Optimization', "PGO"];
+ } else if (PHP_PGI == "yes") {
+ ar[4] = ['Optimization', "PGI"];
+ } else {
+ ar[4] = ['Optimization', PHP_DEBUG == "yes" ? "disabled" : "PGO disabled"];
+ }
+ if (PHP_ANALYZER == "vs") {
+ ar[5] = ['Static analyzer', 'Visual Studio'];
+ } else if (PHP_ANALYZER == "pvs") {
+ ar[5] = ['Static analyzer', 'PVS-Studio'];
+ } else {
+ ar[5] = ['Static analyzer', 'disabled'];
+ }
output_as_table(["",""], ar);
STDOUT.WriteBlankLines(2);
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index ece70412b..71af7a1a0 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -1,16 +1,16 @@ bz2-1.0.6 cclient-2007f -freetype-2.4.10 +freetype-2.5.3 icu-52.1 -jpeglib-9 -libcurl-7.35.0 +jpeglib-9a +libcurl-7.36.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.6.0 -libpng-1.5.14 -libpq-9.2.2 -libssh2-1.4.2 +libpng-1.5.18 +libpq-9.3.2 +libssh2-1.4.3 libtidy-20090406 libxslt-1.1.27 libxml-2.9.1 -openssl-1.0.1f +openssl-1.0.1g |