blob: 9fe045b0ef7a97778c7789f289f0c4104cfbb4f6 [file] [log] [blame]
Daniel Veillardd33cfbf2001-11-13 15:24:36 +00001Issues in porting libxml to VMS
2===============================
3
4Here's a summary of the issues I encountered when building LIBXML under
5VMS. There was some VMS support in the version I got, but it was a little
6out of date with the result that some newer files had problems.
7
8I present this list "as is" to hopefully act as a guide to anyone having
9problems in the future.
10
11That's it. Good luck!
12
13John A Fotheringham (jaf@jafsoft.com)
14October 2001
15
16
17Installation kit
18----------------
19
20- File attributes. Having downloaded essentially a Unix distribution, some
21 of the file attributes weren't correct... especially those in the [.VMS]
22 subdirectory. In EDT you could see line feeds and carriage returns as
23 <LF><CR> etc. To correct this use the command
24
25 $ set file <filespec> /attr=rfm=stm
26
27 This sets the record format to be "stream". Other variants may be used
28 instead depending on how you got the files onto your system. Files will
29 look okay in an EDT editor once the attributes are set. Without
30 this the command file may not run correctly, since it may be interpreted
31 as a single line.
32
33- VMS-specific files are in a [.VMS] directory. If you've found this file
34 then you already know this :-) This directory contains
35
36 BUILD_LIBXML.COM - a build command file, which I've radically re-worked
37 CONFIG.VMS - a configuration file to replace config.h
38
39- Don't execute BUILD_LIBXML.COM until you've done all the following
40
41 - read these notes
42 - copied CONFIG.VMS to CONFIG.H
43 - reviewed the configuration section of BUILD_LIBXML.COM, and in particular
44 updated the module lists in line with MAKEFILE
45 - edited XMLVERSION.H so that WITH_TRIO is defined
46 - identified the location of the include files, so that you can manually
47 set the LIBXML logical if need be.
48 - re-read these notes :-p
49
50 instructions for all these steps are below.
51
52- the file [.vms]config.vms should be used to replace config.h. This file
53 contains a number of define statements that identify the software options
54 required under VMS
55
56- The include files are in a [.INCLUDE.LIBXML] subdirectory. You need
57 a logical "libxml" to point to this so that include statements of the
58 form
59
60 #include <libxml/parser.h>
61
62 will work correctly. The source files are mostly two levels above this
63 directory, although there are some .h files there as well.
64
65- The command file BUILD_LIBXML.COM will do the following
66
67 - setup some logicals
68 - set def to the source directory
69 - compile modules and place them into a LIBXML.OLB library
70 - compile and link a number of self-test programs
71 - compile and link a number of utilities and test programs
72 - set def back to the original directory (i.e. if it fails you might not be
73 where you started :-)
74
75 before running this command file review the configuration segment at
76 the top. In particular compare the lists of modules with those in the
77 most recent version of the Unix MAKEFILE. Instructions are contained
78 in the command file itself.
79
80 The command file will attempt to set two logicals
81
82 - xml_srcdir. The directory containing the source files
83 - libxml. The include file directory.
84
85 It attempts this by looking for modules globals.c and globals.h in
86 nearby directories. If this logic fails, you'll need to manually define
87 these logicals.
88
89
90The TRIO package
91----------------
92- A sub-package TRIO is used to provide some functions not naturally available
93 under VMS. These include support for infinite and undefined numbers,
94 and specialised print functions like "snprintf"
95
96 I had to make several changes to trionan.c in discussion with the author
97 (hopefully these are now included in the distro, so I won't list them here)
98
99 To build this software we need to add
100
101 /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
102
103 to the compile command for xpath.c and trio.c, and to any main program
104 that uses this functionality. BUILD_LIBXML.COM should do this for you.
105
106- to build in trio support you need the define WITH_TRIO to be set. This
107 is done by editing xmlversion.h
108
109
110Compiler and linker errors
111--------------------------
112- the DEC C compiler will produce a number of warnings when compiling the
113 C code. These include
114
115 - Implicit function warnings. These indicate functions whose type is
116 not defined in a .h file. This will probably only happen if your
117 configuration is not correct (e.g. for "snprintf" if you haven't
118 edited xmlversion.h to set WITH_TRIO
119
120 These messages also occur for "read" and "write" when compiling trio.c
121
122 - uninitialised variables. Not usually a problem. You can solve this
123 by editing the code to initialise the variables affected
124
125 and with respect to the trionan code
126
127 - no main module for UNDERFLOW_TO_ZERO
128 - float overflow when compiling trionan.c STANDALONE
129
130 You can suppress these "expected" messages by using the compile command
131
132 $ CC /WARN=DISABLE=(FLOATOVERFL,NOMAINUFLO)
133
134 This can be achieved by specifying "NOWARN" as the first command
135 parameter to BUILD_LIBXML as follows
136
137 $ @BUILD_LIBXML NOWARN
138
139- the Linker will report the following error
140
141 %LINK-W-MULDEF, symbol DECC$STRERROR multiply defined
142 in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;5
143
144 This is complaining that DECC$STRERROR is multiply defined, which in turn
145 is because this system symbol is getting added to LIBXML.OLB when strio.c
146 is compiled.
147
148 I'm not sure what the solution for this is, but this is a fairly benign error.
149
150
151Changes made to the codebase
152----------------------------
153- I changed all dummy declarations in trio.c to be
154
155 va_list dummy = NULL;
156
157 to prevent compiler whinge in TRIO.C about uninitialised variables
158
159- I had to add the following to nanoftp.c
160
161 #if defined(VMS) || defined(__VMS)
162 #define SOCKLEN_T unsigned int
163 #endif
164
165 This matches similar lines already added to nanohttp.c
166
167- Several variables and function names exceed the 31 character limit
168 used in VMS. This leads to compiler warnings. The solution adopted
169 has been
170
171 a) where variables or functions are defined, set up an ifdef on VMS
172 to define a variable/function of a shorter name. This may need to
173 be done in the .h file, and in the implementation .c file
174
175 b) use define statements to map the long name onto a shorter name. That
176 way all future code can refer to the function/variable by the long name,
177 reducing the need to add VMS-specific code everywhere.
178
179 In the current distro, I had to do this for the following names
180
181 in globals.c, parserinternals.c, globals.h, parser.h
182 xmlSubstituteEntitiesDefaultValue
183 xmlDoValidityCheckingDefaultValue
184
185 in globals.c, globals.h
186 __xmlDoValidityCheckingDefaultValue
187
188 in xmlio.c, xmlio.h
189 xmlRegisterDefaultInputCallbacks
190 xmlRegisterDefaultOutputCallbacks
191
192 in xpath.c and xpathinternals.h
193 xmlXPathRegisteredVariablesCleanup
194