VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/win32/configure.js@ 104195

最後變更 在這個檔案從104195是 104106,由 vboxsync 提交於 11 月 前

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

檔案大小: 30.4 KB
 
1/* Configure script for libxml, specific for Windows with Scripting Host.
2 *
3 * This script will configure the libxml build process and create necessary files.
4 * Run it with an 'help', or an invalid option and it will tell you what options
5 * it accepts.
6 *
7 * March 2002, Igor Zlatkovic <[email protected]>
8 */
9
10/* The source directory, relative to the one where this file resides. */
11var srcDirXml = "..";
12var srcDirUtils = "..";
13/* Base name of what we are building. */
14var baseName = "libxml2";
15/* Configure file which contains the version and the output file where
16 we can store our build configuration. */
17var configFile = srcDirXml + "\\configure.ac";
18var versionFile = ".\\config.msvc";
19/* Input and output files regarding the libxml features. */
20var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in";
21var optsFile = srcDirXml + "\\include\\libxml\\xmlversion.h";
22/* Version strings for the binary distribution. Will be filled later
23 in the code. */
24var verMajor;
25var verMinor;
26var verMicro;
27var verMicroSuffix;
28var verCvs;
29var useCvsVer = true;
30/* Libxml features. */
31var withTrio = false;
32var withThreads = "native";
33var withFtp = true;
34var withHttp = true;
35var withHtml = true;
36var withC14n = true;
37var withCatalog = true;
38var withXpath = true;
39var withXptr = true;
40var withXptrLocs = false;
41var withXinclude = true;
42var withIconv = true;
43var withIcu = false;
44var withIso8859x = false;
45var withZlib = false;
46var withLzma = false;
47var withDebug = true;
48var withMemDebug = false;
49var withSchemas = true;
50var withSchematron = true;
51var withRegExps = true;
52var withModules = true;
53var withTree = true;
54var withReader = true;
55var withWriter = true;
56var withWalker = true;
57var withPattern = true;
58var withPush = true;
59var withValid = true;
60var withSax1 = true;
61var withLegacy = true;
62var withOutput = true;
63var withPython = false;
64/* Win32 build options. */
65var dirSep = "\\";
66var compiler = "msvc";
67var cruntime = "/MD";
68var dynruntime = true;
69var vcmanifest = false;
70var buildDebug = 0;
71var buildStatic = 0;
72var buildPrefix = ".";
73var buildBinPrefix = "";
74var buildIncPrefix = "";
75var buildLibPrefix = "";
76var buildSoPrefix = "";
77var buildInclude = ".";
78var buildLib = ".";
79/* Local stuff */
80var error = 0;
81
82/* Helper function, transforms the option variable into the 'Enabled'
83 or 'Disabled' string. */
84function boolToStr(opt)
85{
86 if (opt == false)
87 return "no";
88 else if (opt == true)
89 return "yes";
90 error = 1;
91 return "*** undefined ***";
92}
93
94/* Helper function, transforms the argument string into a boolean
95 value. */
96function strToBool(opt)
97{
98 if (opt == 0 || opt == "no")
99 return false;
100 else if (opt == 1 || opt == "yes")
101 return true;
102 error = 1;
103 return false;
104}
105
106/* Displays the details about how to use this script. */
107function usage()
108{
109 var txt;
110 txt = "Usage:\n";
111 txt += " cscript " + WScript.ScriptName + " <options>\n";
112 txt += " cscript " + WScript.ScriptName + " help\n\n";
113 txt += "Options can be specified in the form <option>=<value>, where the value is\n";
114 txt += "either 'yes' or 'no', if not stated otherwise.\n\n";
115 txt += "\nXML processor options, default value given in parentheses:\n\n";
116 txt += " trio: Enable TRIO string manipulator (" + (withTrio? "yes" : "no") + ")\n";
117 txt += " threads: Enable thread safety [no|ctls|native|posix] (" + (withThreads) + ") \n";
118 txt += " ftp: Enable FTP client (" + (withFtp? "yes" : "no") + ")\n";
119 txt += " http: Enable HTTP client (" + (withHttp? "yes" : "no") + ")\n";
120 txt += " html: Enable HTML processor (" + (withHtml? "yes" : "no") + ")\n";
121 txt += " c14n: Enable C14N support (" + (withC14n? "yes" : "no") + ")\n";
122 txt += " catalog: Enable catalog support (" + (withCatalog? "yes" : "no") + ")\n";
123 txt += " xpath: Enable XPath support (" + (withXpath? "yes" : "no") + ")\n";
124 txt += " xptr: Enable XPointer support (" + (withXptr? "yes" : "no") + ")\n";
125 txt += " xptr_locs: Enable XPointer locs support (" + (withXptrLocs? "yes" : "no") + ")\n";
126 txt += " xinclude: Enable XInclude support (" + (withXinclude? "yes" : "no") + ")\n";
127 txt += " iconv: Enable iconv support (" + (withIconv? "yes" : "no") + ")\n";
128 txt += " icu: Enable icu support (" + (withIcu? "yes" : "no") + ")\n";
129 txt += " iso8859x: Enable ISO8859X support (" + (withIso8859x? "yes" : "no") + ")\n";
130 txt += " zlib: Enable zlib support (" + (withZlib? "yes" : "no") + ")\n";
131 txt += " lzma: Enable lzma support (" + (withLzma? "yes" : "no") + ")\n";
132 txt += " xml_debug: Enable XML debbugging module (" + (withDebug? "yes" : "no") + ")\n";
133 txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n";
134 txt += " regexps: Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
135 txt += " modules: Enable module support (" + (withModules? "yes" : "no") + ")\n";
136 txt += " tree: Enable tree api (" + (withTree? "yes" : "no") + ")\n";
137 txt += " reader: Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n";
138 txt += " writer: Enable xmlWriter api (" + (withWriter? "yes" : "no") + ")\n";
139 txt += " walker: Enable xmlDocWalker api (" + (withWalker? "yes" : "no") + ")\n";
140 txt += " pattern: Enable xmlPattern api (" + (withPattern? "yes" : "no") + ")\n";
141 txt += " push: Enable push api (" + (withPush? "yes" : "no") + ")\n";
142 txt += " valid: Enable DTD validation support (" + (withValid? "yes" : "no") + ")\n";
143 txt += " sax1: Enable SAX1 api (" + (withSax1? "yes" : "no") + ")\n";
144 txt += " legacy: Enable Deprecated api's (" + (withLegacy? "yes" : "no") + ")\n";
145 txt += " output: Enable serialization support (" + (withOutput? "yes" : "no") + ")\n";
146 txt += " schemas: Enable XML Schema support (" + (withSchemas? "yes" : "no") + ")\n";
147 txt += " schematron: Enable Schematron support (" + (withSchematron? "yes" : "no") + ")\n";
148 txt += " python: Build Python bindings (" + (withPython? "yes" : "no") + ")\n";
149 txt += "\nWin32 build options, default value given in parentheses:\n\n";
150 txt += " compiler: Compiler to be used [msvc|mingw|bcb] (" + compiler + ")\n";
151 txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n";
152 txt += " dynruntime: Use the dynamic RTL (only bcb) (" + dynruntime + ")\n";
153 txt += " vcmanifest: Embed VC manifest (only msvc) (" + (vcmanifest? "yes" : "no") + ")\n";
154 txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
155 txt += " static: Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no") + ")\n";
156 txt += " Note: automatically enabled if cruntime is not /MD or /MDd\n";
157 txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n";
158 txt += " bindir: Directory where xmllint and friends should be installed\n";
159 txt += " (" + buildBinPrefix + ")\n";
160 txt += " incdir: Directory where headers should be installed\n";
161 txt += " (" + buildIncPrefix + ")\n";
162 txt += " libdir: Directory where static and import libraries should be\n";
163 txt += " installed (" + buildLibPrefix + ")\n";
164 txt += " sodir: Directory where shared libraries should be installed\n";
165 txt += " (" + buildSoPrefix + ")\n";
166 txt += " include: Additional search path for the compiler, particularly\n";
167 txt += " where iconv headers can be found (" + buildInclude + ")\n";
168 txt += " lib: Additional search path for the linker, particularly\n";
169 txt += " where iconv library can be found (" + buildLib + ")\n";
170 WScript.Echo(txt);
171}
172
173/* Discovers the version we are working with by reading the appropriate
174 configuration file. Despite its name, this also writes the configuration
175 file included by our makefile. */
176function discoverVersion()
177{
178 var fso, cf, vf, ln, s, iDot, iSlash;
179 fso = new ActiveXObject("Scripting.FileSystemObject");
180 verCvs = "";
181 cf = fso.OpenTextFile(configFile, 1);
182 if (compiler == "msvc")
183 versionFile = ".\\config.msvc";
184 else if (compiler == "mingw")
185 versionFile = ".\\config.mingw";
186 else if (compiler == "bcb")
187 versionFile = ".\\config.bcb";
188 vf = fso.CreateTextFile(versionFile, true);
189 vf.WriteLine("# " + versionFile);
190 vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + ".");
191 vf.WriteBlankLines(1);
192 while (cf.AtEndOfStream != true) {
193 ln = cf.ReadLine();
194 s = new String(ln);
195 if (m = s.match(/^m4_define\(\[MAJOR_VERSION\], (\w+)\)/)) {
196 vf.WriteLine("LIBXML_MAJOR_VERSION=" + m[1]);
197 verMajor = m[1];
198 } else if(m = s.match(/^m4_define\(\[MINOR_VERSION\], (\w+)\)/)) {
199 vf.WriteLine("LIBXML_MINOR_VERSION=" + m[1]);
200 verMinor = m[1];
201 } else if(m = s.match(/^m4_define\(\[MICRO_VERSION\], (\w+)\)/)) {
202 vf.WriteLine("LIBXML_MICRO_VERSION=" + m[1]);
203 verMicro = m[1];
204 } else if(s.search(/^LIBXML_MICRO_VERSION_SUFFIX=/) != -1) {
205 vf.WriteLine(s);
206 verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length);
207 }
208 }
209 cf.Close();
210 vf.WriteLine("XML_SRCDIR=" + srcDirXml);
211 vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils);
212 vf.WriteLine("WITH_TRIO=" + (withTrio? "1" : "0"));
213 vf.WriteLine("WITH_THREADS=" + withThreads);
214 vf.WriteLine("WITH_FTP=" + (withFtp? "1" : "0"));
215 vf.WriteLine("WITH_HTTP=" + (withHttp? "1" : "0"));
216 vf.WriteLine("WITH_HTML=" + (withHtml? "1" : "0"));
217 vf.WriteLine("WITH_C14N=" + (withC14n? "1" : "0"));
218 vf.WriteLine("WITH_CATALOG=" + (withCatalog? "1" : "0"));
219 vf.WriteLine("WITH_XPATH=" + (withXpath? "1" : "0"));
220 vf.WriteLine("WITH_XPTR=" + (withXptr? "1" : "0"));
221 vf.WriteLine("WITH_XPTR_LOCS=" + (withXptrLocs? "1" : "0"));
222 vf.WriteLine("WITH_XINCLUDE=" + (withXinclude? "1" : "0"));
223 vf.WriteLine("WITH_ICONV=" + (withIconv? "1" : "0"));
224 vf.WriteLine("WITH_ICU=" + (withIcu? "1" : "0"));
225 vf.WriteLine("WITH_ISO8859X=" + (withIso8859x? "1" : "0"));
226 vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0"));
227 vf.WriteLine("WITH_LZMA=" + (withLzma? "1" : "0"));
228 vf.WriteLine("WITH_DEBUG=" + (withDebug? "1" : "0"));
229 vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0"));
230 vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
231 vf.WriteLine("WITH_SCHEMATRON=" + (withSchematron? "1" : "0"));
232 vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
233 vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
234 vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0"));
235 vf.WriteLine("WITH_READER=" + (withReader? "1" : "0"));
236 vf.WriteLine("WITH_WRITER=" + (withWriter? "1" : "0"));
237 vf.WriteLine("WITH_WALKER=" + (withWalker? "1" : "0"));
238 vf.WriteLine("WITH_PATTERN=" + (withPattern? "1" : "0"));
239 vf.WriteLine("WITH_PUSH=" + (withPush? "1" : "0"));
240 vf.WriteLine("WITH_VALID=" + (withValid? "1" : "0"));
241 vf.WriteLine("WITH_SAX1=" + (withSax1? "1" : "0"));
242 vf.WriteLine("WITH_LEGACY=" + (withLegacy? "1" : "0"));
243 vf.WriteLine("WITH_OUTPUT=" + (withOutput? "1" : "0"));
244 vf.WriteLine("WITH_PYTHON=" + (withPython? "1" : "0"));
245 vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
246 vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
247 vf.WriteLine("PREFIX=" + buildPrefix);
248 vf.WriteLine("BINPREFIX=" + buildBinPrefix);
249 vf.WriteLine("INCPREFIX=" + buildIncPrefix);
250 vf.WriteLine("LIBPREFIX=" + buildLibPrefix);
251 vf.WriteLine("SOPREFIX=" + buildSoPrefix);
252 if (compiler == "msvc") {
253 vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
254 vf.WriteLine("LIB=$(LIB);" + buildLib);
255 vf.WriteLine("CRUNTIME=" + cruntime);
256 vf.WriteLine("VCMANIFEST=" + (vcmanifest? "1" : "0"));
257 } else if (compiler == "mingw") {
258 vf.WriteLine("INCLUDE+= -I" + buildInclude);
259 vf.WriteLine("LIB+= -L" + buildLib);
260 } else if (compiler == "bcb") {
261 vf.WriteLine("INCLUDE=" + buildInclude);
262 vf.WriteLine("LIB=" + buildLib);
263 vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
264 }
265 vf.Close();
266 versionFile = "rcVersion.h";
267 vf = fso.CreateTextFile(versionFile, true);
268 vf.WriteLine("/*");
269 vf.WriteLine(" " + versionFile);
270 vf.WriteLine(" This file is generated automatically by " + WScript.ScriptName + ".");
271 vf.WriteLine("*/");
272 vf.WriteBlankLines(1);
273 vf.WriteLine("#define LIBXML_MAJOR_VERSION " + verMajor);
274 vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
275 vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
276 vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + "\"");
277 vf.Close();
278}
279
280/* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
281 taking what the user passed on the command line into account. */
282function configureLibxml()
283{
284 var fso, ofi, of, ln, s;
285 fso = new ActiveXObject("Scripting.FileSystemObject");
286 ofi = fso.OpenTextFile(optsFileIn, 1);
287 of = fso.CreateTextFile(optsFile, true);
288 while (ofi.AtEndOfStream != true) {
289 ln = ofi.ReadLine();
290 s = new String(ln);
291 if (s.search(/\@VERSION\@/) != -1) {
292 of.WriteLine(s.replace(/\@VERSION\@/,
293 verMajor + "." + verMinor + "." + verMicro + verMicroSuffix));
294 } else if (s.search(/\@LIBXML_VERSION_NUMBER\@/) != -1) {
295 of.WriteLine(s.replace(/\@LIBXML_VERSION_NUMBER\@/,
296 verMajor*10000 + verMinor*100 + verMicro*1));
297 } else if (s.search(/\@LIBXML_VERSION_EXTRA\@/) != -1) {
298 of.WriteLine(s.replace(/\@LIBXML_VERSION_EXTRA\@/, verCvs));
299 } else if (s.search(/\@WITH_TRIO\@/) != -1) {
300 of.WriteLine(s.replace(/\@WITH_TRIO\@/, withTrio? "1" : "0"));
301 } else if (s.search(/\@WITH_THREADS\@/) != -1) {
302 of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
303 } else if (s.search(/\@WITH_THREAD_ALLOC\@/) != -1) {
304 of.WriteLine(s.replace(/\@WITH_THREAD_ALLOC\@/, "0"));
305 } else if (s.search(/\@WITH_FTP\@/) != -1) {
306 of.WriteLine(s.replace(/\@WITH_FTP\@/, withFtp? "1" : "0"));
307 } else if (s.search(/\@WITH_HTTP\@/) != -1) {
308 of.WriteLine(s.replace(/\@WITH_HTTP\@/, withHttp? "1" : "0"));
309 } else if (s.search(/\@WITH_HTML\@/) != -1) {
310 of.WriteLine(s.replace(/\@WITH_HTML\@/, withHtml? "1" : "0"));
311 } else if (s.search(/\@WITH_C14N\@/) != -1) {
312 of.WriteLine(s.replace(/\@WITH_C14N\@/, withC14n? "1" : "0"));
313 } else if (s.search(/\@WITH_CATALOG\@/) != -1) {
314 of.WriteLine(s.replace(/\@WITH_CATALOG\@/, withCatalog? "1" : "0"));
315 } else if (s.search(/\@WITH_XPATH\@/) != -1) {
316 of.WriteLine(s.replace(/\@WITH_XPATH\@/, withXpath? "1" : "0"));
317 } else if (s.search(/\@WITH_XPTR\@/) != -1) {
318 of.WriteLine(s.replace(/\@WITH_XPTR\@/, withXptr? "1" : "0"));
319 } else if (s.search(/\@WITH_XPTR_LOCS\@/) != -1) {
320 of.WriteLine(s.replace(/\@WITH_XPTR_LOCS\@/, withXptrLocs? "1" : "0"));
321 } else if (s.search(/\@WITH_XINCLUDE\@/) != -1) {
322 of.WriteLine(s.replace(/\@WITH_XINCLUDE\@/, withXinclude? "1" : "0"));
323 } else if (s.search(/\@WITH_ICONV\@/) != -1) {
324 of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0"));
325 } else if (s.search(/\@WITH_ICU\@/) != -1) {
326 of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0"));
327 } else if (s.search(/\@WITH_ISO8859X\@/) != -1) {
328 of.WriteLine(s.replace(/\@WITH_ISO8859X\@/, withIso8859x? "1" : "0"));
329 } else if (s.search(/\@WITH_ZLIB\@/) != -1) {
330 of.WriteLine(s.replace(/\@WITH_ZLIB\@/, withZlib? "1" : "0"));
331 } else if (s.search(/\@WITH_LZMA\@/) != -1) {
332 of.WriteLine(s.replace(/\@WITH_LZMA\@/, withLzma? "1" : "0"));
333 } else if (s.search(/\@WITH_DEBUG\@/) != -1) {
334 of.WriteLine(s.replace(/\@WITH_DEBUG\@/, withDebug? "1" : "0"));
335 } else if (s.search(/\@WITH_MEM_DEBUG\@/) != -1) {
336 of.WriteLine(s.replace(/\@WITH_MEM_DEBUG\@/, withMemDebug? "1" : "0"));
337 } else if (s.search(/\@WITH_SCHEMAS\@/) != -1) {
338 of.WriteLine(s.replace(/\@WITH_SCHEMAS\@/, withSchemas? "1" : "0"));
339 } else if (s.search(/\@WITH_SCHEMATRON\@/) != -1) {
340 of.WriteLine(s.replace(/\@WITH_SCHEMATRON\@/, withSchematron? "1" : "0"));
341 } else if (s.search(/\@WITH_REGEXPS\@/) != -1) {
342 of.WriteLine(s.replace(/\@WITH_REGEXPS\@/, withRegExps? "1" : "0"));
343 } else if (s.search(/\@WITH_MODULES\@/) != -1) {
344 of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
345 } else if (s.search(/\@MODULE_EXTENSION\@/) != -1) {
346 of.WriteLine(s.replace(/\@MODULE_EXTENSION\@/, ".dll"));
347 } else if (s.search(/\@WITH_TREE\@/) != -1) {
348 of.WriteLine(s.replace(/\@WITH_TREE\@/, withTree? "1" : "0"));
349 } else if (s.search(/\@WITH_READER\@/) != -1) {
350 of.WriteLine(s.replace(/\@WITH_READER\@/, withReader? "1" : "0"));
351 } else if (s.search(/\@WITH_WRITER\@/) != -1) {
352 of.WriteLine(s.replace(/\@WITH_WRITER\@/, withWriter? "1" : "0"));
353 } else if (s.search(/\@WITH_WALKER\@/) != -1) {
354 of.WriteLine(s.replace(/\@WITH_WALKER\@/, withWalker? "1" : "0"));
355 } else if (s.search(/\@WITH_PATTERN\@/) != -1) {
356 of.WriteLine(s.replace(/\@WITH_PATTERN\@/, withPattern? "1" : "0"));
357 } else if (s.search(/\@WITH_PUSH\@/) != -1) {
358 of.WriteLine(s.replace(/\@WITH_PUSH\@/, withPush? "1" : "0"));
359 } else if (s.search(/\@WITH_VALID\@/) != -1) {
360 of.WriteLine(s.replace(/\@WITH_VALID\@/, withValid? "1" : "0"));
361 } else if (s.search(/\@WITH_SAX1\@/) != -1) {
362 of.WriteLine(s.replace(/\@WITH_SAX1\@/, withSax1? "1" : "0"));
363 } else if (s.search(/\@WITH_LEGACY\@/) != -1) {
364 of.WriteLine(s.replace(/\@WITH_LEGACY\@/, withLegacy? "1" : "0"));
365 } else if (s.search(/\@WITH_OUTPUT\@/) != -1) {
366 of.WriteLine(s.replace(/\@WITH_OUTPUT\@/, withOutput? "1" : "0"));
367 } else
368 of.WriteLine(ln);
369 }
370 ofi.Close();
371 of.Close();
372}
373/* Configures Python bindings. Otherwise identical to the above */
374function configureLibxmlPy()
375{
376 var pyOptsFileIn = srcDirXml + "\\python\\setup.py.in";
377 var pyOptsFile = srcDirXml + "\\python\\setup.py";
378 var fso, ofi, of, ln, s;
379 fso = new ActiveXObject("Scripting.FileSystemObject");
380 ofi = fso.OpenTextFile(pyOptsFileIn, 1);
381 of = fso.CreateTextFile(pyOptsFile, true);
382 while (ofi.AtEndOfStream != true) {
383 ln = ofi.ReadLine();
384 s = new String(ln);
385 if (s.search(/\@LIBXML_VERSION\@/) != -1) {
386 of.WriteLine(s.replace(/\@LIBXML_VERSION\@/,
387 verMajor + "." + verMinor + "." + verMicro));
388 } else if (s.search(/\@prefix\@/) != -1) {
389 of.WriteLine(s.replace(/\@prefix\@/, buildPrefix));
390 } else if (s.search(/\@WITH_THREADS\@/) != -1) {
391 of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
392 } else if (s.search(/\@WITH_ZLIB\@/) != -1) {
393 of.WriteLine(s.replace(/\@WITH_ZLIB\@/, withZlib? "1" : "0"));
394 } else if (s.search(/\@WITH_LZMA\@/) != -1) {
395 of.WriteLine(s.replace(/\@WITH_LZMA\@/, withLzma? "1" : "0"));
396 } else if (s.search(/\@WITH_ICONV\@/) != -1) {
397 of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0"));
398 } else if (s.search(/\@WITH_ICU\@/) != -1) {
399 of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0"));
400 } else
401 of.WriteLine(ln);
402 }
403 ofi.Close();
404 of.Close();
405}
406
407/* Creates the readme file for the binary distribution of 'bname', for the
408 version 'ver' in the file 'file'. This one is called from the Makefile when
409 generating a binary distribution. The parameters are passed by make. */
410function genReadme(bname, ver, file)
411{
412 var fso, f;
413 fso = new ActiveXObject("Scripting.FileSystemObject");
414 f = fso.CreateTextFile(file, true);
415 f.WriteLine(" " + bname + " " + ver);
416 f.WriteLine(" --------------");
417 f.WriteBlankLines(1);
418 f.WriteLine(" This is " + bname + ", version " + ver + ", binary package for the native Win32/IA32");
419 f.WriteLine("platform.");
420 f.WriteBlankLines(1);
421 f.WriteLine(" The files in this package do not require any special installation");
422 f.WriteLine("steps. Extract the contents of the archive wherever you wish and");
423 f.WriteLine("make sure that your tools which use " + bname + " can find it.");
424 f.WriteBlankLines(1);
425 f.WriteLine(" For example, if you want to run the supplied utilities from the command");
426 f.WriteLine("line, you can, if you wish, add the 'bin' subdirectory to the PATH");
427 f.WriteLine("environment variable.");
428 f.WriteLine(" If you want to make programmes in C which use " + bname + ", you'll");
429 f.WriteLine("likely know how to use the contents of this package. If you don't, please");
430 f.WriteLine("refer to your compiler's documentation.");
431 f.WriteBlankLines(1);
432 f.WriteLine(" If there is something you cannot keep for yourself, such as a problem,");
433 f.WriteLine("a cheer of joy, a comment or a suggestion, feel free to contact me using");
434 f.WriteLine("the address below.");
435 f.WriteBlankLines(1);
436 f.WriteLine(" Igor Zlatkovic ([email protected])");
437 f.Close();
438}
439
440
441/*
442 * main(),
443 * Execution begins here.
444 */
445
446// Parse the command-line arguments.
447for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
448 var arg, opt;
449 arg = WScript.Arguments(i);
450 opt = arg.substring(0, arg.indexOf("="));
451 if (opt.length == 0)
452 opt = arg.substring(0, arg.indexOf(":"));
453 if (opt.length > 0) {
454 if (opt == "trio")
455 withTrio = strToBool(arg.substring(opt.length + 1, arg.length));
456 else if (opt == "threads")
457 withThreads = arg.substring(opt.length + 1, arg.length);
458 else if (opt == "ftp")
459 withFtp = strToBool(arg.substring(opt.length + 1, arg.length));
460 else if (opt == "http")
461 withHttp = strToBool(arg.substring(opt.length + 1, arg.length));
462 else if (opt == "html")
463 withHtml = strToBool(arg.substring(opt.length + 1, arg.length));
464 else if (opt == "c14n")
465 withC14n = strToBool(arg.substring(opt.length + 1, arg.length));
466 else if (opt == "catalog")
467 withCatalog = strToBool(arg.substring(opt.length + 1, arg.length));
468 else if (opt == "xpath")
469 withXpath = strToBool(arg.substring(opt.length + 1, arg.length));
470 else if (opt == "xptr")
471 withXptr = strToBool(arg.substring(opt.length + 1, arg.length));
472 else if (opt == "xptr_locs")
473 withXptrLocs = strToBool(arg.substring(opt.length + 1, arg.length));
474 else if (opt == "xinclude")
475 withXinclude = strToBool(arg.substring(opt.length + 1, arg.length));
476 else if (opt == "iconv")
477 withIconv = strToBool(arg.substring(opt.length + 1, arg.length));
478 else if (opt == "icu")
479 withIcu = strToBool(arg.substring(opt.length + 1, arg.length));
480 else if (opt == "iso8859x")
481 withIso8859x = strToBool(arg.substring(opt.length + 1, arg.length));
482 else if (opt == "zlib")
483 withZlib = strToBool(arg.substring(opt.length + 1, arg.length));
484 else if (opt == "lzma")
485 withLzma = strToBool(arg.substring(opt.length + 1, arg.length));
486 else if (opt == "xml_debug")
487 withDebug = strToBool(arg.substring(opt.length + 1, arg.length));
488 else if (opt == "mem_debug")
489 withMemDebug = strToBool(arg.substring(opt.length + 1, arg.length));
490 else if (opt == "schemas")
491 withSchemas = strToBool(arg.substring(opt.length + 1, arg.length));
492 else if (opt == "schematron")
493 withSchematron = strToBool(arg.substring(opt.length + 1, arg.length));
494 else if (opt == "regexps")
495 withRegExps = strToBool(arg.substring(opt.length + 1, arg.length));
496 else if (opt == "modules")
497 withModules = strToBool(arg.substring(opt.length + 1, arg.length));
498 else if (opt == "tree")
499 withTree = strToBool(arg.substring(opt.length + 1, arg.length));
500 else if (opt == "reader")
501 withReader = strToBool(arg.substring(opt.length + 1, arg.length));
502 else if (opt == "writer")
503 withWriter = strToBool(arg.substring(opt.length + 1, arg.length));
504 else if (opt == "walker")
505 withWalker = strToBool(arg.substring(opt.length + 1, arg.length));
506 else if (opt == "pattern")
507 withPattern = strToBool(arg.substring(opt.length + 1, arg.length));
508 else if (opt == "push")
509 withPush = strToBool(arg.substring(opt.length + 1, arg.length));
510 else if (opt == "valid")
511 withValid = strToBool(arg.substring(opt.length + 1, arg.length));
512 else if (opt == "sax1")
513 withSax1 = strToBool(arg.substring(opt.length + 1, arg.length));
514 else if (opt == "legacy")
515 withLegacy = strToBool(arg.substring(opt.length + 1, arg.length));
516 else if (opt == "output")
517 withOutput = strToBool(arg.substring(opt.length + 1, arg.length));
518 else if (opt == "python")
519 withPython = strToBool(arg.substring(opt.length + 1, arg.length));
520 else if (opt == "compiler")
521 compiler = arg.substring(opt.length + 1, arg.length);
522 else if (opt == "cruntime")
523 cruntime = arg.substring(opt.length + 1, arg.length);
524 else if (opt == "dynruntime")
525 dynruntime = strToBool(arg.substring(opt.length + 1, arg.length));
526 else if (opt == "vcmanifest")
527 vcmanifest = strToBool(arg.substring(opt.length + 1, arg.length));
528 else if (opt == "debug")
529 buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
530 else if (opt == "static")
531 buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
532 else if (opt == "prefix")
533 buildPrefix = arg.substring(opt.length + 1, arg.length);
534 else if (opt == "bindir")
535 buildBinPrefix = arg.substring(opt.length + 1, arg.length);
536 else if (opt == "libdir")
537 buildLibPrefix = arg.substring(opt.length + 1, arg.length);
538 else if (opt == "sodir")
539 buildSoPrefix = arg.substring(opt.length + 1, arg.length);
540 else if (opt == "incdir")
541 buildIncPrefix = arg.substring(opt.length + 1, arg.length);
542 else if (opt == "include")
543 buildInclude = arg.substring(opt.length + 1, arg.length);
544 else if (opt == "lib")
545 buildLib = arg.substring(opt.length + 1, arg.length);
546 else if (opt == "release")
547 useCvsVer = false;
548 else
549 error = 1;
550 } else if (i == 0) {
551 if (arg == "genreadme") {
552 // This command comes from the Makefile and will not be checked
553 // for errors, because Makefile will always supply right the parameters.
554 genReadme(WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3));
555 WScript.Quit(0);
556 } else if (arg == "help") {
557 usage();
558 WScript.Quit(0);
559 }
560
561 } else {
562 error = 1;
563 }
564}
565
566
567// If we fail here, it is because the user supplied an unrecognised argument.
568if (error != 0) {
569 usage();
570 WScript.Quit(error);
571}
572
573// if user choses to link the c-runtime library statically into libxml2
574// with /MT and friends, then we need to enable static linking for xmllint
575if (cruntime == "/MT" || cruntime == "/MTd" ||
576 cruntime == "/ML" || cruntime == "/MLd") {
577 buildStatic = 1;
578}
579
580dirSep = "\\";
581if (buildBinPrefix == "")
582 buildBinPrefix = "$(PREFIX)" + dirSep + "bin";
583if (buildIncPrefix == "")
584 buildIncPrefix = "$(PREFIX)" + dirSep + "include";
585if (buildLibPrefix == "")
586 buildLibPrefix = "$(PREFIX)" + dirSep + "lib";
587if (buildSoPrefix == "")
588 buildSoPrefix = "$(PREFIX)" + dirSep + "bin";
589
590// Discover the version.
591discoverVersion();
592if (error != 0) {
593 WScript.Echo("Version discovery failed, aborting.");
594 WScript.Quit(error);
595}
596
597var outVerString = baseName + " version: " + verMajor + "." + verMinor + "." + verMicro;
598if (verMicroSuffix && verMicroSuffix != "")
599 outVerString += "-" + verMicroSuffix;
600if (verCvs && verCvs != "")
601 outVerString += "-" + verCvs;
602WScript.Echo(outVerString);
603
604// Configure libxml.
605configureLibxml();
606if (error != 0) {
607 WScript.Echo("Configuration failed, aborting.");
608 WScript.Quit(error);
609}
610
611if (withPython == true) {
612 configureLibxmlPy();
613 if (error != 0) {
614 WScript.Echo("Configuration failed, aborting.");
615 WScript.Quit(error);
616 }
617
618}
619
620// Create the makefile.
621var fso = new ActiveXObject("Scripting.FileSystemObject");
622var makefile = ".\\Makefile.msvc";
623if (compiler == "mingw")
624 makefile = ".\\Makefile.mingw";
625else if (compiler == "bcb")
626 makefile = ".\\Makefile.bcb";
627var new_makefile = ".\\Makefile";
628var f = fso.FileExists(new_makefile);
629if (f) {
630 var t = fso.GetFile(new_makefile);
631 t.Attributes =0;
632}
633fso.CopyFile(makefile, new_makefile, true);
634WScript.Echo("Created Makefile.");
635// Create the config.h.
636var confighsrc = "..\\include\\win32config.h";
637var configh = "..\\config.h";
638var f = fso.FileExists(configh);
639if (f) {
640 var t = fso.GetFile(configh);
641 t.Attributes =0;
642}
643fso.CopyFile(confighsrc, configh, true);
644WScript.Echo("Created config.h.");
645
646
647// Display the final configuration.
648var txtOut = "\nXML processor configuration\n";
649txtOut += "---------------------------\n";
650txtOut += " Trio: " + boolToStr(withTrio) + "\n";
651txtOut += " Thread safety: " + withThreads + "\n";
652txtOut += " FTP client: " + boolToStr(withFtp) + "\n";
653txtOut += " HTTP client: " + boolToStr(withHttp) + "\n";
654txtOut += " HTML processor: " + boolToStr(withHtml) + "\n";
655txtOut += " C14N support: " + boolToStr(withC14n) + "\n";
656txtOut += " Catalog support: " + boolToStr(withCatalog) + "\n";
657txtOut += " XPath support: " + boolToStr(withXpath) + "\n";
658txtOut += " XPointer support: " + boolToStr(withXptr) + "\n";
659txtOut += " XPointer locs: " + boolToStr(withXptrLocs) + "\n";
660txtOut += " XInclude support: " + boolToStr(withXinclude) + "\n";
661txtOut += " iconv support: " + boolToStr(withIconv) + "\n";
662txtOut += " icu support: " + boolToStr(withIcu) + "\n";
663txtOut += " iso8859x support: " + boolToStr(withIso8859x) + "\n";
664txtOut += " zlib support: " + boolToStr(withZlib) + "\n";
665txtOut += " lzma support: " + boolToStr(withLzma) + "\n";
666txtOut += " Debugging module: " + boolToStr(withDebug) + "\n";
667txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n";
668txtOut += " Regexp support: " + boolToStr(withRegExps) + "\n";
669txtOut += " Module support: " + boolToStr(withModules) + "\n";
670txtOut += " Tree support: " + boolToStr(withTree) + "\n";
671txtOut += " Reader support: " + boolToStr(withReader) + "\n";
672txtOut += " Writer support: " + boolToStr(withWriter) + "\n";
673txtOut += " Walker support: " + boolToStr(withWalker) + "\n";
674txtOut += " Pattern support: " + boolToStr(withPattern) + "\n";
675txtOut += " Push support: " + boolToStr(withPush) + "\n";
676txtOut += "Validation support: " + boolToStr(withValid) + "\n";
677txtOut += " SAX1 support: " + boolToStr(withSax1) + "\n";
678txtOut += " Legacy support: " + boolToStr(withLegacy) + "\n";
679txtOut += " Output support: " + boolToStr(withOutput) + "\n";
680txtOut += "XML Schema support: " + boolToStr(withSchemas) + "\n";
681txtOut += "Schematron support: " + boolToStr(withSchematron) + "\n";
682txtOut += " Python bindings: " + boolToStr(withPython) + "\n";
683txtOut += "\n";
684txtOut += "Win32 build configuration\n";
685txtOut += "-------------------------\n";
686txtOut += " Compiler: " + compiler + "\n";
687if (compiler == "msvc") {
688 txtOut += " C-Runtime option: " + cruntime + "\n";
689 txtOut += " Embed Manifest: " + boolToStr(vcmanifest) + "\n";
690} else if (compiler == "bcb")
691 txtOut += " Use dynamic RTL: " + dynruntime + "\n";
692txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
693txtOut += " Static xmllint: " + boolToStr(buildStatic) + "\n";
694txtOut += " Install prefix: " + buildPrefix + "\n";
695txtOut += " Put tools in: " + buildBinPrefix + "\n";
696txtOut += " Put headers in: " + buildIncPrefix + "\n";
697txtOut += "Put static libs in: " + buildLibPrefix + "\n";
698txtOut += "Put shared libs in: " + buildSoPrefix + "\n";
699txtOut += " Include path: " + buildInclude + "\n";
700txtOut += " Lib path: " + buildLib + "\n";
701txtOut += "\n";
702txtOut += "DEPRECATION WARNING: The build system in the win32 directory is\n";
703txtOut += "deprecated and will be removed in a future release. Please switch\n";
704txtOut += "to CMake.\n";
705WScript.Echo(txtOut);
706
707//
708
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette