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

[xml] [patches] static linking on win32 with static cruntimes



the two patches below force static linking on win32 in libxml2 and libxslt
for .exe's when the libraries are built using a static version of the
cruntime (/MT, /MTd, /ML, and /MLd).

these patches fix the breakage discussed previously on the xslt list,
and found also to occur in xmllint.exe.

http://mail.gnome.org/archives/xslt/2005-January/msg00069.html

quoting http://support.microsoft.com/kb/q140584/

"You cannot pass a FILE* or file handle across a CRT-boundary and expect
the "stdio low-level IO" to work."

jr
--- /home/jreed/.backups/!home!jreed!src!libxml2-2.6.17!win32!configure.js.~1~	2005-01-04 09:55:45.000000000 -0500
+++ win32/configure.js	2005-01-27 12:09:47.718750000 -0500
@@ -145,6 +145,7 @@ function usage()
 	txt += "  dynruntime: Use the dynamic RTL (only bcb) (" + dynruntime + ")\n";
 	txt += "  debug:      Build unoptimised debug executables (" + (buildDebug? "yes" : "no")  + ")\n";
 	txt += "  static:     Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no")  + ")\n";
+	txt += "              Note: automatically enabled if cruntime is not /MD or /MDd\n";
 	txt += "  prefix:     Base directory for the installation (" + buildPrefix + ")\n";
 	txt += "  bindir:     Directory where xmllint and friends should be installed\n";
 	txt += "              (" + buildBinPrefix + ")\n";
@@ -534,6 +535,14 @@ if (error != 0) {
 	usage();
 	WScript.Quit(error);
 }
+
+// if user choses to link the c-runtime library statically into libxml2
+// with /MT and friends, then we need to enable static linking for xmllint
+if (cruntime == "/MT" || cruntime == "/MTd" ||
+		cruntime == "/ML" || cruntime == "/MLd") {
+	buildStatic = 1;
+}
+
 dirSep = "\\";
 if (compiler == "mingw")
 	dirSep = "/";
--- /home/jreed/.backups/!home!jreed!src!libxslt-1.1.12!win32!configure.js.~1~	2004-08-31 05:39:48.000000000 -0400
+++ win32/configure.js	2005-01-27 12:15:33.015625000 -0500
@@ -110,6 +110,7 @@ function usage()
 	txt += "  cruntime:   C-runtime compiler option (only msvc) (" + cruntime + ")\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";
 	txt += "  prefix:     Base directory for the installation (" + buildPrefix + ")\n";
 	txt += "  bindir:     Directory where xsltproc and friends should be installed\n";
 	txt += "              (" + buildBinPrefix + ")\n";
@@ -376,6 +377,14 @@ if (error != 0) {
 	usage();
 	WScript.Quit(error);
 }
+
+// if user choses to link the c-runtime library statically into libxslt
+// with /MT and friends, then we need to enable static linking for xsltproc
+if (cruntime == "/MT" || cruntime == "/MTd" ||
+		cruntime == "/ML" || cruntime == "/MLd") {
+	buildStatic = 1;
+}
+
 dirSep = "\\";
 //if (compiler == "mingw")
 //	dirSep = "/";


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