[Expat-discuss] Need Help Compiling Expat on old system

Bruce Bailey Bruce_Bailey@adp.com
Thu Nov 21 15:52:56 2002


Hi

I have been struggling to build expat 1.95.5 on Motorola system V r3.  The compiler is version 1.8.6m1 Green Hills C compiler.  For some reason it doesn't appear to understand some of the macros used in the expat library.  In any case, to make any kind of progress at all, I have made the changes listed below.  Does anyone have any suggestions to make the might help an older compiler build expat?  I'm wondering if perhaps an earlier version of expat might work better.  I have tried installing the current version of the GNU compiler on my Motorola system, but no luck in getting that installed.

TIA,

Bruce

Added option -X316 to makefile compile flags
   CFLAGS = -g -X316

Added cast to malloc assignments (lib/xmlparse.c 661):
   (struct XML_ParserStruct*)

Added casts to malloc/realloc function assignments (lib/xmlparse.c 664,665):
  (void *(*)(size_t))
  (void *(*)(void *, size_t))

Added missing stddef.h (copied from linux)

   #ifndef _LINUX_STDDEF_H
   #define _LINUX_STDDEF_H

   #undef NULL
   #if defined(__cplusplus)
   #define NULL 0
   #else
   #define NULL ((void *)0)
   #endif

   #undef offsetof
   #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

   #endif

Commented out lib/expat.h (736 and 738)
   /*#define XML_STATUS_ERROR XML_STATUS_ERROR*/
   /*#define XML_STATUS_OK XML_STATUS_OK*/

Replaced lib/xmlparse.c 1597
     return V2(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION);
  with
     return "";

Changed NS(func_name) to func_name in lib/xmltok_ns.c
   :%s/NS(\([^)]*\))/\1/gc


Bruce Bailey
2525 SW First Avenue
Portland, OR 97201

(503) 294-4206
Bruce_Bailey@adp.com





More information about the Expat-discuss mailing list