------------------------------------------------------------------------ [Date Prev ][Date Next ] [Thread Prev ][Thread Next ] [Thread Index ] [Date Index ] [Author Index ] [xml] [libxml] OpenVMS updates for 2.4.9 ------------------------------------------------------------------------ * /From/: John A Fotheringham * /To/: xml gnome org * /Subject/: [xml] [libxml] OpenVMS updates for 2.4.9 * /Date/: Mon, 12 Nov 2001 13:23:38 +0000 ------------------------------------------------------------------------ Following my porting of version 2.4.7, here's what I found with 2.4.9 - readme.vms was missing. I've attached an updated version - I needed to set file/attr on config.vms (as described in the readme.vms file) - a reworked BUILD_LIBXML.COM is attached. This fixes a few errors and is designed to integrate better with later packages such as XSLT - various files still have 31-character name problems. A DIFFS.VMS file is attached giving the GDIFF results for the 2.4.9 release Files affected are - XMLIO.H - XPATHINTERNALS.H - GLOBALS.H - GLOBALS.C - New versions of trionan.c and trio.c are needed I've attached the readme.vms file, the build_libxml.com file and the diffs.vms file. Cheers, Jaf -- John A Fotheringham (Jaf) http://www.jafsoft.com/ Convert text files into HTML web pages or RTF documents in seconds $! BUILD_LIBXML.COM $! $! Build the LIBXML library $! $! Arguments: $! $! "NOWARN" - suppress known/expected warnings $! "DEBUG" - build everythign in debug $! $! This procedure creates an object library XMLOLB:LIBXML.OLB directory. $! After the library is built, you can link LIBXML routines into $! your code with the command $! $! $ LINK your_modules,XMLOLB:LIBXML.OLB/LIBRARY $! $! Change History $! -------------- $! Command file author : John A Fotheringham (jaf@jafsoft.com) $! Last update : 2 Nov 2001 $! $!- configuration ------------------------------------------------------------- $! $!- compile command. If p1="nowarn" suppress the expected warning types $! $ if p1.eqs."DEBUG" .or. p2.eqs."DEBUG" $ then $ debug = "Y" $ cc_command = "CC/DEBUG/NOOPT" $ else $ debug = "N" $ cc_command = "CC" $ endif $ if p1.eqs."NOWARN" then - cc_command = cc_command + "/WARN=DISABLE=(FLOATOVERFL,NOMAINUFLO)" $! $!- list of sources to be built into the LIBXML library. Compare this list $! to the definition of "libxml2_la_SOURCES" in the file MAKEFILE.IN. $! Currently this definition includes the list WITH_TRIO_SOURCES_TRUE $! $ sources = "SAX.c entities.c encoding.c error.c parserInternals.c parser.c" $ sources = sources + " tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c valid.c" $ sources = sources + " xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c " $ sources = sources + " xpointer.c xinclude.c nanohttp.c nanoftp.c " $ sources = sources + " DOCBparser.c catalog.c globals.c threads.c" $ sources = sources + " trio.c strio.c" $! $!- list of main modules to compile and link. Compare this list to the $! definition of bin_PROGRAMS in MAKEFILE.IN $! $ bin_progs = "xmllint xmlcatalog" $! $!- list of test modules to compile and link. Compare this list to the $! definition of noinst_PROGRAMS in MAKEFILE. $! $ test_progs = "testSAX testHTML testXPath testURI testDocbook testThreads" $! $!- set up build logicals -----------------------------------------------------\ $! $ if f$trnlnm("XMLOLB").eqs."" $ then $ write sys$output "" $ write sys$output " You need to define a XMLOLB logical directory to" $ write sys$output " point to the directory containing your CMS object" $ write sys$output " libraries. This should already contain LIBXML.OLB" $ write sys$output " from the libxml package, and will be the directory" $ write sys$output " the new LIBXSLT.OLB library will be placed in" $ write sys$output "" $ exit $ endif $! $ if f$trnlnm("xml_srcdir").eqs."" $ then $ globfile = f$search("[-...]globals.c") $ if globfile.eqs."" $ then $ write sys$output "Can't locate globals.c. You need to manually define a XML_SRCDIR logical" $ exit $ else $ srcdir = f$element(0,"]",globfile)+ "]" $ define/process xml_srcdir "''srcdir'" $ write sys$output "Defining xml_srcdir as ""''srcdir'""" $ endif $ endif $! $ if f$trnlnm("libxml").eqs."" $ then $ globfile = f$search("[-...]globals.h") $ if globfile.eqs."" $ then $ write sys$output "Can't locate globals.h. You need to manually define a LIBXML logical" $ exit $ else $ includedir = f$element(0,"]",globfile)+ "]" $ define/process libxml "''includedir'" $ write sys$output "Defining libxml as ""''includedir'""" $ endif $ endif $! $!- set up error handling (such as it is) ------------------------------------- $! $ exit_status = 1 $ saved_default = f$environment("default") $ on error then goto ERROR_OUT $ on control_y then goto ERROR_OUT $! $!- move to the source directory and create any necessary subdirs and the $! object library $! $ set def xml_srcdir $ if f$search("DEBUG.DIR").eqs."" then create/dir [.DEBUG] $ if f$search("XMLOLB:LIBXML.OLB").eqs."" $ then $ write sys$output "Creating new object library XMLOLB:LIBXML.OLB" $ library/create XMLOLB:LIBXML.OLB $ endif $! $ goto start_here $ start_here: ! move this line to debug/rerun parts of this command file $! $!- compile modules into the library ------------------------------------------ $! $ lib_command = "LIBRARY/REPLACE XMLOLB:LIBXML.OLB" $ link_command = "" $! $ write sys$output "" $ write sys$output "Building modules into the LIBXML object library" $ write sys$output "" $! $ s_no = 0 $ sources = f$edit(sources,"COMPRESS") $! $ source_loop: $! $ next_source = f$element (S_no," ",sources) $ if next_source.nes."" .and. next_source.nes." " $ then $! $ on error then goto ERROR_OUT $ on control_y then goto ERROR_OUT $ if next_source.eqs."xpath.c" $ then $ call build 'next_source' /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE $ else $ if next_source.eqs."trio.c" $ then $ call build 'next_source' /WARN=DISABLE=UNINIT1 $ else $ call build 'next_source' $ endif $ endif $ s_no = s_no + 1 $ goto source_loop $! $ endif $! $!- now build self-test programs ---------------------------------------------- $! $! these pograms are built as ordinary modules into XMLOLB:LIBXML.OLB. Here they $! are built a second time with /DEFINE=(STANDALONE) in which case a main() $! is also compiled into the module $ $ lib_command = "" $ link_command = "LINK" $! $ write sys$output "" $ write sys$output "Building STANDALONE self-test programs" $ write sys$output "" $! $ call build NANOFTP.C /DEFINE=(STANDALONE) $ call build NANOHTTP.C /DEFINE=(STANDALONE) $ call build TRIONAN.C /DEFINE=(STANDALONE)/IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE $! $!- now build main and test programs ------------------------------------------ $! $! $ lib_command = "" $ link_command = "LINK" $! $ write sys$output "" $ write sys$output "Building main programs and test programs" $ write sys$output "" $! $ p_no = 0 $ all_progs = bin_progs + " " + test_progs $ all_progs = f$edit(all_progs,"COMPRESS") $! $ prog_loop: $! $ next_prog = f$element (p_no," ",all_progs) $ if next_prog.nes."" .and. next_prog.nes." " $ then $! $ on error then goto ERROR_OUT $ on control_y then goto ERROR_OUT $ call build 'next_prog'.c /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE $ p_no = p_no + 1 $ goto prog_loop $! $ endif $! $!- Th-th-th-th-th-that's all folks! ------------------------------------------ $! $ goto exit_here ! move this line to avoid parts of this command file $ exit_here: $! $ exit $ goto exit_out $! $! $EXIT_OUT: $! $ purge/nolog [.debug] $ set def 'saved_default $ exit 'exit_status $! $ $ERROR_OUT: $ exit_status = $status $ write sys$output "''f$message(exit_status)'" $ goto EXIT_OUT $! $!- the BUILD subroutine. Compile then insert into library or link as required $! $BUILD: subroutine $ on warning then goto EXIT_BUILD $ source_file = p1 $ name = f$element(0,".",source_file) $ object_file = f$fao("[.debug]!AS.OBJ",name) $! $!- compile $! $ write sys$output "Compiling ",p1," ",p2,"..." $ cc_command'p2' /object='object_file 'source_file' $! $!- insert into library if command defined $! $ if lib_command.nes."" then lib_command 'object_file' $! $!- link module if command defined $ if link_command.nes."" $ then $ text = f$element(0,".",p1) ! lose the ".c" $ write sys$output "Linking ",text,"..." $ opts = "" $ if debug then opts = "/DEBUG" $ link_command'opts' 'object_file',- XMLOLB:libxml.olb/library $ endif $! $EXIT_BUILD: $ exit $status $! $endsubroutine -------------------------------------------------------------------------- GLOBALS.C 105a106 > int xmlDoValidityCheckingDefaultValue = 0; 111,121c112,113 < #if defined(VMS) || defined(__VMS) < #define PLATFORM_VMS < /* int xmlDoValidityCheckingDefaultVal = 0; < * int xmlSubstituteEntitiesDefaultVal = 0; < */ < #define xmlDoValidityCheckingDefaultValue xmlDoValidityCheckingDefaultVal < #define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal < #else < int xmlDoValidityCheckingDefaultValue = 0; < int xmlSubstituteEntitiesDefaultValue = 0; < #endif --- > int xmlSubstituteEntitiesDefaultValue = 0; > 289,291d280 < #ifdef PLATFORM_VMS < gs->xmlDoValidityCheckingDefaultVal = 0; < #else 293,294d281 < #endif < 316,318d302 < #ifdef PLATFORM_VMS < gs->xmlSubstituteEntitiesDefaultVal = 0; < #else 320d303 < #endif 404,419c387,390 < #ifdef PLATFORM_VMS < extern int xmlDoValidityCheckingDefaultVal; < #undef xmlDoValidityCheckingDefaultVal < int * < __xmlDoValidityCheckingDefVal(void) { < if (IS_MAIN_THREAD) < return (&xmlDoValidityCheckingDefaultVal); < else < return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultVal); < } < #define __xmlDoValidityCheckingDefaultValue __xmlDoValidityCheckingDefVal < #else < extern int xmlDoValidityCheckingDefaultValue; < #undef xmlDoValidityCheckingDefaultValue < int * < __xmlDoValidityCheckingDefaultValue(void) { --- > extern int xmlDoValidityCheckingDefaultValue; > #undef xmlDoValidityCheckingDefaultValue > int * > __xmlDoValidityCheckingDefaultValue(void) { 424,425c395 < } < #endif --- > } 577,592c547,550 < #ifdef PLATFORM_VMS < extern int xmlSubstituteEntitiesDefaultVal; < #undef xmlSubstituteEntitiesDefaultVal < int * < __xmlSubsEntitiesDefaultValue(void) { < if (IS_MAIN_THREAD) < return (&xmlSubstituteEntitiesDefaultVal); < else < return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultVal); < } < #define __xmlSubstituteEntitiesDefaultValue __xmlSubsEntitiesDefaultValue < #else < extern int xmlSubstituteEntitiesDefaultValue; < #undef xmlSubstituteEntitiesDefaultValue < int * < __xmlSubstituteEntitiesDefaultValue(void) { --- > extern int xmlSubstituteEntitiesDefaultValue; > #undef xmlSubstituteEntitiesDefaultValue > int * > __xmlSubstituteEntitiesDefaultValue(void) { 597,598c555 < } < #endif --- > } -------------------------------------------------------------------------- TRIO.C 113,116d112 < #if defined(VMS) || defined(__VMS) < # include < #endif /* Platform is VMS */ < 123d118 < -------------------------------------------------------------------------- GLOBALS.H 78,86c78,79 < #if defined(VMS) || defined(__VMS) < int xmlSubstituteEntitiesDefaultVal; /* 31 character name limit */ < int xmlDoValidityCheckingDefaultVal; < #define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal < #define xmlDoValidityCheckingDefaultValue xmlDoValidityCheckingDefaultVal < #else < int xmlSubstituteEntitiesDefaultValue; < int xmlDoValidityCheckingDefaultValue; < #endif --- > int xmlSubstituteEntitiesDefaultValue; > int xmlDoValidityCheckingDefaultValue; 211,226c204,209 < #if defined(VMS) || defined(__VMS) < #ifdef LIBXML_THREAD_ENABLED < extern int *__xmlDoValidityCheckingDefaultVal(void); < #define xmlDoValidityCheckingDefaultVal \ < (*(__xmlDoValidityCheckingDefaultVal())) < #else < LIBXML_DLL_IMPORT extern int xmlDoValidityCheckingDefaultVal; < #endif < #else < #ifdef LIBXML_THREAD_ENABLED < extern int *__xmlDoValidityCheckingDefaultValue(void); < #define xmlDoValidityCheckingDefaultValue \ < (*(__xmlDoValidityCheckingDefaultValue())) < #else < LIBXML_DLL_IMPORT extern int xmlDoValidityCheckingDefaultValue; < #endif --- > #ifdef LIBXML_THREAD_ENABLED > extern int *__xmlDoValidityCheckingDefaultValue(void); > #define xmlDoValidityCheckingDefaultValue \ > (*(__xmlDoValidityCheckingDefaultValue())) > #else > LIBXML_DLL_IMPORT extern int xmlDoValidityCheckingDefaultValue; 317,332c300,305 < #if defined(VMS) || defined(__VMS) < #ifdef LIBXML_THREAD_ENABLED < extern int *__xmlSubsEntitiesDefaultValue(void); < #define xmlSubsEntitiesDefaultValue \ < (*(__xmlSubsEntitiesDefaultValue())) < #else < LIBXML_DLL_IMPORT extern int xmlSubsEntitiesDefaultValue; < #endif < #else < #ifdef LIBXML_THREAD_ENABLED < extern int *__xmlSubstituteEntitiesDefaultValue(void); < #define xmlSubstituteEntitiesDefaultValue \ < (*(__xmlSubstituteEntitiesDefaultValue())) < #else < LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue; < #endif --- > #ifdef LIBXML_THREAD_ENABLED > extern int *__xmlSubstituteEntitiesDefaultValue(void); > #define xmlSubstituteEntitiesDefaultValue \ > (*(__xmlSubstituteEntitiesDefaultValue())) > #else > LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue; -------------------------------------------------------------------------- XMLIO.H 79,82d78 < #if defined(VMS) || defined(__VMS) < void xmlRegisterDefInputCallbacks (void); < #define xmlRegisterDefaultInputCallbacks xmlRegisterDefInputCallbacks < #else 84d79 < #endif 130,133d124 < #if defined(VMS) || defined(__VMS) < void xmlRegisterDefOutputCallbacks(void); < #define xmlRegisterDefaultOutputCallbacks xmlRegisterDefOutputCallbacks < #else 135,136d125 < #endif < -------------------------------------------------------------------------- XPATHINTERNALS.H 433,436d432 < #if defined(VMS) || defined(__VMS) < void xmlXPathRegisteredVarsCleanup(xmlXPathContextPtr ctxt); < #define xmlXPathRegisteredVariablesCleanup xmlXPathRegisteredVarsCleanup < #else 438d433 < #endif Issues in porting libxml to VMS =============================== Here's a summary of the issues I encountered when building LIBXML under VMS. There was some VMS support in the version I got, but it was a little out of date with the result that some newer files had problems. I present this list "as is" to hopefully act as a guide to anyone having problems in the future. That's it. Good luck! John A Fotheringham (jaf@jafsoft.com) October 2001 Installation kit ---------------- - File attributes. Having downloaded essentially a Unix distribution, some of the file attributes weren't correct... especially those in the [.VMS] subdirectory. In EDT you could see line feeds and carriage returns as etc. To correct this use the command $ set file /attr=rfm=stm This sets the record format to be "stream". Other variants may be used instead depending on how you got the files onto your system. Files will look okay in an EDT editor once the attributes are set. Without this the command file may not run correctly, since it may be interpreted as a single line. - VMS-specific files are in a [.VMS] directory. If you've found this file then you already know this :-) This directory contains BUILD_LIBXML.COM - a build command file, which I've radically re-worked CONFIG.VMS - a configuration file to replace config.h README.VMS - these readme notes - Don't execute BUILD_LIBXML.COM until you've done all the following - read these notes - defined a logical XMLOLB to point to the directory you want object libraries placed in - copied CONFIG.VMS to CONFIG.H in the main sourec directory (there may be a file CONFIG.H_IN already there) - reviewed the configuration section of BUILD_LIBXML.COM, and in particular updated the module lists in line with MAKEFILE - identified the location of the include files, so that you can manually set the LIBXML logical if need be (lookk for globals.h or xmlversion.h) - re-read these notes :-p instructions for all these steps are below. - the file [.vms]config.vms should be used to replace config.h. This file contains a number of define statements that identify the software options required under VMS - The include files are in a [.INCLUDE.LIBXML] subdirectory. You need a logical "libxml" to point to this so that include statements of the form #include will work correctly. The source files are mostly two levels above this directory, although there are some .h files there as well. - The command file BUILD_LIBXML.COM will do the following - setup some logicals - set def to the source directory - compile modules and place them into a LIBXML.OLB library - compile and link a number of self-test programs - compile and link a number of utilities and test programs - set def back to the original directory (i.e. if it fails you might not be where you started :-) before running this command file review the configuration segment at the top. In particular compare the lists of modules with those in the most recent version of the Unix MAKEFILE. Instructions are contained in the command file itself. The command file will attempt to set two logicals - xml_srcdir. The directory containing the source files - libxml. The include file directory. It attempts this by looking for modules globals.c and globals.h in nearby directories. If this logic fails, you'll need to manually define these logicals. The TRIO package ---------------- - A sub-package TRIO is used to provide some functions not naturally available under VMS. These include support for infinite and undefined numbers, and specialised print functions like "snprintf" I had to make several changes to trionan.c in discussion with the author (hopefully these are now included in the distro, so I won't list them here) To build this software we need to add /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE to the compile command for xpath.c and trio.c, and to any main program that uses this functionality. BUILD_LIBXML.COM should do this for you. Compiler and linker errors -------------------------- - the DEC C compiler will produce a number of warnings when compiling the C code. These include - Implicit function warnings. These indicate functions whose type is not defined in a .h file. This will probably only happen if your configuration is not correct (e.g. for "snprintf" if you haven't edited xmlversion.h to set WITH_TRIO - uninitialised variables. Not usually a problem. You can solve this by editing the code to initialise the variables affected and with respect to the trionan code - no main module for UNDERFLOW_TO_ZERO - in XPATH.C, maybe others - float overflow when compiling trionan.c STANDALONE You can suppress these "expected" messages by using the compile command $ CC /WARN=DISABLE=(FLOATOVERFL,NOMAINUFLO) This can be achieved by specifying "NOWARN" as the first command parameter to BUILD_LIBXML as follows $ @BUILD_LIBXML NOWARN - the Linker will report the following error %LINK-W-MULDEF, symbol DECC$STRERROR multiply defined in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;5 This is complaining that DECC$STRERROR is multiply defined, which in turn is because this system symbol is getting added to LIBXML.OLB when strio.c is compiled. I'm not sure what the solution for this is, but this is a fairly benign error. Changes made to the codebase ---------------------------- - I changed all dummy declarations in trio.c to be va_list dummy = NULL; to prevent compiler whinge in TRIO.C about uninitialised variables - I had to add the following to nanoftp.c #if defined(VMS) || defined(__VMS) #define SOCKLEN_T unsigned int #endif This matches similar lines already added to nanohttp.c - Several variables and function names exceed the 31 character limit used in VMS. This leads to compiler warnings. The solution adopted has been a) where variables or functions are defined, set up an ifdef on VMS to define a variable/function of a shorter name. This may need to be done in the .h file, and in the implementation .c file b) use define statements to map the long name onto a shorter name. That way all future code can refer to the function/variable by the long name, reducing the need to add VMS-specific code everywhere. In the current distro, I had to do this for the following names in globals.c, parserinternals.c, globals.h, parser.h xmlSubstituteEntitiesDefaultValue xmlDoValidityCheckingDefaultValue in globals.c, globals.h __xmlDoValidityCheckingDefaultValue in xmlio.c, xmlio.h xmlRegisterDefaultInputCallbacks xmlRegisterDefaultOutputCallbacks in xpath.c and xpathinternals.h xmlXPathRegisteredVariablesCleanup ------------------------------------------------------------------------ ------------------------------------------------------------------------ [Date Prev ][Date Next ] [Thread Prev ][Thread Next ] [Thread Index ] [Date Index ] [Author Index ]