Blame win32/configure.js

Packit Service a31ea6
/* Configure script for libxml, specific for Windows with Scripting Host.
Packit Service a31ea6
 * 
Packit Service a31ea6
 * This script will configure the libxml build process and create necessary files.
Packit Service a31ea6
 * Run it with an 'help', or an invalid option and it will tell you what options
Packit Service a31ea6
 * it accepts.
Packit Service a31ea6
 *
Packit Service a31ea6
 * March 2002, Igor Zlatkovic <igor@zlatkovic.com>
Packit Service a31ea6
 */
Packit Service a31ea6
Packit Service a31ea6
/* The source directory, relative to the one where this file resides. */
Packit Service a31ea6
var srcDirXml = "..";
Packit Service a31ea6
var srcDirUtils = "..";
Packit Service a31ea6
/* Base name of what we are building. */
Packit Service a31ea6
var baseName = "libxml2";
Packit Service a31ea6
/* Configure file which contains the version and the output file where
Packit Service a31ea6
   we can store our build configuration. */
Packit Service a31ea6
var configFile = srcDirXml + "\\configure.ac";
Packit Service a31ea6
var versionFile = ".\\config.msvc";
Packit Service a31ea6
/* Input and output files regarding the libxml features. */
Packit Service a31ea6
var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in";
Packit Service a31ea6
var optsFile = srcDirXml + "\\include\\libxml\\xmlversion.h";
Packit Service a31ea6
/* Version strings for the binary distribution. Will be filled later 
Packit Service a31ea6
   in the code. */
Packit Service a31ea6
var verMajor;
Packit Service a31ea6
var verMinor;
Packit Service a31ea6
var verMicro;
Packit Service a31ea6
var verMicroSuffix;
Packit Service a31ea6
var verCvs;
Packit Service a31ea6
var useCvsVer = true;
Packit Service a31ea6
/* Libxml features. */
Packit Service a31ea6
var withTrio = false;
Packit Service a31ea6
var withThreads = "native";
Packit Service a31ea6
var withFtp = true;
Packit Service a31ea6
var withHttp = true;
Packit Service a31ea6
var withHtml = true;
Packit Service a31ea6
var withC14n = true;
Packit Service a31ea6
var withCatalog = true;
Packit Service a31ea6
var withDocb = true;
Packit Service a31ea6
var withXpath = true;
Packit Service a31ea6
var withXptr = true;
Packit Service a31ea6
var withXinclude = true;
Packit Service a31ea6
var withIconv = true;
Packit Service a31ea6
var withIcu = false;
Packit Service a31ea6
var withIso8859x = false;
Packit Service a31ea6
var withZlib = false;
Packit Service a31ea6
var withLzma = false;
Packit Service a31ea6
var withDebug = true;
Packit Service a31ea6
var withMemDebug = false;
Packit Service a31ea6
var withRunDebug = false;
Packit Service a31ea6
var withSchemas = true;
Packit Service a31ea6
var withSchematron = true;
Packit Service a31ea6
var withRegExps = true;
Packit Service a31ea6
var withModules = true;
Packit Service a31ea6
var withTree = true;
Packit Service a31ea6
var withReader = true;
Packit Service a31ea6
var withWriter = true;
Packit Service a31ea6
var withWalker = true;
Packit Service a31ea6
var withPattern = true;
Packit Service a31ea6
var withPush = true;
Packit Service a31ea6
var withValid = true;
Packit Service a31ea6
var withSax1 = true;
Packit Service a31ea6
var withLegacy = true;
Packit Service a31ea6
var withOutput = true;
Packit Service a31ea6
var withPython = false;
Packit Service a31ea6
/* Win32 build options. */
Packit Service a31ea6
var dirSep = "\\";
Packit Service a31ea6
var compiler = "msvc";
Packit Service a31ea6
var cruntime = "/MD";
Packit Service a31ea6
var dynruntime = true;
Packit Service a31ea6
var vcmanifest = false;
Packit Service a31ea6
var buildDebug = 0;
Packit Service a31ea6
var buildStatic = 0;
Packit Service a31ea6
var buildPrefix = ".";
Packit Service a31ea6
var buildBinPrefix = "";
Packit Service a31ea6
var buildIncPrefix = "";
Packit Service a31ea6
var buildLibPrefix = "";
Packit Service a31ea6
var buildSoPrefix = "";
Packit Service a31ea6
var buildInclude = ".";
Packit Service a31ea6
var buildLib = ".";
Packit Service a31ea6
/* Local stuff */
Packit Service a31ea6
var error = 0;
Packit Service a31ea6
Packit Service a31ea6
/* Helper function, transforms the option variable into the 'Enabled'
Packit Service a31ea6
   or 'Disabled' string. */
Packit Service a31ea6
function boolToStr(opt)
Packit Service a31ea6
{
Packit Service a31ea6
	if (opt == false)
Packit Service a31ea6
		return "no";
Packit Service a31ea6
	else if (opt == true)
Packit Service a31ea6
		return "yes";
Packit Service a31ea6
	error = 1;
Packit Service a31ea6
	return "*** undefined ***";
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
/* Helper function, transforms the argument string into a boolean
Packit Service a31ea6
   value. */
Packit Service a31ea6
function strToBool(opt)
Packit Service a31ea6
{
Packit Service a31ea6
	if (opt == 0 || opt == "no")
Packit Service a31ea6
		return false;
Packit Service a31ea6
	else if (opt == 1 || opt == "yes")
Packit Service a31ea6
		return true;
Packit Service a31ea6
	error = 1;
Packit Service a31ea6
	return false;
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
/* Displays the details about how to use this script. */
Packit Service a31ea6
function usage()
Packit Service a31ea6
{
Packit Service a31ea6
	var txt;
Packit Service a31ea6
	txt = "Usage:\n";
Packit Service a31ea6
	txt += "  cscript " + WScript.ScriptName + " <options>\n";
Packit Service a31ea6
	txt += "  cscript " + WScript.ScriptName + " help\n\n";
Packit Service a31ea6
	txt += "Options can be specified in the form <option>=<value>, where the value is\n";
Packit Service a31ea6
	txt += "either 'yes' or 'no', if not stated otherwise.\n\n";
Packit Service a31ea6
	txt += "\nXML processor options, default value given in parentheses:\n\n";
Packit Service a31ea6
	txt += "  trio:       Enable TRIO string manipulator (" + (withTrio? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  threads:    Enable thread safety [no|ctls|native|posix] (" + (withThreads)  + ") \n";
Packit Service a31ea6
	txt += "  ftp:        Enable FTP client (" + (withFtp? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  http:       Enable HTTP client (" + (withHttp? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  html:       Enable HTML processor (" + (withHtml? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  c14n:       Enable C14N support (" + (withC14n? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  catalog:    Enable catalog support (" + (withCatalog? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  docb:       Enable DocBook support (" + (withDocb? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  xpath:      Enable XPath support (" + (withXpath? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  xptr:       Enable XPointer support (" + (withXptr? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  xinclude:   Enable XInclude support (" + (withXinclude? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  iconv:      Enable iconv support (" + (withIconv? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  icu:        Enable icu support (" + (withIcu? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  iso8859x:   Enable ISO8859X support (" + (withIso8859x? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  zlib:       Enable zlib support (" + (withZlib? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  lzma:       Enable lzma support (" + (withLzma? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  xml_debug:  Enable XML debbugging module (" + (withDebug? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  mem_debug:  Enable memory debugger (" + (withMemDebug? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  run_debug:  Enable memory debugger (" + (withRunDebug? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  regexps:    Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  modules:    Enable module support (" + (withModules? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  tree:       Enable tree api (" + (withTree? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  reader:     Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  writer:     Enable xmlWriter api (" + (withWriter? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  walker:     Enable xmlDocWalker api (" + (withWalker? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  pattern:    Enable xmlPattern api (" + (withPattern? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  push:       Enable push api (" + (withPush? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  valid:      Enable DTD validation support (" + (withValid? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  sax1:       Enable SAX1 api (" + (withSax1? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  legacy:     Enable Deprecated api's (" + (withLegacy? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  output:     Enable serialization support (" + (withOutput? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  schemas:    Enable XML Schema support (" + (withSchemas? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  schematron: Enable Schematron support (" + (withSchematron? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  python:     Build Python bindings (" + (withPython? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "\nWin32 build options, default value given in parentheses:\n\n";
Packit Service a31ea6
	txt += "  compiler:   Compiler to be used [msvc|mingw|bcb] (" + compiler + ")\n";
Packit Service a31ea6
	txt += "  cruntime:   C-runtime compiler option (only msvc) (" + cruntime + ")\n";
Packit Service a31ea6
	txt += "  dynruntime: Use the dynamic RTL (only bcb) (" + dynruntime + ")\n";
Packit Service a31ea6
	txt += "  vcmanifest: Embed VC manifest (only msvc) (" + (vcmanifest? "yes" : "no") + ")\n";
Packit Service a31ea6
	txt += "  debug:      Build unoptimised debug executables (" + (buildDebug? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "  static:     Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no")  + ")\n";
Packit Service a31ea6
	txt += "              Note: automatically enabled if cruntime is not /MD or /MDd\n";
Packit Service a31ea6
	txt += "  prefix:     Base directory for the installation (" + buildPrefix + ")\n";
Packit Service a31ea6
	txt += "  bindir:     Directory where xmllint and friends should be installed\n";
Packit Service a31ea6
	txt += "              (" + buildBinPrefix + ")\n";
Packit Service a31ea6
	txt += "  incdir:     Directory where headers should be installed\n";
Packit Service a31ea6
	txt += "              (" + buildIncPrefix + ")\n";
Packit Service a31ea6
	txt += "  libdir:     Directory where static and import libraries should be\n";
Packit Service a31ea6
	txt += "              installed (" + buildLibPrefix + ")\n";
Packit Service a31ea6
	txt += "  sodir:      Directory where shared libraries should be installed\n"; 
Packit Service a31ea6
	txt += "              (" + buildSoPrefix + ")\n";
Packit Service a31ea6
	txt += "  include:    Additional search path for the compiler, particularily\n";
Packit Service a31ea6
	txt += "              where iconv headers can be found (" + buildInclude + ")\n";
Packit Service a31ea6
	txt += "  lib:        Additional search path for the linker, particularily\n";
Packit Service a31ea6
	txt += "              where iconv library can be found (" + buildLib + ")\n";
Packit Service a31ea6
	WScript.Echo(txt);
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
/* Discovers the version we are working with by reading the apropriate
Packit Service a31ea6
   configuration file. Despite its name, this also writes the configuration
Packit Service a31ea6
   file included by our makefile. */
Packit Service a31ea6
function discoverVersion()
Packit Service a31ea6
{
Packit Service a31ea6
	var fso, cf, vf, ln, s, iDot, iSlash;
Packit Service a31ea6
	fso = new ActiveXObject("Scripting.FileSystemObject");
Packit Service a31ea6
	verCvs = "";
Packit Service a31ea6
	if (useCvsVer && fso.FileExists("..\\CVS\\Entries")) {
Packit Service a31ea6
		cf = fso.OpenTextFile("..\\CVS\\Entries", 1);
Packit Service a31ea6
		while (cf.AtEndOfStream != true) {
Packit Service a31ea6
			ln = cf.ReadLine();
Packit Service a31ea6
			s = new String(ln);
Packit Service a31ea6
			if (s.search(/^\/ChangeLog\//) != -1) {
Packit Service a31ea6
				iDot = s.indexOf(".");
Packit Service a31ea6
				iSlash = s.indexOf("/", iDot);
Packit Service a31ea6
				verCvs = "CVS" + s.substring(iDot + 1, iSlash);
Packit Service a31ea6
				break;
Packit Service a31ea6
			}
Packit Service a31ea6
		}
Packit Service a31ea6
		cf.Close();
Packit Service a31ea6
	}
Packit Service a31ea6
	cf = fso.OpenTextFile(configFile, 1);
Packit Service a31ea6
	if (compiler == "msvc")
Packit Service a31ea6
		versionFile = ".\\config.msvc";
Packit Service a31ea6
	else if (compiler == "mingw")
Packit Service a31ea6
		versionFile = ".\\config.mingw";
Packit Service a31ea6
	else if (compiler == "bcb")
Packit Service a31ea6
		versionFile = ".\\config.bcb";
Packit Service a31ea6
	vf = fso.CreateTextFile(versionFile, true);
Packit Service a31ea6
	vf.WriteLine("# " + versionFile);
Packit Service a31ea6
	vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + ".");
Packit Service a31ea6
	vf.WriteBlankLines(1);
Packit Service a31ea6
	while (cf.AtEndOfStream != true) {
Packit Service a31ea6
		ln = cf.ReadLine();
Packit Service a31ea6
		s = new String(ln);
Packit Service a31ea6
		if (s.search(/^LIBXML_MAJOR_VERSION=/) != -1) {
Packit Service a31ea6
			vf.WriteLine(s);
Packit Service a31ea6
			verMajor = s.substring(s.indexOf("=") + 1, s.length)
Packit Service a31ea6
		} else if(s.search(/^LIBXML_MINOR_VERSION=/) != -1) {
Packit Service a31ea6
			vf.WriteLine(s);
Packit Service a31ea6
			verMinor = s.substring(s.indexOf("=") + 1, s.length)
Packit Service a31ea6
		} else if(s.search(/^LIBXML_MICRO_VERSION=/) != -1) {
Packit Service a31ea6
			vf.WriteLine(s);
Packit Service a31ea6
			verMicro = s.substring(s.indexOf("=") + 1, s.length)
Packit Service a31ea6
		} else if(s.search(/^LIBXML_MICRO_VERSION_SUFFIX=/) != -1) {
Packit Service a31ea6
			vf.WriteLine(s);
Packit Service a31ea6
			verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length)
Packit Service a31ea6
		}
Packit Service a31ea6
	}
Packit Service a31ea6
	cf.Close();
Packit Service a31ea6
	vf.WriteLine("XML_SRCDIR=" + srcDirXml);
Packit Service a31ea6
	vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils);
Packit Service a31ea6
	vf.WriteLine("WITH_TRIO=" + (withTrio? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_THREADS=" + withThreads);
Packit Service a31ea6
	vf.WriteLine("WITH_FTP=" + (withFtp? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_HTTP=" + (withHttp? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_HTML=" + (withHtml? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_C14N=" + (withC14n? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_CATALOG=" + (withCatalog? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_DOCB=" + (withDocb? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_XPATH=" + (withXpath? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_XPTR=" + (withXptr? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_XINCLUDE=" + (withXinclude? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_ICONV=" + (withIconv? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_ICU=" + (withIcu? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_ISO8859X=" + (withIso8859x? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_LZMA=" + (withLzma? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_DEBUG=" + (withDebug? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_RUN_DEBUG=" + (withRunDebug? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_SCHEMATRON=" + (withSchematron? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_READER=" + (withReader? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_WRITER=" + (withWriter? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_WALKER=" + (withWalker? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_PATTERN=" + (withPattern? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_PUSH=" + (withPush? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_VALID=" + (withValid? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_SAX1=" + (withSax1? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_LEGACY=" + (withLegacy? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_OUTPUT=" + (withOutput? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("WITH_PYTHON=" + (withPython? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
Packit Service a31ea6
	vf.WriteLine("PREFIX=" + buildPrefix);
Packit Service a31ea6
	vf.WriteLine("BINPREFIX=" + buildBinPrefix);
Packit Service a31ea6
	vf.WriteLine("INCPREFIX=" + buildIncPrefix);
Packit Service a31ea6
	vf.WriteLine("LIBPREFIX=" + buildLibPrefix);
Packit Service a31ea6
	vf.WriteLine("SOPREFIX=" + buildSoPrefix);
Packit Service a31ea6
	if (compiler == "msvc") {
Packit Service a31ea6
		vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
Packit Service a31ea6
		vf.WriteLine("LIB=$(LIB);" + buildLib);
Packit Service a31ea6
		vf.WriteLine("CRUNTIME=" + cruntime);
Packit Service a31ea6
		vf.WriteLine("VCMANIFEST=" + (vcmanifest? "1" : "0"));
Packit Service a31ea6
	} else if (compiler == "mingw") {
Packit Service a31ea6
		vf.WriteLine("INCLUDE+= -I" + buildInclude);
Packit Service a31ea6
		vf.WriteLine("LIB+= -L" + buildLib);
Packit Service a31ea6
	} else if (compiler == "bcb") {
Packit Service a31ea6
		vf.WriteLine("INCLUDE=" + buildInclude);
Packit Service a31ea6
		vf.WriteLine("LIB=" + buildLib);
Packit Service a31ea6
		vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
Packit Service a31ea6
	}
Packit Service a31ea6
	vf.Close();
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
/* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
Packit Service a31ea6
   taking what the user passed on the command line into account. */
Packit Service a31ea6
function configureLibxml()
Packit Service a31ea6
{
Packit Service a31ea6
	var fso, ofi, of, ln, s;
Packit Service a31ea6
	fso = new ActiveXObject("Scripting.FileSystemObject");
Packit Service a31ea6
	ofi = fso.OpenTextFile(optsFileIn, 1);
Packit Service a31ea6
	of = fso.CreateTextFile(optsFile, true);
Packit Service a31ea6
	while (ofi.AtEndOfStream != true) {
Packit Service a31ea6
		ln = ofi.ReadLine();
Packit Service a31ea6
		s = new String(ln);
Packit Service a31ea6
		if (s.search(/\@VERSION\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@VERSION\@/, 
Packit Service a31ea6
				verMajor + "." + verMinor + "." + verMicro + verMicroSuffix));
Packit Service a31ea6
		} else if (s.search(/\@LIBXML_VERSION_NUMBER\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@LIBXML_VERSION_NUMBER\@/, 
Packit Service a31ea6
				verMajor*10000 + verMinor*100 + verMicro*1));
Packit Service a31ea6
		} else if (s.search(/\@LIBXML_VERSION_EXTRA\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@LIBXML_VERSION_EXTRA\@/, verCvs));
Packit Service a31ea6
		} else if (s.search(/\@WITH_TRIO\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_TRIO\@/, withTrio? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_THREADS\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_THREAD_ALLOC\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_THREAD_ALLOC\@/, "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_FTP\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_FTP\@/, withFtp? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_HTTP\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_HTTP\@/, withHttp? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_HTML\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_HTML\@/, withHtml? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_C14N\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_C14N\@/, withC14n? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_CATALOG\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_CATALOG\@/, withCatalog? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_DOCB\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_DOCB\@/, withDocb? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_XPATH\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_XPATH\@/, withXpath? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_XPTR\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_XPTR\@/, withXptr? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_XINCLUDE\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_XINCLUDE\@/, withXinclude? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_ICONV\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_ICU\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_ISO8859X\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_ISO8859X\@/, withIso8859x? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_ZLIB\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_ZLIB\@/, withZlib? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_LZMA\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_LZMA\@/, withLzma? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_DEBUG\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_DEBUG\@/, withDebug? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_MEM_DEBUG\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_MEM_DEBUG\@/, withMemDebug? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_RUN_DEBUG\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_RUN_DEBUG\@/, withRunDebug? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_SCHEMAS\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_SCHEMAS\@/, withSchemas? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_SCHEMATRON\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_SCHEMATRON\@/, withSchematron? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_REGEXPS\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_REGEXPS\@/, withRegExps? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_MODULES\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@MODULE_EXTENSION\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@MODULE_EXTENSION\@/, ".dll"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_TREE\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_TREE\@/, withTree? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_READER\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_READER\@/, withReader? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_WRITER\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_WRITER\@/, withWriter? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_WALKER\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_WALKER\@/, withWalker? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_PATTERN\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_PATTERN\@/, withPattern? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_PUSH\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_PUSH\@/, withPush? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_VALID\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_VALID\@/, withValid? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_SAX1\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_SAX1\@/, withSax1? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_LEGACY\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_LEGACY\@/, withLegacy? "1" : "0"));
Packit Service a31ea6
		} else if (s.search(/\@WITH_OUTPUT\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_OUTPUT\@/, withOutput? "1" : "0"));
Packit Service a31ea6
		} else
Packit Service a31ea6
			of.WriteLine(ln);
Packit Service a31ea6
	}
Packit Service a31ea6
	ofi.Close();
Packit Service a31ea6
	of.Close();
Packit Service a31ea6
}
Packit Service a31ea6
/* Configures Python bindings. Otherwise identical to the above */
Packit Service a31ea6
function configureLibxmlPy()
Packit Service a31ea6
{
Packit Service a31ea6
	var pyOptsFileIn = srcDirXml + "\\python\\setup.py.in";
Packit Service a31ea6
	var pyOptsFile = srcDirXml + "\\python\\setup.py";
Packit Service a31ea6
	var fso, ofi, of, ln, s;
Packit Service a31ea6
	fso = new ActiveXObject("Scripting.FileSystemObject");
Packit Service a31ea6
	ofi = fso.OpenTextFile(pyOptsFileIn, 1);
Packit Service a31ea6
	of = fso.CreateTextFile(pyOptsFile, true);
Packit Service a31ea6
	while (ofi.AtEndOfStream != true) {
Packit Service a31ea6
		ln = ofi.ReadLine();
Packit Service a31ea6
		s = new String(ln);
Packit Service a31ea6
		if (s.search(/\@LIBXML_VERSION\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@LIBXML_VERSION\@/, 
Packit Service a31ea6
				verMajor + "." + verMinor + "." + verMicro));
Packit Service a31ea6
		} else if (s.search(/\@prefix\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@prefix\@/, buildPrefix));
Packit Service a31ea6
		} else if (s.search(/\@WITH_THREADS\@/) != -1) {
Packit Service a31ea6
			of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
Packit Service a31ea6
		} else
Packit Service a31ea6
			of.WriteLine(ln);
Packit Service a31ea6
	}
Packit Service a31ea6
	ofi.Close();
Packit Service a31ea6
	of.Close();
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
/* Creates the readme file for the binary distribution of 'bname', for the
Packit Service a31ea6
   version 'ver' in the file 'file'. This one is called from the Makefile when
Packit Service a31ea6
   generating a binary distribution. The parameters are passed by make. */
Packit Service a31ea6
function genReadme(bname, ver, file)
Packit Service a31ea6
{
Packit Service a31ea6
	var fso, f;
Packit Service a31ea6
	fso = new ActiveXObject("Scripting.FileSystemObject");
Packit Service a31ea6
	f = fso.CreateTextFile(file, true);
Packit Service a31ea6
	f.WriteLine("  " + bname + " " + ver);
Packit Service a31ea6
	f.WriteLine("  --------------");
Packit Service a31ea6
	f.WriteBlankLines(1);
Packit Service a31ea6
	f.WriteLine("  This is " + bname + ", version " + ver + ", binary package for the native Win32/IA32");
Packit Service a31ea6
	f.WriteLine("platform.");
Packit Service a31ea6
	f.WriteBlankLines(1);
Packit Service a31ea6
	f.WriteLine("  The files in this package do not require any special installation");
Packit Service a31ea6
	f.WriteLine("steps. Extract the contents of the archive whereever you wish and");
Packit Service a31ea6
	f.WriteLine("make sure that your tools which use " + bname + " can find it.");
Packit Service a31ea6
	f.WriteBlankLines(1);
Packit Service a31ea6
	f.WriteLine("  For example, if you want to run the supplied utilities from the command");
Packit Service a31ea6
	f.WriteLine("line, you can, if you wish, add the 'bin' subdirectory to the PATH");
Packit Service a31ea6
	f.WriteLine("environment variable.");
Packit Service a31ea6
	f.WriteLine("  If you want to make programmes in C which use " + bname + ", you'll");
Packit Service a31ea6
	f.WriteLine("likely know how to use the contents of this package. If you don't, please");
Packit Service a31ea6
	f.WriteLine("refer to your compiler's documentation."); 
Packit Service a31ea6
	f.WriteBlankLines(1);
Packit Service a31ea6
	f.WriteLine("  If there is something you cannot keep for yourself, such as a problem,");
Packit Service a31ea6
	f.WriteLine("a cheer of joy, a comment or a suggestion, feel free to contact me using");
Packit Service a31ea6
	f.WriteLine("the address below.");
Packit Service a31ea6
	f.WriteBlankLines(1);
Packit Service a31ea6
	f.WriteLine("                              Igor Zlatkovic (igor@zlatkovic.com)");
Packit Service a31ea6
	f.Close();
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
/*
Packit Service a31ea6
 * main(),
Packit Service a31ea6
 * Execution begins here.
Packit Service a31ea6
 */
Packit Service a31ea6
Packit Service a31ea6
// Parse the command-line arguments.
Packit Service a31ea6
for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
Packit Service a31ea6
	var arg, opt;
Packit Service a31ea6
	arg = WScript.Arguments(i);
Packit Service a31ea6
	opt = arg.substring(0, arg.indexOf("="));
Packit Service a31ea6
	if (opt.length == 0)
Packit Service a31ea6
		opt = arg.substring(0, arg.indexOf(":"));
Packit Service a31ea6
	if (opt.length > 0) {
Packit Service a31ea6
		if (opt == "trio")
Packit Service a31ea6
			withTrio = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "threads")
Packit Service a31ea6
			withThreads = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "ftp")
Packit Service a31ea6
			withFtp = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "http")
Packit Service a31ea6
			withHttp = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "html")
Packit Service a31ea6
			withHtml = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "c14n")
Packit Service a31ea6
			withC14n = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "catalog")
Packit Service a31ea6
			withCatalog = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "docb")
Packit Service a31ea6
			withDocb = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "xpath")
Packit Service a31ea6
			withXpath = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "xptr")
Packit Service a31ea6
			withXptr = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "xinclude")
Packit Service a31ea6
			withXinclude = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "iconv")
Packit Service a31ea6
			withIconv = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "icu")
Packit Service a31ea6
			withIcu = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "iso8859x")
Packit Service a31ea6
			withIso8859x = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "zlib")
Packit Service a31ea6
			withZlib = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "lzma")
Packit Service a31ea6
			withLzma = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "xml_debug")
Packit Service a31ea6
			withDebug = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "mem_debug")
Packit Service a31ea6
			withMemDebug = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "run_debug")
Packit Service a31ea6
			withRunDebug = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "schemas")
Packit Service a31ea6
			withSchemas = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "schematron")
Packit Service a31ea6
			withSchematron = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "regexps")
Packit Service a31ea6
			withRegExps = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "modules")
Packit Service a31ea6
			withModules = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "tree")
Packit Service a31ea6
			withTree = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "reader")
Packit Service a31ea6
			withReader = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "writer")
Packit Service a31ea6
			withWriter = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "walker")
Packit Service a31ea6
			withWalker = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "pattern")
Packit Service a31ea6
			withPattern = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "push")
Packit Service a31ea6
			withPush = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "valid")
Packit Service a31ea6
			withValid = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "sax1")
Packit Service a31ea6
			withSax1 = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "legacy")
Packit Service a31ea6
			withLegacy = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "output")
Packit Service a31ea6
			withOutput = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "python")
Packit Service a31ea6
			withPython = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "compiler")
Packit Service a31ea6
			compiler = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "cruntime")
Packit Service a31ea6
			cruntime = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "dynruntime")
Packit Service a31ea6
			dynruntime = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "vcmanifest")
Packit Service a31ea6
			vcmanifest = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "debug")
Packit Service a31ea6
			buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "static")
Packit Service a31ea6
			buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
Packit Service a31ea6
		else if (opt == "prefix")
Packit Service a31ea6
			buildPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "incdir")
Packit Service a31ea6
			buildIncPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "bindir")
Packit Service a31ea6
			buildBinPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "libdir")
Packit Service a31ea6
			buildLibPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "sodir")
Packit Service a31ea6
			buildSoPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "incdir")
Packit Service a31ea6
			buildIncPrefix = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "include")
Packit Service a31ea6
			buildInclude = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "lib")
Packit Service a31ea6
			buildLib = arg.substring(opt.length + 1, arg.length);
Packit Service a31ea6
		else if (opt == "release")
Packit Service a31ea6
			useCvsVer = false;
Packit Service a31ea6
		else
Packit Service a31ea6
			error = 1;
Packit Service a31ea6
	} else if (i == 0) {
Packit Service a31ea6
		if (arg == "genreadme") {
Packit Service a31ea6
			// This command comes from the Makefile and will not be checked
Packit Service a31ea6
			// for errors, because Makefile will always supply right the parameters.
Packit Service a31ea6
			genReadme(WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3));
Packit Service a31ea6
			WScript.Quit(0);
Packit Service a31ea6
		} else if (arg == "help") {
Packit Service a31ea6
			usage();
Packit Service a31ea6
			WScript.Quit(0);
Packit Service a31ea6
		}
Packit Service a31ea6
Packit Service a31ea6
	} else {
Packit Service a31ea6
		error = 1;
Packit Service a31ea6
	}
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
// If we fail here, it is because the user supplied an unrecognised argument.
Packit Service a31ea6
if (error != 0) {
Packit Service a31ea6
	usage();
Packit Service a31ea6
	WScript.Quit(error);
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
// if user choses to link the c-runtime library statically into libxml2
Packit Service a31ea6
// with /MT and friends, then we need to enable static linking for xmllint
Packit Service a31ea6
if (cruntime == "/MT" || cruntime == "/MTd" ||
Packit Service a31ea6
		cruntime == "/ML" || cruntime == "/MLd") {
Packit Service a31ea6
	buildStatic = 1;
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
dirSep = "\\";
Packit Service a31ea6
if (buildBinPrefix == "")
Packit Service a31ea6
	buildBinPrefix = "$(PREFIX)" + dirSep + "bin";
Packit Service a31ea6
if (buildIncPrefix == "")
Packit Service a31ea6
	buildIncPrefix = "$(PREFIX)" + dirSep + "include";
Packit Service a31ea6
if (buildLibPrefix == "")
Packit Service a31ea6
	buildLibPrefix = "$(PREFIX)" + dirSep + "lib";
Packit Service a31ea6
if (buildSoPrefix == "")
Packit Service a31ea6
	buildSoPrefix = "$(PREFIX)" + dirSep + "bin";
Packit Service a31ea6
Packit Service a31ea6
// Discover the version.
Packit Service a31ea6
discoverVersion();
Packit Service a31ea6
if (error != 0) {
Packit Service a31ea6
	WScript.Echo("Version discovery failed, aborting.");
Packit Service a31ea6
	WScript.Quit(error);
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
var outVerString = baseName + " version: " + verMajor + "." + verMinor + "." + verMicro;
Packit Service a31ea6
if (verMicroSuffix && verMicroSuffix != "")
Packit Service a31ea6
	outVerString += "-" + verMicroSuffix;
Packit Service a31ea6
if (verCvs && verCvs != "")
Packit Service a31ea6
	outVerString += "-" + verCvs;
Packit Service a31ea6
WScript.Echo(outVerString);
Packit Service a31ea6
Packit Service a31ea6
// Configure libxml.
Packit Service a31ea6
configureLibxml();
Packit Service a31ea6
if (error != 0) {
Packit Service a31ea6
	WScript.Echo("Configuration failed, aborting.");
Packit Service a31ea6
	WScript.Quit(error);
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
if (withPython == true) {
Packit Service a31ea6
	configureLibxmlPy();
Packit Service a31ea6
	if (error != 0) {
Packit Service a31ea6
		WScript.Echo("Configuration failed, aborting.");
Packit Service a31ea6
		WScript.Quit(error);
Packit Service a31ea6
	}
Packit Service a31ea6
Packit Service a31ea6
}
Packit Service a31ea6
Packit Service a31ea6
// Create the makefile.
Packit Service a31ea6
var fso = new ActiveXObject("Scripting.FileSystemObject");
Packit Service a31ea6
var makefile = ".\\Makefile.msvc";
Packit Service a31ea6
if (compiler == "mingw")
Packit Service a31ea6
	makefile = ".\\Makefile.mingw";
Packit Service a31ea6
else if (compiler == "bcb")
Packit Service a31ea6
	makefile = ".\\Makefile.bcb";
Packit Service a31ea6
var new_makefile = ".\\Makefile";
Packit Service a31ea6
var f = fso.FileExists(new_makefile);
Packit Service a31ea6
if (f) {
Packit Service a31ea6
       var t = fso.GetFile(new_makefile);
Packit Service a31ea6
       t.Attributes =0;
Packit Service a31ea6
}
Packit Service a31ea6
fso.CopyFile(makefile, new_makefile, true);
Packit Service a31ea6
WScript.Echo("Created Makefile.");
Packit Service a31ea6
// Create the config.h.
Packit Service a31ea6
var confighsrc = "..\\include\\win32config.h";
Packit Service a31ea6
var configh = "..\\config.h";
Packit Service a31ea6
var f = fso.FileExists(configh);
Packit Service a31ea6
if (f) {
Packit Service a31ea6
	var t = fso.GetFile(configh);
Packit Service a31ea6
	t.Attributes =0;
Packit Service a31ea6
}
Packit Service a31ea6
fso.CopyFile(confighsrc, configh, true);
Packit Service a31ea6
WScript.Echo("Created config.h.");
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
// Display the final configuration. 
Packit Service a31ea6
var txtOut = "\nXML processor configuration\n";
Packit Service a31ea6
txtOut += "---------------------------\n";
Packit Service a31ea6
txtOut += "              Trio: " + boolToStr(withTrio) + "\n";
Packit Service a31ea6
txtOut += "     Thread safety: " + withThreads + "\n";
Packit Service a31ea6
txtOut += "        FTP client: " + boolToStr(withFtp) + "\n";
Packit Service a31ea6
txtOut += "       HTTP client: " + boolToStr(withHttp) + "\n";
Packit Service a31ea6
txtOut += "    HTML processor: " + boolToStr(withHtml) + "\n";
Packit Service a31ea6
txtOut += "      C14N support: " + boolToStr(withC14n) + "\n";
Packit Service a31ea6
txtOut += "   Catalog support: " + boolToStr(withCatalog) + "\n";
Packit Service a31ea6
txtOut += "   DocBook support: " + boolToStr(withDocb) + "\n";
Packit Service a31ea6
txtOut += "     XPath support: " + boolToStr(withXpath) + "\n";
Packit Service a31ea6
txtOut += "  XPointer support: " + boolToStr(withXptr) + "\n";
Packit Service a31ea6
txtOut += "  XInclude support: " + boolToStr(withXinclude) + "\n";
Packit Service a31ea6
txtOut += "     iconv support: " + boolToStr(withIconv) + "\n";
Packit Service a31ea6
txtOut += "     icu   support: " + boolToStr(withIcu) + "\n";
Packit Service a31ea6
txtOut += "  iso8859x support: " + boolToStr(withIso8859x) + "\n";
Packit Service a31ea6
txtOut += "      zlib support: " + boolToStr(withZlib) + "\n";
Packit Service a31ea6
txtOut += "      lzma support: " + boolToStr(withLzma) + "\n";
Packit Service a31ea6
txtOut += "  Debugging module: " + boolToStr(withDebug) + "\n";
Packit Service a31ea6
txtOut += "  Memory debugging: " + boolToStr(withMemDebug) + "\n";
Packit Service a31ea6
txtOut += " Runtime debugging: " + boolToStr(withRunDebug) + "\n";
Packit Service a31ea6
txtOut += "    Regexp support: " + boolToStr(withRegExps) + "\n";
Packit Service a31ea6
txtOut += "    Module support: " + boolToStr(withModules) + "\n";
Packit Service a31ea6
txtOut += "      Tree support: " + boolToStr(withTree) + "\n";
Packit Service a31ea6
txtOut += "    Reader support: " + boolToStr(withReader) + "\n";
Packit Service a31ea6
txtOut += "    Writer support: " + boolToStr(withWriter) + "\n";
Packit Service a31ea6
txtOut += "    Walker support: " + boolToStr(withWalker) + "\n";
Packit Service a31ea6
txtOut += "   Pattern support: " + boolToStr(withPattern) + "\n";
Packit Service a31ea6
txtOut += "      Push support: " + boolToStr(withPush) + "\n";
Packit Service a31ea6
txtOut += "Validation support: " + boolToStr(withValid) + "\n";
Packit Service a31ea6
txtOut += "      SAX1 support: " + boolToStr(withSax1) + "\n";
Packit Service a31ea6
txtOut += "    Legacy support: " + boolToStr(withLegacy) + "\n";
Packit Service a31ea6
txtOut += "    Output support: " + boolToStr(withOutput) + "\n";
Packit Service a31ea6
txtOut += "XML Schema support: " + boolToStr(withSchemas) + "\n";
Packit Service a31ea6
txtOut += "Schematron support: " + boolToStr(withSchematron) + "\n";
Packit Service a31ea6
txtOut += "   Python bindings: " + boolToStr(withPython) + "\n";
Packit Service a31ea6
txtOut += "\n";
Packit Service a31ea6
txtOut += "Win32 build configuration\n";
Packit Service a31ea6
txtOut += "-------------------------\n";
Packit Service a31ea6
txtOut += "          Compiler: " + compiler + "\n";
Packit Service a31ea6
if (compiler == "msvc") {
Packit Service a31ea6
	txtOut += "  C-Runtime option: " + cruntime + "\n";
Packit Service a31ea6
	txtOut += "    Embed Manifest: " + boolToStr(vcmanifest) + "\n";
Packit Service a31ea6
} else if (compiler == "bcb")
Packit Service a31ea6
	txtOut += "   Use dynamic RTL: " + dynruntime + "\n";
Packit Service a31ea6
txtOut += "     Debug symbols: " + boolToStr(buildDebug) + "\n";
Packit Service a31ea6
txtOut += "    Static xmllint: " + boolToStr(buildStatic) + "\n";
Packit Service a31ea6
txtOut += "    Install prefix: " + buildPrefix + "\n";
Packit Service a31ea6
txtOut += "      Put tools in: " + buildBinPrefix + "\n";
Packit Service a31ea6
txtOut += "    Put headers in: " + buildIncPrefix + "\n";
Packit Service a31ea6
txtOut += "Put static libs in: " + buildLibPrefix + "\n";
Packit Service a31ea6
txtOut += "Put shared libs in: " + buildSoPrefix + "\n";
Packit Service a31ea6
txtOut += "      Include path: " + buildInclude + "\n";
Packit Service a31ea6
txtOut += "          Lib path: " + buildLib + "\n";
Packit Service a31ea6
WScript.Echo(txtOut);
Packit Service a31ea6
Packit Service a31ea6
//
Packit Service a31ea6