[xml] [PATCH] build updates for libxml2 & libxslt on VMS (was Re: [xml] LIBXML2/LIBXSLT build problems on VMS)




Daniel Veillard wrote:
On Tue, Dec 17, 2002 at 11:04:57PM -0600, Craig A. Berry wrote:

At 3:40 PM +0000 12/17/02, Nigel Hall wrote:

Below are the problems I found building LIBXML2 and LIBXSLT on VMS recently.

The attached patches get both packages building fine with Compaq C 6.5
on OpenVMS Alpha 7.3-1. They do not address the reformulation of the
fwrite() call that was introducing one record per character since it
sounds like that was being dealt with already.

For libxml2 I fixed a problem in testC14N.c where several functions were
prototyped without the "static" storage class but implemented with it.
This caused a warning with my compiler about mixing external and
internal linkage. I just added "static" to the prototypes. The other
thing I changed in libxml2 was updating our version of config.h to
include some things libxslt needs.

Libxslt has had its build procedure updated to use the config.h from
libxml2 and to use the same compiler switches as libxml2. I did some
other miscellaneous clean-up of this build procedure to make it more
consistent with the one in libxml2.

Compile of TRIO.C failed on lines containing TRIO_VA_START(args, format)
with unexpected identifier.
Changed the following line in TRIODEF.H from:
  # define TRIO_VA_START(x,y) va_start((x),(y))
to:
  # define TRIO_VA_START(x,y) va_start(x,y)

   Hum, the trio code is Bjorn Reese area of expertise, I prefer to not patch
in libxml2 directly, if there is a fix it should go upstream to the trio library
then I expect Bjorn will update libxml2.

I don't think there's anything wrong with the code so I don't think
Bjorn needs to worry about it.

Shortened function names for VMS 32 character limit:
in ATTRIBUTES.C from xsltResolveStylesheetAttributeSet to
xsltResolveStylesheetAttrSet
in TEMPLATES.C from xsltAttrTemplateValueProcessNode to
xsltAttrTemplateValueProcNode

I can't reproduce this either, and since the build uses
/NAMES=SHORTENED I'm skeptical that this is really the issue you are
encountering.


   isn't the libxslt build using #define for long identifiers on
VMS like this was apparently suggested for libxml2 ?

Both packages now use a compiler switch for name shortening.

LIBXSLT
~~~~~~~
Added SECURITY.C to XSLT build script.
Added DYNAMIC.C to EXSLT build script.

Sounds good.

I've done this in the patch here.

In XSLTUTILS.C commented out the ifdefn for vsnprint, like this:

//#ifdef XSLT_NEED_TRIO
#define vsnprintf trio_vsnprintf
//#endif

   I would prefer #ifdef VMS style of patch

I've handled this and also made it include trio.h so you get the prototype for trio_vsnprintf.


   Okay can you send a (couple of) contextual diff ?

Oops.  Due to force of habit they are unified; is that ok?
--- testC14N.c;-0       Thu Dec 19 13:06:47 2002
+++ testC14N.c  Thu Dec 19 10:46:32 2002
@@ -41,12 +41,12 @@
     "--exc-without-comments\t Exclusive XML file canonization w/o comments\n");
 }
 
-xmlXPathObjectPtr
+static xmlXPathObjectPtr
 load_xpath_expr (xmlDocPtr parent_doc, const char* filename);
 
-xmlChar **parse_list(xmlChar *str);
+static xmlChar **parse_list(xmlChar *str);
 
-void print_xpath_nodes(xmlNodeSetPtr nodes);
+static void print_xpath_nodes(xmlNodeSetPtr nodes);
 
 static int 
 test_c14n(const char* xml_filename, int with_comments, int exclusive,
--- vms/config.vms;-0   Tue Oct 22 13:53:10 2002
+++ vms/config.vms      Thu Dec 19 12:04:38 2002
@@ -100,6 +100,24 @@
 /* Define if you have the <stdlib.h> header file.  */
 #define HAVE_STDLIB_H  1
 
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
 /* Define if you have the <sys/dir.h> header file.  */
 #undef HAVE_SYS_DIR_H
 
@@ -113,10 +131,10 @@
 #undef HAVE_SYS_SELECT_H
 
 /* Define if you have the <sys/socket.h> header file.  */
-#undef HAVE_SYS_SOCKET_H
+#define HAVE_SYS_SOCKET_H 1
 
 /* Define if you have the <sys/stat.h> header file.  */
-#undef HAVE_SYS_STAT_H
+#define HAVE_SYS_STAT_H 1
 
 /* Define if you have the <sys/time.h> header file.  */
 #undef HAVE_SYS_TIME_H
--- libxslt/xsltconfig.h;-0     Sun Nov 17 11:18:02 2002
+++ libxslt/xsltconfig.h        Thu Dec 19 12:12:35 2002
@@ -73,7 +73,7 @@
  * compiled in the libxml2 library.
  */
 
-#if 0
+#ifdef __VMS
 #define XSLT_NEED_TRIO
 #endif
 
--- libxslt/xsltutils.c;-0      Mon Nov  4 11:05:25 2002
+++ libxslt/xsltutils.c Thu Dec 19 13:53:40 2002
@@ -46,6 +46,13 @@
 #endif /* _MS_VER */
 #endif /* WIN32 */
 
+#ifdef XSLT_NEED_TRIO
+#include "trio.h"
+#ifdef __VMS 
+# define vsnprintf trio_vsnprintf
+#endif
+#endif
+
 /************************************************************************
  *                                                                     *
  *                     Convenience function                            *
@@ -254,10 +261,6 @@
  *                                                                     *
  ************************************************************************/
 
-#ifdef XSLT_NEED_TRIO
-#define vsnprintf trio_vsnprintf
-#endif
-
 #define XSLT_GET_VAR_STR(msg, str) {                           \
     int       size;                                            \
     int       chars;                                           \
--- vms/build_xslt.com;-0       Tue Nov 13 09:05:32 2001
+++ vms/build_xslt.com  Thu Dec 19 13:43:47 2002
@@ -12,8 +12,8 @@
 $!
 $! This procedure creates the object libraries
 $!
-$!     XMLOLB:LIBXSLT.OLB
-$!     XMLOLB:LIBEXSLT.OLB
+$!     XML_LIBDIR:LIBXSLT.OLB
+$!     XML_LIBDIR:LIBEXSLT.OLB
 $!
 $! and the program
 $!
@@ -22,7 +22,7 @@
 $! After the library is built, you can link these routines into
 $! your code with the command  
 $!
-$!     LINK your_modules,XMLOLB:LIBEXSLT/LIB,LIBXSLT/LIBRARY,LIBXML/LIB
+$!     LINK your_modules,XML_LIBDIR:LIBEXSLT/LIB,LIBXSLT/LIBRARY,LIBXML/LIB
 $!
 $! Change History
 $! --------------
@@ -33,13 +33,15 @@
 $!
 $!- compile command.
 $!
-$   if p1.eqs."DEBUG" 
-$   then 
-$     debug = "y"
-$     cc_command = "CC/DEBUG/NOOPT"
+$   cc_opts = "/INCLUDE=([],XML_SRCDIR:,[-.libxslt])/NAMES=(SHORTENED)/FLOAT=IEEE/IEEE_MODE=DENORM_RESULTS"
+$!
+$   if p1.eqs."DEBUG"
+$   then
+$     debug = "Y"
+$     cc_command = "CC''cc_opts'/DEBUG/NOOPTIMIZE/LIST/SHOW=ALL"
 $   else
-$     debug = "n"
-$     cc_command = "CC"
+$     debug = "N"
+$     cc_command = "CC''cc_opts'"
 $   endif
 $!
 $!- configure multiple build passes for each library. -------------------------
@@ -67,7 +69,7 @@
 $   src_1 = "xslt.c xsltutils.c pattern.c templates.c variables.c keys.c"
 $   src_1 = src_1 + " numbers.c extensions.c extra.c functions.c"
 $   src_1 = src_1 + " namespaces.c imports.c attributes.c documents.c"
-$   src_1 = src_1 + " preproc.c transform.c"
+$   src_1 = src_1 + " preproc.c transform.c security.c"
 $!
 $!- pass 2 - library LIBEXSLT
 $!
@@ -76,7 +78,7 @@
 $   progname_2 = ""
 $!
 $   ! see "libexslt_la_SOURCES" in [.libexslt]makefile.in
-$   src_2   = "exslt.c common.c math.c sets.c functions.c strings.c date.c saxon.c"
+$   src_2   = "exslt.c common.c math.c sets.c functions.c strings.c date.c saxon.c dynamic.c"
 $!
 $!- pass 3 - program XSLTPROC
 $!
@@ -89,19 +91,29 @@
 $!
 $!- set up and check logicals  -----------------------------------------------
 $!
-$!  XMLOLB - object library directory
+$!  XML_LIBDIR - object library directory
+$!  XML_SRCDIR - top-level build directory of libxml package -- needed for config.h and trio.h
 $!  LIBXML - source directory containing .h files for libxml package
 $!
-$   if f$trnlnm("XMLOLB").eqs.""
+$   if f$trnlnm("XML_LIBDIR").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
+$     on error then continue
+$     globfile = f$search("[--...]libxml.olb")
+$     if globfile.eqs.""
+$     then
+$       write sys$output ""
+$       write sys$output "     You need to define the XML_LIBDIR logical name to"
+$       write sys$output "     point to the directory containing your 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
+$     else
+$      srcdir = f$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
+$      define/process XML_LIBDIR "''srcdir'"
+$       write sys$output "Defining XML_LIBDIR as ""''srcdir'"""
+$     endif
 $   endif
 $!
 $   if f$trnlnm("libxml").eqs.""
@@ -124,6 +136,20 @@
 $     endif
 $   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$parse(globfile,,,"DEVICE") + f$parse(globfile,,,"DIRECTORY")
+$      define/process XML_SRCDIR "''srcdir'"
+$       write sys$output "Defining XML_SRCDIR as ""''srcdir'"""
+$     endif
+$   endif
+$!
 $!- set up some working logicals -------------------
 $!
 $ pass_no = 1
@@ -208,7 +234,7 @@
 $   if libname.nes.""
 $   then
 $     logname  = "''libname'_SRCDIR"
-$     pass_description = "the XMLOLB:''libname'.OLB object library"
+$     pass_description = "the XML_LIBDIR:''libname'.OLB object library"
 $   else
 $     logname  = "''progname'_SRCDIR"
 $     pass_description = "the programs in ''progname'"
@@ -219,10 +245,10 @@
 $!
 $   if libname.nes."" 
 $   then
-$     if f$search("XMLOLB:''libname'.OLB").eqs."" 
+$     if f$search("XML_LIBDIR:''libname'.OLB").eqs."" 
 $     then
-$       write sys$output "Creating new object library XMLOLB:''libname'.OLB..."
-$       library/create XMLOLB:'libname'.OLB
+$       write sys$output "Creating new object library XML_LIBDIR:''libname'.OLB..."
+$       library/create XML_LIBDIR:'libname'.OLB
 $     endif
 $   endif
 $!
@@ -234,7 +260,7 @@
 $!
 $   if libname.nes.""
 $   then
-$     lib_command  = "LIBRARY/REPLACE XMLOLB:''libname'.OLB"
+$     lib_command  = "LIBRARY/REPLACE XML_LIBDIR:''libname'.OLB"
 $     link_command = ""
 $   else
 $     lib_command  = ""
@@ -253,12 +279,7 @@
 $     next_source = f$element (S_no," ",src)
 $     if next_source.nes."" .and. next_source.nes." "
 $     then
-$      if link_command.nes."" .or. next_source.eqs."xsltutils.c"
-$      then
-$         call build 'next_source' /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE
-$      else
-$         call build 'next_source'
-$      endif
+$       call build 'next_source'
 $       s_no = s_no + 1
 $       goto source_loop
 $     endif
@@ -287,7 +308,7 @@
 $   on warning then goto EXIT_BUILD
 $   source_file = p1
 $   name = f$element(0,".",source_file)
-$   object_file = f$fao("XMLOLB:!AS.OBJ",name)
+$   object_file = f$fao("XML_LIBDIR:!AS.OBJ",name)
 $!
 $!- compile
 $   write sys$output "Compiling ",p1,p2,"..."
@@ -310,9 +331,9 @@
 $      dbgopts = ""
 $      if debug then dbgopts = "/DEBUG"
 $      link_command'dbgopts' 'object_file',-
-               XMLOLB:libexslt/lib,-
-               XMLOLB:libxslt/lib,-
-               XMLOLB:libxml/library
+               XML_LIBDIR:libexslt/lib,-
+               XML_LIBDIR:libxslt/lib,-
+               XML_LIBDIR:libxml/library
 $   endif
 $!
 $EXIT_BUILD:


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