summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sapi/embed/config.w322
-rw-r--r--win32/build/confutils.js19
2 files changed, 19 insertions, 2 deletions
diff --git a/sapi/embed/config.w32 b/sapi/embed/config.w32
index f3cc60d600..64e44bdd94 100644
--- a/sapi/embed/config.w32
+++ b/sapi/embed/config.w32
@@ -3,6 +3,8 @@
ARG_ENABLE('embed', 'Embedded SAPI library', 'no');
+var PHP_EMBED_PGO = false;
+
if (PHP_EMBED != "no") {
SAPI('embed', 'php_embed.c', 'php' + PHP_VERSION + 'embed.lib');
PHP_INSTALL_HEADERS("sapi/embed", "php_embed.h");
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 68aae6e397..b6c793b42d 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1017,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();
@@ -1068,7 +1083,7 @@ 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")) {
ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
}
@@ -1254,7 +1269,7 @@ 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")) {
ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
}