Skip to content

Commit

Permalink
backport the manifest changes in js
Browse files Browse the repository at this point in the history
  • Loading branch information
weltling committed May 31, 2015
1 parent 7e731e4 commit 50d4ea9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,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 */
Expand Down Expand Up @@ -1067,12 +1077,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$"))) {
Expand Down Expand Up @@ -1282,6 +1294,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")) {
Expand All @@ -1301,10 +1314,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)");
Expand Down

0 comments on commit 50d4ea9

Please sign in to comment.