38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncIssues in porting libxml to VMS
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync===============================
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncHere's a summary of the issues I encountered when building LIBXML under
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncVMS. There was some VMS support in the version I got, but it was a little
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncout of date with the result that some newer files had problems.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncI present this list "as is" to hopefully act as a guide to anyone having
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncproblems in the future.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncThat's it. Good luck!
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncJohn A Fotheringham (jaf@jafsoft.com)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncOctober 2001
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncUpdated October 2002 by Craig A Berry (craigberry@mac.com)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncInstallation kit
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync----------------
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- File attributes. Having downloaded essentially a Unix distribution, some
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync of the file attributes weren't correct... especially those in the [.VMS]
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync subdirectory. In EDT you could see line feeds and carriage returns as
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync <LF><CR> etc. To correct this use the command
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync $ set file <filespec> /attr=rfm=stm
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync This sets the record format to be "stream". Other variants may be used
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync instead depending on how you got the files onto your system. Files will
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync look okay in an EDT editor once the attributes are set. Without
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync this the command file may not run correctly, since it may be interpreted
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync as a single line.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- VMS-specific files are in a [.VMS] directory. If you've found this file
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync then you already know this :-) This directory contains
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync BUILD_LIBXML.COM - a build command file, which I've radically re-worked
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync CONFIG.VMS - a configuration file to replace config.h
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- Don't execute BUILD_LIBXML.COM until you've done all the following
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - read these notes
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - reviewed the configuration section of BUILD_LIBXML.COM, and in particular
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync updated the module lists in line with MAKEFILE
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - identified the location of the include files, so that you can manually
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync set the LIBXML logical if need be.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - re-read these notes :-p
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync instructions for all these steps are below.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- the file [.vms]config.vms is used in lieu of a Configure-generated config.h.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync This file contains a number of define statements that identify the software
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync options required under VMS
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- The include files are in a [.INCLUDE.LIBXML] subdirectory. You need
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync a logical "libxml" to point to this so that include statements of the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync form
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync #include <libxml/parser.h>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync will work correctly. The source files are mostly two levels above this
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync directory, although there are some .h files there as well.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- The command file BUILD_LIBXML.COM will do the following
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - setup some logicals
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - set def to the source directory
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - compile modules and place them into a LIBXML.OLB library
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - compile and link a number of self-test programs
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - compile and link a number of utilities and test programs
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - set def back to the original directory (i.e. if it fails you might not be
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync where you started :-)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync before running this command file review the configuration segment at
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync the top. In particular compare the lists of modules with those in the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync most recent version of the Unix MAKEFILE. Instructions are contained
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync in the command file itself.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync The command file will attempt to set two logicals
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - xml_srcdir. The directory containing the source files
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - libxml. The include file directory.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync It attempts this by looking for modules globals.c and globals.h in
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync nearby directories. If this logic fails, you'll need to manually define
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync these logicals.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncThe TRIO package
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync----------------
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- A sub-package TRIO is used to provide some functions not naturally available
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync under VMS. These include support for infinite and undefined numbers,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync and specialised print functions like "snprintf"
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync I had to make several changes to trionan.c in discussion with the author
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync (hopefully these are now included in the distro, so I won't list them here)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync To build this software we need to add
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync to the compile command for xpath.c and trio.c, and to any main program
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync that uses this functionality. BUILD_LIBXML.COM should do this for you.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- to build in trio support you need the define WITH_TRIO to be set. This
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync is done by default for VMS in xmlversion.h
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncCompiler and linker errors
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync--------------------------
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- the DEC C compiler may produce a number of warnings when compiling the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync C code. These include
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - Implicit function warnings. These indicate functions whose type is
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync not defined in a .h file. This will probably only happen if your
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync configuration is not correct (e.g. for "snprintf" if you haven't
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync edited xmlversion.h to set WITH_TRIO
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync - uninitialised variables. Not usually a problem. You can solve this
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync by editing the code to initialise the variables affected
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncChanges made to the codebase
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync----------------------------
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- I changed all dummy declarations in trio.c to be
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync va_list dummy = NULL;
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync to prevent compiler whinge in TRIO.C about uninitialised variables
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- I had to add the following to nanoftp.c
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync #if defined(VMS) || defined(__VMS)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync #define SOCKLEN_T unsigned int
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync #endif
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync This matches similar lines already added to nanohttp.c
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync- Several variables and function names exceed the 31 character limit
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync of the VMS linker. The solution adopted has been to use the
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync /NAMES=SHORTENED compiler option, which requires DEC/Compaq C 5.7
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync or later. For a complete list of the names that needed shortening
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync and the short names generated by the compiler, see [.vms]config.vms.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync