Blame vms/readme.vms

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