[xslt] win32 build patch for embedding manifest



Could someone commit this patch to add a flag allowing the manifest to be embedded when building with VS 2005?
This adds the same capability as I had added in the libxml2 build.

Rob
Index: Makefile.msvc
===================================================================
--- Makefile.msvc	(revision 1434)
+++ Makefile.msvc	(working copy)
@@ -141,6 +141,14 @@
 # Xsltproc and friends executables.
 UTILS = $(BINDIR)\xsltproc.exe
 
+!if "$(VCMANIFEST)" == "1"
+_VC_MANIFEST_EMBED_EXE= if exist $  manifest mt.exe -nologo -manifest $  manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL= if exist $  manifest mt.exe -nologo -manifest $  manifest -outputresource:$@;2
+!else
+_VC_MANIFEST_EMBED_EXE=
+_VC_MANIFEST_EMBED_DLL=
+!endif
+
 all : libxslt libxslta libexslt libexslta utils
 
 libxslt : $(BINDIR)\$(XSLT_SO) 
@@ -233,6 +241,7 @@
 		/VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \
 		/IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \
 		$(XSLT_OBJS) $(LIBS) libxml2.lib
+			@$(_VC_MANIFEST_EMBED_DLL)
 
 #$(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF)
 #	$(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \
@@ -278,6 +287,7 @@
 		/VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \
 		/IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \
 		$(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib
+			@$(_VC_MANIFEST_EMBED_DLL)
 
 #$(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt
 #	$(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \
@@ -308,11 +318,13 @@
 	$(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \
 		$(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 
 	$(LD) $(LDFLAGS) /OUT:$@ $(XSLT_A) $(EXSLT_A) $(APPLIBS) $(UTILS_INTDIR)\$(<B).obj
+	@$(_VC_MANIFEST_EMBED_EXE)
 !else
 APPLIBS = $(LIBS) libxml2.lib
 {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
 	$(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 
 	$(LD) $(LDFLAGS) /OUT:$@ $(XSLT_IMP) $(EXSLT_IMP) $(APPLIBS) $(UTILS_INTDIR)\$(<B).obj
+	@$(_VC_MANIFEST_EMBED_EXE)
 !endif
 
 # Builds xsltproc and friends. Uses the implicit rule for commands.
Index: configure.js
===================================================================
--- configure.js	(revision 1434)
+++ configure.js	(working copy)
@@ -51,6 +51,7 @@
 var dirSep = "\\";
 var compiler = "msvc";
 var cruntime = "/MD";
+var vcmanifest = false;
 var buildDebug = 0;
 var buildStatic = 0;
 var buildPrefix = ".";
@@ -108,6 +109,7 @@
 	txt += "\nWin32 build options, default value given in parentheses:\n\n";
 	txt += "  compiler:   Compiler to be used [msvc|mingw] (" + compiler + ")\n";
 	txt += "  cruntime:   C-runtime compiler option (only msvc) (" + cruntime + ")\n";
+	txt += "  vcmanifest: Embed VC manifest (only msvc) (" + (vcmanifest? "yes" : "no") + ")\n";
 	txt += "  debug:      Build unoptimised debug executables (" + (buildDebug? "yes" : "no")  + ")\n";
 	txt += "  static:     Link xsltproc statically to libxslt (" + (buildStatic? "yes" : "no")  + ")\n";
 	txt += "              Note: automatically enabled if cruntime is not /MD or /MDd\n";
@@ -201,6 +203,7 @@
 		vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
 		vf.WriteLine("LIB=$(LIB);" + buildLib);
 		vf.WriteLine("CRUNTIME=" + cruntime);
+		vf.WriteLine("VCMANIFEST=" + (vcmanifest? "1" : "0"));
 	} else if (compiler == "mingw") {
 		vf.WriteLine("INCLUDE+=;" + buildInclude);
 		vf.WriteLine("LIB+=;" + buildLib);
@@ -344,6 +347,8 @@
 			compiler = arg.substring(opt.length + 1, arg.length);
  		else if (opt == "cruntime")
  			cruntime = arg.substring(opt.length + 1, arg.length);
+		else if (opt == "vcmanifest")
+			vcmanifest = strToBool(arg.substring(opt.length + 1, arg.length));
 		else if (opt == "static")
 			buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
 		else if (opt == "prefix")
@@ -478,6 +483,7 @@
 txtOut += "          Compiler: " + compiler + "\n";
 if (compiler == "msvc")
 	txtOut += "  C-Runtime option: " + cruntime + "\n";
+	txtOut += "    Embed Manifest: " + boolToStr(vcmanifest) + "\n";
 txtOut += "     Debug symbols: " + boolToStr(buildDebug) + "\n";
 txtOut += "   Static xsltproc: " + boolToStr(buildStatic) + "\n";
 txtOut += "    Install prefix: " + buildPrefix + "\n";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]