[libxml2] Various portability patches for OpenVMS



commit 4d041a2e809f538c87af261f86008b6de833ca2b
Author: Jacob (Jouk) Jansen <joukj hrem nano tudelft nl>
Date:   Tue Dec 17 15:32:57 2013 +0800

    Various portability patches for OpenVMS
    
    Available from http://nchrem.tnw.tudelft.nl/openvms/software2.html

 trio.c               |   14 ++++++++++----
 triostr.c            |    4 +++-
 vms/build_libxml.com |   17 ++++++++++++-----
 vms/config.vms       |    7 +++++++
 4 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/trio.c b/trio.c
index adfd324..1016a5a 100644
--- a/trio.c
+++ b/trio.c
@@ -99,7 +99,7 @@
 #endif
 #include <stddef.h>
 
-#ifdef HAVE_ERRNO_H
+#if defined( HAVE_ERRNO_H ) || defined( __VMS )
 #include <errno.h>
 #endif
 
@@ -218,7 +218,7 @@ typedef unsigned long int trio_ulonglong_t;
 #endif
 
 /* Maximal and fixed integer types */
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
+#if defined(TRIO_COMPILER_SUPPORTS_C99) && !defined( __VMS )
 # include <stdint.h>
 typedef intmax_t trio_intmax_t;
 typedef uintmax_t trio_uintmax_t;
@@ -226,8 +226,12 @@ typedef int8_t trio_int8_t;
 typedef int16_t trio_int16_t;
 typedef int32_t trio_int32_t;
 typedef int64_t trio_int64_t;
-#elif defined(TRIO_COMPILER_SUPPORTS_UNIX98)
+#elif defined(TRIO_COMPILER_SUPPORTS_UNIX98) || defined( __VMS )
 # include <inttypes.h>
+#ifdef __VMS
+typedef long long int          intmax_t;
+typedef unsigned long long int uintmax_t;
+#endif
 typedef intmax_t trio_intmax_t;
 typedef uintmax_t trio_uintmax_t;
 typedef int8_t trio_int8_t;
@@ -318,7 +322,9 @@ typedef trio_longlong_t trio_int64_t;
 #define NAN_UPPER "NAN"
 
 #if !defined(HAVE_ISASCII) && !defined(isascii)
-#  define isascii(x) ((unsigned int)(x) < 128)
+#ifndef __VMS
+# define isascii(x) ((unsigned int)(x) < 128)
+#endif
 #endif
 
 /* Various constants */
diff --git a/triostr.c b/triostr.c
index 3c5c667..123bbeb 100644
--- a/triostr.c
+++ b/triostr.c
@@ -52,7 +52,9 @@
 # define BOOLEAN_T int
 #endif
 
-#if defined(TRIO_COMPILER_SUPPORTS_C99)
+#ifdef __VMS
+# define USE_STRTOD
+#elif defined(TRIO_COMPILER_SUPPORTS_C99)
 # define USE_STRTOD
 # define USE_STRTOF
 #elif defined(TRIO_COMPILER_MSVC)
diff --git a/vms/build_libxml.com b/vms/build_libxml.com
index 816e64d..3a6fcc0 100755
--- a/vms/build_libxml.com
+++ b/vms/build_libxml.com
@@ -31,7 +31,7 @@ $!- configuration -------------------------------------------------------------
 $!
 $!- compile command.  If p1="nowarn" suppress the expected warning types
 $!
-$   cc_opts = "/DEF=HAVE_CONFIG_H/NAMES=(SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS/INCLUDE=xml_srcdir"
+$   cc_opts = 
"/nowarn/DEF=HAVE_CONFIG_H/NAMES=(as_is,SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS/INCLUDE=xml_srcdir"
 $!
 $   if p1.eqs."DEBUG" .or. p2.eqs."DEBUG"
 $   then
@@ -46,15 +46,15 @@ $!- 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"
-$   sources = sources + " parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c"
+$   sources = "parser.c SAX.c entities.c encoding.c error.c parserInternals.c"
+$   sources = sources + " tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c"
 $   sources = sources + " valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c"
 $   sources = sources + " xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c"
 $   sources = sources + " catalog.c globals.c threads.c c14n.c xmlstring.c"
 $   sources = sources + " xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c"
 $   sources = sources + " triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c"
 $   sources = sources + " xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c"
-$   sources = sources + " schematron.c"
+$   sources = sources + " schematron.c xmlmodule.c buf.c"
 $!
 $!- list of main modules to compile and link.  Compare this list to the
 $!  definition of bin_PROGRAMS in MAKEFILE.IN
@@ -102,6 +102,7 @@ $     endif
 $   endif
 $!
 $   copy/log config.vms xml_srcdir:config.h
+$!   copy/log xmlversion.h [-.include.libxml]
 $!
 $   if f$trnlnm("libxml").eqs.""
 $   then
@@ -256,8 +257,14 @@ $   then
 $      opts = ""
 $      if debug then opts = "/DEBUG"
 $      write sys$output "''link_command'''opts' ''object_file',XML_LIBDIR:libxml.olb/library"
-$      link_command'opts' 'object_file',-
+$      if f$search( "sys$library:iconv.olb" ) .eqs. ""
+$      then
+$        link_command'opts' 'object_file',-
                XML_LIBDIR:libxml.olb/library
+$      else
+$        link_command'opts' 'object_file',-
+               XML_LIBDIR:libxml.olb/library,sys$library:iconv/lib
+$      endif
 $   endif
 $!
 $EXIT_BUILD:
diff --git a/vms/config.vms b/vms/config.vms
index 6ecfa47..d1cd7f3 100755
--- a/vms/config.vms
+++ b/vms/config.vms
@@ -19,6 +19,8 @@
 #undef HAVE_LIBHISTORY
 #undef HAVE_LIBREADLINE
 
+#define ICONV_CONST
+
 /* Define if you have the class function.  */
 #undef HAVE_CLASS
 
@@ -207,3 +209,8 @@
 #endif
 
 #define xmlBufferWriteChar xmlBufferWriteChar2
+
+#include <inttypes.h>
+
+#define HAVE_DLOPEN 1
+#define HAVE_DLFCN_H 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]