@@ -14,7 +14,7 @@ var srcDirUtils = "..";
1414var baseName = "libxml2" ;
1515/* Configure file which contains the version and the output file where
1616 we can store our build configuration. */
17- var configFile = srcDirXml + "\\configure.ac " ;
17+ var libxmlVersionFile = srcDirXml + "\\VERSION " ;
1818var versionFile = ".\\config.msvc" ;
1919/* Input and output files regarding the libxml features. */
2020var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in" ;
@@ -45,6 +45,7 @@ var withDebug = true;
4545var withSchemas = true ;
4646var withSchematron = true ;
4747var withRegExps = true ;
48+ var withRelaxNg = true ;
4849var withModules = true ;
4950var withTree = true ;
5051var withReader = true ;
@@ -124,6 +125,7 @@ function usage()
124125 txt += " lzma: Enable lzma support (" + ( withLzma ? "yes" : "no" ) + ")\n" ;
125126 txt += " xml_debug: Enable XML debbugging module (" + ( withDebug ? "yes" : "no" ) + ")\n" ;
126127 txt += " regexps: Enable regular expressions (" + ( withRegExps ? "yes" : "no" ) + ")\n" ;
128+ txt += " relaxng: Enable RELAX NG support (" + ( withRelaxNg ? "yes" : "no" ) + ")\n" ;
127129 txt += " modules: Enable module support (" + ( withModules ? "yes" : "no" ) + ")\n" ;
128130 txt += " tree: Enable tree api (" + ( withTree ? "yes" : "no" ) + ")\n" ;
129131 txt += " reader: Enable xmlReader api (" + ( withReader ? "yes" : "no" ) + ")\n" ;
@@ -170,7 +172,7 @@ function discoverVersion()
170172 var fso , cf , vf , ln , s , iDot , iSlash ;
171173 fso = new ActiveXObject ( "Scripting.FileSystemObject" ) ;
172174 verCvs = "" ;
173- cf = fso . OpenTextFile ( configFile , 1 ) ;
175+ cf = fso . OpenTextFile ( libxmlVersionFile , 1 ) ;
174176 if ( compiler == "msvc" )
175177 versionFile = ".\\config.msvc" ;
176178 else if ( compiler == "mingw" )
@@ -184,19 +186,13 @@ function discoverVersion()
184186 while ( cf . AtEndOfStream != true ) {
185187 ln = cf . ReadLine ( ) ;
186188 s = new String ( ln ) ;
187- if ( m = s . match ( / ^ m 4 _ d e f i n e \( \[ M A J O R _ V E R S I O N \] , ( \w + ) \) / ) ) {
188- vf . WriteLine ( "LIBXML_MAJOR_VERSION=" + m [ 1 ] ) ;
189- verMajor = m [ 1 ] ;
190- } else if ( m = s . match ( / ^ m 4 _ d e f i n e \( \[ M I N O R _ V E R S I O N \] , ( \w + ) \) / ) ) {
191- vf . WriteLine ( "LIBXML_MINOR_VERSION=" + m [ 1 ] ) ;
192- verMinor = m [ 1 ] ;
193- } else if ( m = s . match ( / ^ m 4 _ d e f i n e \( \[ M I C R O _ V E R S I O N \] , ( \w + ) \) / ) ) {
194- vf . WriteLine ( "LIBXML_MICRO_VERSION=" + m [ 1 ] ) ;
195- verMicro = m [ 1 ] ;
196- } else if ( s . search ( / ^ L I B X M L _ M I C R O _ V E R S I O N _ S U F F I X = / ) != - 1 ) {
197- vf . WriteLine ( s ) ;
198- verMicroSuffix = s . substring ( s . indexOf ( "=" ) + 1 , s . length ) ;
199- }
189+ versionSplit = s . split ( "." ) ;
190+ verMajor = versionSplit [ 0 ] ;
191+ vf . WriteLine ( "LIBXML_MAJOR_VERSION=" + verMajor ) ;
192+ verMinor = versionSplit [ 1 ] ;
193+ vf . WriteLine ( "LIBXML_MINOR_VERSION=" + verMinor ) ;
194+ verMicro = versionSplit [ 2 ] ;
195+ vf . WriteLine ( "LIBXML_MICRO_VERSION=" + verMicro ) ;
200196 }
201197 cf . Close ( ) ;
202198 vf . WriteLine ( "XML_SRCDIR=" + srcDirXml ) ;
@@ -218,6 +214,7 @@ function discoverVersion()
218214 vf . WriteLine ( "WITH_SCHEMAS=" + ( withSchemas ? "1" : "0" ) ) ;
219215 vf . WriteLine ( "WITH_SCHEMATRON=" + ( withSchematron ? "1" : "0" ) ) ;
220216 vf . WriteLine ( "WITH_REGEXPS=" + ( withRegExps ? "1" : "0" ) ) ;
217+ vf . WriteLine ( "WITH_RELAXNG=" + ( withRelaxNg ? "1" : "0" ) ) ;
221218 vf . WriteLine ( "WITH_MODULES=" + ( withModules ? "1" : "0" ) ) ;
222219 vf . WriteLine ( "WITH_TREE=" + ( withTree ? "1" : "0" ) ) ;
223220 vf . WriteLine ( "WITH_READER=" + ( withReader ? "1" : "0" ) ) ;
@@ -320,6 +317,8 @@ function configureLibxml()
320317 of . WriteLine ( s . replace ( / \@ W I T H _ S C H E M A T R O N \@ / , withSchematron ? "1" : "0" ) ) ;
321318 } else if ( s . search ( / \@ W I T H _ R E G E X P S \@ / ) != - 1 ) {
322319 of . WriteLine ( s . replace ( / \@ W I T H _ R E G E X P S \@ / , withRegExps ? "1" : "0" ) ) ;
320+ } else if ( s . search ( / \@ W I T H _ R E L A X N G \@ / ) != - 1 ) {
321+ of . WriteLine ( s . replace ( / \@ W I T H _ R E L A X N G \@ / , withRelaxNg ? "1" : "0" ) ) ;
323322 } else if ( s . search ( / \@ W I T H _ M O D U L E S \@ / ) != - 1 ) {
324323 of . WriteLine ( s . replace ( / \@ W I T H _ M O D U L E S \@ / , withModules ? "1" : "0" ) ) ;
325324 } else if ( s . search ( / \@ M O D U L E _ E X T E N S I O N \@ / ) != - 1 ) {
@@ -465,6 +464,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
465464 withSchematron = strToBool ( arg . substring ( opt . length + 1 , arg . length ) ) ;
466465 else if ( opt == "regexps" )
467466 withRegExps = strToBool ( arg . substring ( opt . length + 1 , arg . length ) ) ;
467+ else if ( opt == "relaxng" )
468+ withRelaxNg = strToBool ( arg . substring ( opt . length + 1 , arg . length ) ) ;
468469 else if ( opt == "modules" )
469470 withModules = strToBool ( arg . substring ( opt . length + 1 , arg . length ) ) ;
470471 else if ( opt == "tree" )
@@ -634,6 +635,7 @@ txtOut += " zlib support: " + boolToStr(withZlib) + "\n";
634635txtOut += " lzma support: " + boolToStr ( withLzma ) + "\n" ;
635636txtOut += " Debugging module: " + boolToStr ( withDebug ) + "\n" ;
636637txtOut += " Regexp support: " + boolToStr ( withRegExps ) + "\n" ;
638+ txtOut += " Relax NG support: " + boolToStr ( withRelaxNg ) + "\n" ;
637639txtOut += " Module support: " + boolToStr ( withModules ) + "\n" ;
638640txtOut += " Tree support: " + boolToStr ( withTree ) + "\n" ;
639641txtOut += " Reader support: " + boolToStr ( withReader ) + "\n" ;
0 commit comments