3 $! Build the LIBXML library
7 $! "DEBUG" - build everything in debug
9 $! This procedure creates an object library XML_LIBDIR:LIBXML.OLB directory.
10 $! After the library is built, you can link LIBXML routines into
11 $! your code with the command
13 $! $ LINK your_modules,XML_LIBDIR:LIBXML.OLB/LIBRARY
17 $! Command file author : John A Fotheringham (jaf@jafsoft.com)
18 $! Update history : 19 March 2008 Tycho Hilhorst
19 $! - added module schematron.c (prevent xmllint errors)
20 $! - added /DEF and /INCLUDE options to cc_opts to tell
21 $! config.h is available, and where to find it
22 $! : 13 October 2003 Craig Berry (craigberry@mac.com)
23 $! more new module additions
24 $! : 25 April 2003 Craig Berry (craigberry@mac.com)
25 $! added xmlreader.c and relaxng.c to source list
26 $! : 28 September 2002 Craig Berry (craigberry@mac.com)
27 $! updated to work with current sources
28 $! miscellaneous enhancements to build process
30 $!- configuration -------------------------------------------------------------
32 $!- compile command. If p1="nowarn" suppress the expected warning types
34 $ cc_opts = "/nowarn/DEF=HAVE_CONFIG_H/NAMES=(as_is,SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS/INCLUDE=xml_srcdir"
36 $ if p1.eqs."DEBUG" .or. p2.eqs."DEBUG"
39 $ cc_command = "CC''cc_opts'/DEBUG/NOOPTIMIZE/LIST/SHOW=ALL"
42 $ cc_command = "CC''cc_opts'"
45 $!- list of sources to be built into the LIBXML library. Compare this list
46 $! to the definition of "libxml2_la_SOURCES" in the file MAKEFILE.IN.
47 $! Currently this definition includes the list WITH_TRIO_SOURCES_TRUE
49 $ sources = "parser.c SAX.c entities.c encoding.c error.c parserInternals.c"
50 $ sources = sources + " tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c"
51 $ sources = sources + " valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c"
52 $ sources = sources + " xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c"
53 $ sources = sources + " catalog.c globals.c threads.c c14n.c xmlstring.c"
54 $ sources = sources + " xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c"
55 $ sources = sources + " triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c"
56 $ sources = sources + " xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c"
57 $ sources = sources + " schematron.c xmlmodule.c buf.c"
59 $!- list of main modules to compile and link. Compare this list to the
60 $! definition of bin_PROGRAMS in MAKEFILE.IN
62 $ bin_progs = "xmllint xmlcatalog"
64 $!- list of test modules to compile and link. Compare this list to the
65 $! definition of check_PROGRAMS in MAKEFILE.
67 $ check_PROGRAMS = "testSchemas testRelax testSAX testHTML testXPath testURI " -
68 + "testThreads testC14N testAutomata testRegexp testReader"
70 $!- set up build logicals -----------------------------------------------------\
73 $!- start from where the procedure is in case it's submitted in batch ----------\
75 $ whoami = f$parse(f$environment("PROCEDURE"),,,,"NO_CONCEAL")
76 $ procdir = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY")
77 $ set default 'procdir'
79 $ if f$trnlnm("XML_LIBDIR").eqs.""
81 $ if f$search("[-]lib.dir") .eqs. ""
83 $ create/directory/log [-.lib]
85 $ xml_libdir = f$parse("[-.lib]",,,"DEVICE") + f$parse("[-.lib]",,,"DIRECTORY")
86 $ define/process XML_LIBDIR 'xml_libdir'
87 $ write sys$output "Defining XML_LIBDIR as """ + f$trnlnm("XML_LIBDIR") + """
90 $ if f$trnlnm("XML_SRCDIR").eqs.""
92 $ globfile = f$search("[-...]globals.c")
95 $ write sys$output "Can't locate globals.c. You need to manually define a XML_SRCDIR logical"
98 $ srcdir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
99 $ define/process XML_SRCDIR "''srcdir'"
100 $ write sys$output "Defining XML_SRCDIR as ""''srcdir'"""
104 $ copy/log config.vms xml_srcdir:config.h
105 $! copy/log xmlversion.h [-.include.libxml]
107 $ if f$trnlnm("libxml").eqs.""
109 $ globfile = f$search("[-...]globals.h")
112 $ write sys$output "Can't locate globals.h. You need to manually define a LIBXML logical"
115 $ includedir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
116 $ define/process libxml "''includedir'"
117 $ write sys$output "Defining libxml as ""''includedir'"""
121 $!- set up error handling (such as it is) -------------------------------------
124 $ saved_default = f$environment("default")
125 $ on error then goto ERROR_OUT
126 $ on control_y then goto ERROR_OUT
128 $!- move to the source directory and create any necessary subdirs and the
131 $ set default xml_srcdir
132 $ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG]
133 $ if f$search("XML_LIBDIR:LIBXML.OLB").eqs.""
135 $ write sys$output "Creating new object library XML_LIBDIR:LIBXML.OLB"
136 $ library/create XML_LIBDIR:LIBXML.OLB
140 $ start_here: ! move this line to debug/rerun parts of this command file
142 $!- compile modules into the library ------------------------------------------
144 $ lib_command = "LIBRARY/REPLACE/LOG XML_LIBDIR:LIBXML.OLB"
147 $ write sys$output ""
148 $ write sys$output "Building modules into the LIBXML object library"
149 $ write sys$output ""
152 $ sources = f$edit(sources,"COMPRESS")
156 $ next_source = f$element (S_no," ",sources)
157 $ if next_source.nes."" .and. next_source.nes." "
160 $ on error then goto ERROR_OUT
161 $ on control_y then goto ERROR_OUT
162 $ call build 'next_source'
168 $!- now build self-test programs ----------------------------------------------
170 $! these programs are built as ordinary modules into XML_LIBDIR:LIBXML.OLB. Here they
171 $! are built a second time with /DEFINE=(STANDALONE) in which case a main()
172 $! is also compiled into the module
175 $ link_command = "LINK"
177 $ library/compress XML_LIBDIR:LIBXML.OLB
178 $ purge XML_LIBDIR:LIBXML.OLB
180 $ write sys$output ""
181 $ write sys$output "Building STANDALONE self-test programs"
182 $ write sys$output ""
184 $ call build NANOFTP.C /DEFINE=(STANDALONE)
185 $ call build NANOHTTP.C /DEFINE=(STANDALONE)
186 $ call build TRIONAN.C /DEFINE=(STANDALONE)
188 $!- now build main and test programs ------------------------------------------
192 $ link_command = "LINK"
194 $ write sys$output ""
195 $ write sys$output "Building main programs and test programs"
196 $ write sys$output ""
199 $ all_progs = bin_progs + " " + check_PROGRAMS
200 $ all_progs = f$edit(all_progs,"COMPRESS")
204 $ next_prog = f$element (p_no," ",all_progs)
205 $ if next_prog.nes."" .and. next_prog.nes." "
208 $ on error then goto ERROR_OUT
209 $ on control_y then goto ERROR_OUT
210 $ call build 'next_prog'.c
216 $!- Th-th-th-th-th-that's all folks! ------------------------------------------
218 $ goto exit_here ! move this line to avoid parts of this command file
227 $ purge/nolog [.debug]
228 $ set default 'saved_default
233 $ exit_status = $status
234 $ write sys$output "''f$message(exit_status)'"
237 $!- the BUILD subroutine. Compile then insert into library or link as required
240 $ on warning then goto EXIT_BUILD
242 $ name = f$parse(source_file,,,"NAME")
243 $ object_file = f$parse("[.debug].OBJ",name,,,"SYNTAX_ONLY")
247 $ write sys$output "''cc_command'''p2'/object=''object_file' ''source_file'"
248 $ cc_command'p2' /object='object_file 'source_file'
250 $!- insert into library if command defined
252 $ if lib_command.nes."" then lib_command 'object_file'
254 $!- link module if command defined
255 $ if link_command.nes.""
258 $ if debug then opts = "/DEBUG"
259 $ write sys$output "''link_command'''opts' ''object_file',XML_LIBDIR:libxml.olb/library"
260 $ if f$search( "sys$library:iconv.olb" ) .eqs. ""
262 $ link_command'opts' 'object_file',-
263 XML_LIBDIR:libxml.olb/library
265 $ link_command'opts' 'object_file',-
266 XML_LIBDIR:libxml.olb/library,sys$library:iconv/lib