summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorIgor Zlatkovic <igor@src.gnome.org>2002-11-22 21:41:09 +0000
committerIgor Zlatkovic <igor@src.gnome.org>2002-11-22 21:41:09 +0000
commit853514fc02e90febc2f67dce99493fd5dacf7c07 (patch)
treedc6a1a9f3b41f96374308075b0bffae93b7bc218 /win32
parent002372e9d044a6db2575dd6dcdaf71f173ac209e (diff)
downloadlibxml2-853514fc02e90febc2f67dce99493fd5dacf7c07.tar.gz
added option for python bindings
Diffstat (limited to 'win32')
-rw-r--r--win32/configure.js41
1 files changed, 38 insertions, 3 deletions
diff --git a/win32/configure.js b/win32/configure.js
index b9d7eccc..c3eaaffa 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -18,9 +18,7 @@ var baseName = "libxml2";
we can store our build configuration. */
var configFile = srcDirXml + "\\configure.in";
var versionFile = ".\\config.msvc";
-/* Input and output files regarding the libxml features. The second
- output file is there for the compatibility reasons, otherwise it
- is identical to the first. */
+/* Input and output files regarding the libxml features. */
var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in";
var optsFile = srcDirXml + "\\include\\libxml\\xmlversion.h";
/* Version strings for the binary distribution. Will be filled later
@@ -46,6 +44,7 @@ var withDebug = true;
var withMemDebug = false;
var withSchemas = true;
var withRegExps = true;
+var withPython = false;
/* Win32 build options. */
var compiler = "msvc";
var buildDebug = 0;
@@ -111,6 +110,7 @@ function usage()
txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n";
txt += " regexps: Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
txt += " schemas: Enable XML Schema support (" + (withSchemas? "yes" : "no") + ")\n";
+ txt += " python: Build Python bindings (" + (withPython? "yes" : "no") + ")\n";
txt += "\nWin32 build options, default value given in parentheses:\n\n";
txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n";
txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
@@ -182,6 +182,7 @@ function discoverVersion()
vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0"));
vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
+ vf.WriteLine("WITH_PYTHON=" + (withPython? "1" : "0"));
vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
vf.WriteLine("PREFIX=" + buildPrefix);
@@ -256,6 +257,29 @@ function configureLibxml()
ofi.Close();
of.Close();
}
+/* Configures Python bindings. Otherwise identical to the above */
+function configureLibxmlPy()
+{
+ var pyOptsFileIn = srcDirXml + "\\python\\setup.py.in";
+ var pyOptsFile = srcDirXml + "\\python\\setup.py";
+ var fso, ofi, of, ln, s;
+ fso = new ActiveXObject("Scripting.FileSystemObject");
+ ofi = fso.OpenTextFile(pyOptsFileIn, 1);
+ of = fso.CreateTextFile(pyOptsFile, true);
+ while (ofi.AtEndOfStream != true) {
+ ln = ofi.ReadLine();
+ s = new String(ln);
+ if (s.search(/\@LIBXML_VERSION\@/) != -1) {
+ of.WriteLine(s.replace(/\@LIBXML_VERSION\@/,
+ verMajor + "." + verMinor + "." + verMicro));
+ } else if (s.search(/\@prefix\@/) != -1) {
+ of.WriteLine(s.replace(/\@prefix\@/, buildPrefix));
+ } else
+ of.WriteLine(ln);
+ }
+ ofi.Close();
+ of.Close();
+}
/* Creates the readme file for the binary distribution of 'bname', for the
version 'ver' in the file 'file'. This one is called from the Makefile when
@@ -357,6 +381,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
withSchemas = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "regexps")
withRegExps = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "python")
+ withPython = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "compiler")
compiler = arg.substring(opt.length + 1, arg.length);
else if (opt == "debug")
@@ -415,6 +441,14 @@ if (error != 0) {
WScript.Echo("Configuration failed, aborting.");
WScript.Quit(error);
}
+if (withPython == true) {
+ configureLibxmlPy();
+ if (error != 0) {
+ WScript.Echo("Configuration failed, aborting.");
+ WScript.Quit(error);
+ }
+}
+
// Create the makefile.
var fso = new ActiveXObject("Scripting.FileSystemObject");
@@ -444,6 +478,7 @@ txtOut += " Debugging module: " + boolToStr(withDebug) + "\n";
txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n";
txtOut += " Regexp support: " + boolToStr(withRegExps) + "\n";
txtOut += "XML Schema support: " + boolToStr(withSchemas) + "\n";
+txtOut += " Python bindings: " + boolToStr(withPython) + "\n";
txtOut += "\n";
txtOut += "Win32 build configuration\n";
txtOut += "-------------------------\n";