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