Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 1 | $! BUILD_LIBXML.COM |
| 2 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 3 | $! Build the LIBXML library |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 4 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 5 | $! Arguments: |
| 6 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 7 | $! "DEBUG" - build everything in debug |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 8 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 9 | $! This procedure creates an object library XML_LIBDIR:LIBXML.OLB directory. |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 10 | $! After the library is built, you can link LIBXML routines into |
| 11 | $! your code with the command |
| 12 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 13 | $! $ LINK your_modules,XML_LIBDIR:LIBXML.OLB/LIBRARY |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 14 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 15 | $! Change History |
| 16 | $! -------------- |
| 17 | $! Command file author : John A Fotheringham (jaf@jafsoft.com) |
Daniel Veillard | 9339b74 | 2003-10-15 08:18:00 +0000 | [diff] [blame] | 18 | $! Update history : 13 October 2003 Craig Berry (craigberry@mac.com) |
| 19 | $! more new module additions |
| 20 | $! : 25 April 2003 Craig Berry (craigberry@mac.com) |
Daniel Veillard | 1c96027 | 2003-04-25 23:12:22 +0000 | [diff] [blame] | 21 | $! added xmlreader.c and relaxng.c to source list |
| 22 | $! : 28 September 2002 Craig Berry (craigberry@mac.com) |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 23 | $! updated to work with current sources |
| 24 | $! miscellaneous enhancements to build process |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 25 | $! |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 26 | $!- configuration ------------------------------------------------------------- |
| 27 | $! |
| 28 | $!- compile command. If p1="nowarn" suppress the expected warning types |
| 29 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 30 | $ cc_opts = "/NAMES=(SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS" |
| 31 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 32 | $ if p1.eqs."DEBUG" .or. p2.eqs."DEBUG" |
| 33 | $ then |
| 34 | $ debug = "Y" |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 35 | $ cc_command = "CC''cc_opts'/DEBUG/NOOPTIMIZE/LIST/SHOW=ALL" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 36 | $ else |
| 37 | $ debug = "N" |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 38 | $ cc_command = "CC''cc_opts'" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 39 | $ endif |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 40 | $! |
| 41 | $!- list of sources to be built into the LIBXML library. Compare this list |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 42 | $! to the definition of "libxml2_la_SOURCES" in the file MAKEFILE.IN. |
| 43 | $! Currently this definition includes the list WITH_TRIO_SOURCES_TRUE |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 44 | $! |
| 45 | $ sources = "SAX.c entities.c encoding.c error.c parserInternals.c parser.c" |
| 46 | $ sources = sources + " tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c valid.c" |
| 47 | $ sources = sources + " xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c " |
| 48 | $ sources = sources + " xpointer.c xinclude.c nanohttp.c nanoftp.c " |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 49 | $ sources = sources + " DOCBparser.c catalog.c globals.c threads.c c14n.c " |
| 50 | $ sources = sources + " xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c " |
Daniel Veillard | 9339b74 | 2003-10-15 08:18:00 +0000 | [diff] [blame] | 51 | $ sources = sources + " triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c" |
| 52 | $ sources = sources + " legacy.c xmldwalk.c chvalid.c" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 53 | $! |
| 54 | $!- list of main modules to compile and link. Compare this list to the |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 55 | $! definition of bin_PROGRAMS in MAKEFILE.IN |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 56 | $! |
| 57 | $ bin_progs = "xmllint xmlcatalog" |
| 58 | $! |
| 59 | $!- list of test modules to compile and link. Compare this list to the |
| 60 | $! definition of noinst_PROGRAMS in MAKEFILE. |
| 61 | $! |
Daniel Veillard | 9339b74 | 2003-10-15 08:18:00 +0000 | [diff] [blame] | 62 | $ noinst_PROGRAMS = "testSchemas testRelax testSAX testHTML testXPath testURI " - |
| 63 | + "testThreads testC14N testAutomata testRegexp testReader" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 64 | $! |
| 65 | $!- set up build logicals -----------------------------------------------------\ |
| 66 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 67 | $! |
| 68 | $!- start from where the procedure is in case it's submitted in batch ----------\ |
| 69 | $! |
| 70 | $ whoami = f$parse(f$environment("PROCEDURE"),,,,"NO_CONCEAL") |
| 71 | $ procdir = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY") |
| 72 | $ set default 'procdir' |
| 73 | $! |
| 74 | $ if f$trnlnm("XML_LIBDIR").eqs."" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 75 | $ then |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 76 | $ if f$search("[-]lib.dir") .eqs. "" |
| 77 | $ then |
| 78 | $ create/directory/log [-.lib] |
| 79 | $ endif |
| 80 | $ xml_libdir = f$parse("[-.lib]",,,"DEVICE") + f$parse("[-.lib]",,,"DIRECTORY") |
| 81 | $ define/process XML_LIBDIR 'xml_libdir' |
| 82 | $ write sys$output "Defining XML_LIBDIR as """ + f$trnlnm("XML_LIBDIR") + """ |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 83 | $ endif |
| 84 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 85 | $ if f$trnlnm("XML_SRCDIR").eqs."" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 86 | $ then |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 87 | $ globfile = f$search("[-...]globals.c") |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 88 | $ if globfile.eqs."" |
| 89 | $ then |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 90 | $ write sys$output "Can't locate globals.c. You need to manually define a XML_SRCDIR logical" |
| 91 | $ exit |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 92 | $ else |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 93 | $ srcdir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY") |
| 94 | $ define/process XML_SRCDIR "''srcdir'" |
| 95 | $ write sys$output "Defining XML_SRCDIR as ""''srcdir'""" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 96 | $ endif |
| 97 | $ endif |
| 98 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 99 | $ copy/log config.vms xml_srcdir:config.h |
| 100 | $! |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 101 | $ if f$trnlnm("libxml").eqs."" |
| 102 | $ then |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 103 | $ globfile = f$search("[-...]globals.h") |
| 104 | $ if globfile.eqs."" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 105 | $ then |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 106 | $ write sys$output "Can't locate globals.h. You need to manually define a LIBXML logical" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 107 | $ exit |
| 108 | $ else |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 109 | $ includedir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY") |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 110 | $ define/process libxml "''includedir'" |
| 111 | $ write sys$output "Defining libxml as ""''includedir'""" |
| 112 | $ endif |
| 113 | $ endif |
| 114 | $! |
| 115 | $!- set up error handling (such as it is) ------------------------------------- |
| 116 | $! |
| 117 | $ exit_status = 1 |
| 118 | $ saved_default = f$environment("default") |
| 119 | $ on error then goto ERROR_OUT |
| 120 | $ on control_y then goto ERROR_OUT |
| 121 | $! |
| 122 | $!- move to the source directory and create any necessary subdirs and the |
| 123 | $! object library |
| 124 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 125 | $ set default xml_srcdir |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 126 | $ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG] |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 127 | $ if f$search("XML_LIBDIR:LIBXML.OLB").eqs."" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 128 | $ then |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 129 | $ write sys$output "Creating new object library XML_LIBDIR:LIBXML.OLB" |
| 130 | $ library/create XML_LIBDIR:LIBXML.OLB |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 131 | $ endif |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 132 | $! |
| 133 | $ goto start_here |
| 134 | $ start_here: ! move this line to debug/rerun parts of this command file |
| 135 | $! |
| 136 | $!- compile modules into the library ------------------------------------------ |
| 137 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 138 | $ lib_command = "LIBRARY/REPLACE/LOG XML_LIBDIR:LIBXML.OLB" |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 139 | $ link_command = "" |
| 140 | $! |
| 141 | $ write sys$output "" |
| 142 | $ write sys$output "Building modules into the LIBXML object library" |
| 143 | $ write sys$output "" |
| 144 | $! |
| 145 | $ s_no = 0 |
| 146 | $ sources = f$edit(sources,"COMPRESS") |
| 147 | $! |
| 148 | $ source_loop: |
| 149 | $! |
| 150 | $ next_source = f$element (S_no," ",sources) |
| 151 | $ if next_source.nes."" .and. next_source.nes." " |
| 152 | $ then |
| 153 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 154 | $ on error then goto ERROR_OUT |
| 155 | $ on control_y then goto ERROR_OUT |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 156 | $ call build 'next_source' |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 157 | $ s_no = s_no + 1 |
| 158 | $ goto source_loop |
| 159 | $! |
| 160 | $ endif |
| 161 | $! |
| 162 | $!- now build self-test programs ---------------------------------------------- |
| 163 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 164 | $! these programs are built as ordinary modules into XML_LIBDIR:LIBXML.OLB. Here they |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 165 | $! are built a second time with /DEFINE=(STANDALONE) in which case a main() |
| 166 | $! is also compiled into the module |
| 167 | $ |
| 168 | $ lib_command = "" |
| 169 | $ link_command = "LINK" |
| 170 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 171 | $ library/compress XML_LIBDIR:LIBXML.OLB |
| 172 | $ purge XML_LIBDIR:LIBXML.OLB |
| 173 | $! |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 174 | $ write sys$output "" |
| 175 | $ write sys$output "Building STANDALONE self-test programs" |
| 176 | $ write sys$output "" |
| 177 | $! |
| 178 | $ call build NANOFTP.C /DEFINE=(STANDALONE) |
| 179 | $ call build NANOHTTP.C /DEFINE=(STANDALONE) |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 180 | $ call build TRIONAN.C /DEFINE=(STANDALONE) |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 181 | $! |
| 182 | $!- now build main and test programs ------------------------------------------ |
| 183 | $! |
| 184 | $! |
| 185 | $ lib_command = "" |
| 186 | $ link_command = "LINK" |
| 187 | $! |
| 188 | $ write sys$output "" |
| 189 | $ write sys$output "Building main programs and test programs" |
| 190 | $ write sys$output "" |
| 191 | $! |
| 192 | $ p_no = 0 |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 193 | $ all_progs = bin_progs + " " + noinst_PROGRAMS |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 194 | $ all_progs = f$edit(all_progs,"COMPRESS") |
| 195 | $! |
| 196 | $ prog_loop: |
| 197 | $! |
| 198 | $ next_prog = f$element (p_no," ",all_progs) |
| 199 | $ if next_prog.nes."" .and. next_prog.nes." " |
| 200 | $ then |
| 201 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 202 | $ on error then goto ERROR_OUT |
| 203 | $ on control_y then goto ERROR_OUT |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 204 | $ call build 'next_prog'.c |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 205 | $ p_no = p_no + 1 |
| 206 | $ goto prog_loop |
| 207 | $! |
| 208 | $ endif |
| 209 | $! |
| 210 | $!- Th-th-th-th-th-that's all folks! ------------------------------------------ |
| 211 | $! |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 212 | $ goto exit_here ! move this line to avoid parts of this command file |
| 213 | $ exit_here: |
| 214 | $! |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 215 | $ exit |
| 216 | $ goto exit_out |
| 217 | $! |
| 218 | $! |
| 219 | $EXIT_OUT: |
| 220 | $! |
| 221 | $ purge/nolog [.debug] |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 222 | $ set default 'saved_default |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 223 | $ exit 'exit_status |
| 224 | $! |
| 225 | $ |
| 226 | $ERROR_OUT: |
| 227 | $ exit_status = $status |
| 228 | $ write sys$output "''f$message(exit_status)'" |
| 229 | $ goto EXIT_OUT |
| 230 | $! |
| 231 | $!- the BUILD subroutine. Compile then insert into library or link as required |
| 232 | $! |
| 233 | $BUILD: subroutine |
| 234 | $ on warning then goto EXIT_BUILD |
| 235 | $ source_file = p1 |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 236 | $ name = f$parse(source_file,,,"NAME") |
| 237 | $ object_file = f$parse("[.debug].OBJ",name,,,"SYNTAX_ONLY") |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 238 | $! |
| 239 | $!- compile |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 240 | $! |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 241 | $ write sys$output "''cc_command'''p2'/object=''object_file' ''source_file'" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 242 | $ cc_command'p2' /object='object_file 'source_file' |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 243 | $! |
| 244 | $!- insert into library if command defined |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 245 | $! |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 246 | $ if lib_command.nes."" then lib_command 'object_file' |
| 247 | $! |
| 248 | $!- link module if command defined |
| 249 | $ if link_command.nes."" |
| 250 | $ then |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 251 | $ opts = "" |
| 252 | $ if debug then opts = "/DEBUG" |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 253 | $ write sys$output "''link_command'''opts' ''object_file',XML_LIBDIR:libxml.olb/library" |
Daniel Veillard | d33cfbf | 2001-11-13 15:24:36 +0000 | [diff] [blame] | 254 | $ link_command'opts' 'object_file',- |
Daniel Veillard | e645e8c | 2002-10-22 17:35:37 +0000 | [diff] [blame] | 255 | XML_LIBDIR:libxml.olb/library |
Daniel Veillard | acf7ff0 | 2001-10-29 20:21:47 +0000 | [diff] [blame] | 256 | $ endif |
| 257 | $! |
| 258 | $EXIT_BUILD: |
| 259 | $ exit $status |
| 260 | $! |
| 261 | $endsubroutine |