summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
Diffstat (limited to 'textproc')
-rw-r--r--textproc/xerces-c/Makefile54
-rw-r--r--textproc/xerces-c/files/Makefile.in82
-rw-r--r--textproc/xerces-c/files/NetBSDDefs.hpp76
-rw-r--r--textproc/xerces-c/files/NetBSDPlatformUtils.cpp662
-rw-r--r--textproc/xerces-c/files/md53
-rw-r--r--textproc/xerces-c/files/patch-sum18
-rw-r--r--textproc/xerces-c/patches/patch-aa24
-rw-r--r--textproc/xerces-c/patches/patch-ab28
-rw-r--r--textproc/xerces-c/patches/patch-ac12
-rw-r--r--textproc/xerces-c/patches/patch-ad12
-rw-r--r--textproc/xerces-c/patches/patch-ae12
-rw-r--r--textproc/xerces-c/patches/patch-af12
-rw-r--r--textproc/xerces-c/patches/patch-ag12
-rw-r--r--textproc/xerces-c/patches/patch-ah12
-rw-r--r--textproc/xerces-c/patches/patch-ai13
-rw-r--r--textproc/xerces-c/patches/patch-aj35
-rw-r--r--textproc/xerces-c/patches/patch-ak15
-rw-r--r--textproc/xerces-c/patches/patch-al12
-rw-r--r--textproc/xerces-c/patches/patch-am14
-rw-r--r--textproc/xerces-c/patches/patch-an13
-rw-r--r--textproc/xerces-c/patches/patch-ao14
-rw-r--r--textproc/xerces-c/patches/patch-ap12
-rw-r--r--textproc/xerces-c/pkg/COMMENT1
-rw-r--r--textproc/xerces-c/pkg/DESCR8
-rw-r--r--textproc/xerces-c/pkg/PLIST206
25 files changed, 1362 insertions, 0 deletions
diff --git a/textproc/xerces-c/Makefile b/textproc/xerces-c/Makefile
new file mode 100644
index 00000000000..42f805c9e69
--- /dev/null
+++ b/textproc/xerces-c/Makefile
@@ -0,0 +1,54 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/01/13 16:38:06 skrll Exp $
+#
+
+DISTNAME= xerces-c-src1_3_0
+PKGNAME= xerces-c-1.3.0
+CATEGORIES= textproc
+MASTER_SITES= http://xml.apache.org/dist/xerces-c/stable/
+
+MAINTAINER= skrll@netbsd.org
+HOMEPAGE= http://xml.apache.org/xerces-c/
+
+DEPENDS= icu>=1.7:../../textproc/icu
+
+WRKSRC= ${WRKDIR}/xerces-c-src1_3_0/src/
+GNU_CONFIGURE= YES
+USE_GMAKE= YES
+
+ICUROOT= ${PREFIX}
+
+SCRIPT_ENV+= ICUROOT="${LOCALBASE}"
+
+FLAGS+= -O2 -I${ICUROOT}/include \
+ -DXML_USE_ICU_TRANSCODER \
+ -DXML_USE_NETACCESSOR_SOCKET \
+ -DAPP_NO_THREADS
+
+CFLAGS+= ${FLAGS}
+CXXFLAGS+= ${FLAGS}
+
+CONFIGURE_ENV+= XERCESCROOT="${WRKDIR}/xerces-c-src1_3_0" \
+ ICUROOT=${ICUROOT} \
+ NETACCESSOR=Socket \
+ TRANSCODER=ICU \
+ LIBS="-L${ICUROOT}/lib -Wl,-R${ICUROOT}/lib -L${ICUROOT}/lib/icu/current -Wl,-R${ICUROOT}/lib/icu/current"
+
+MAKE_ENV+= XERCESCROOT="${WRKDIR}/xerces-c-src1_3_0" \
+ ICUROOT="${LOCALBASE}" \
+ NETACCESSOR=Socket \
+ TRANSCODER=ICU \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}"
+
+post-extract:
+ ${MKDIR} ${WRKSRC}/util/Platforms/NetBSD
+ ${CP} \
+ ${FILESDIR}/Makefile.in \
+ ${FILESDIR}/NetBSDDefs.hpp \
+ ${FILESDIR}/NetBSDPlatformUtils.cpp \
+ ${WRKSRC}/util/Platforms/NetBSD
+
+pre-configure:
+ ${CHMOD} a+x ${WRKSRC}/configure
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/textproc/xerces-c/files/Makefile.in b/textproc/xerces-c/files/Makefile.in
new file mode 100644
index 00000000000..c1bd3129ce4
--- /dev/null
+++ b/textproc/xerces-c/files/Makefile.in
@@ -0,0 +1,82 @@
+#
+# The Apache Software License, Version 1.1
+#
+# Copyright (c) 1999-2000 The Apache Software Foundation. All rights
+# reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+#
+# 3. The end-user documentation included with the redistribution,
+# if any, must include the following acknowledgment:
+# "This product includes software developed by the
+# Apache Software Foundation (http://www.apache.org/)."
+# Alternately, this acknowledgment may appear in the software itself,
+# if and wherever such third-party acknowledgments normally appear.
+#
+# 4. The names "Xerces" and "Apache Software Foundation" must
+# not be used to endorse or promote products derived from this
+# software without prior written permission. For written
+# permission, please contact apache\@apache.org.
+#
+# 5. Products derived from this software may not be called "Apache",
+# nor may "Apache" appear in their name, without prior written
+# permission of the Apache Software Foundation.
+#
+# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+# ====================================================================
+#
+# This software consists of voluntary contributions made by many
+# individuals on behalf of the Apache Software Foundation, and was
+# originally based on software copyright (c) 1999, International
+# Business Machines, Inc., http://www.ibm.com . For more information
+# on the Apache Software Foundation, please see
+# <http://www.apache.org/>.
+#
+#
+#
+
+PLATFORM = @platform@
+CC = @cc@
+CXX = @cxx@
+CXXFLAGS = @cxxflags@
+CFLAGS = @cflags@
+PREFIX = @prefix@
+LDFLAGS = @ldflags@
+LIBS = @libs@
+OSVER = @osver@
+USELIBWWW = @uselibwww@
+MESSAGELOADER = @messageloader@
+TRANSCODER = @transcoder@
+
+MODULE = util
+
+include ../../../Makefile.incl
+
+SUBMODULE = Platforms/NetBSD
+CPP_PUBHEADERS = NetBSDDefs.hpp
+CPP_OBJECTS = NetBSDPlatformUtils.$(TO)
+
+include ../../Makefile.util.submodule
+
+CPP_OBJECTS: NetBSDPlatformUtils.cpp ${CPP_PUBHEADERS}
diff --git a/textproc/xerces-c/files/NetBSDDefs.hpp b/textproc/xerces-c/files/NetBSDDefs.hpp
new file mode 100644
index 00000000000..bd6bbd2ca04
--- /dev/null
+++ b/textproc/xerces-c/files/NetBSDDefs.hpp
@@ -0,0 +1,76 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999-2000 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com . For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/*
+ *
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+// NetBSD runs on 29 hardware plateforms...
+// ---------------------------------------------------------------------------
+#ifdef __i386__
+#define ENDIANMODE_LITTLE
+#else
+#define ENDIANMODE_BIG
+#endif
+
+typedef void* FileHandle;
+
+#ifndef NETBSD
+#define NETBSD
+#endif
diff --git a/textproc/xerces-c/files/NetBSDPlatformUtils.cpp b/textproc/xerces-c/files/NetBSDPlatformUtils.cpp
new file mode 100644
index 00000000000..34b74dcb11a
--- /dev/null
+++ b/textproc/xerces-c/files/NetBSDPlatformUtils.cpp
@@ -0,0 +1,662 @@
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999-2000 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xerces" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache\@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation, and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.ibm.com . For more information
+ * on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+/*
+ *
+ *
+ */
+
+
+// ---------------------------------------------------------------------------
+// Includes
+// ---------------------------------------------------------------------------
+
+#if !defined(APP_NO_THREADS)
+#include <pthread.h>
+#endif
+
+/* #ifndef __USE_UNIX98
+ #error __USE_UNIX98 is not defined in your compile settings
+#endif */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <libgen.h>
+#include <sys/timeb.h>
+#include <string.h>
+#include <strings.h>/* for strcasecmp & strncasecmp */
+#include <wchar.h> /* for win_t */
+#include <util/PlatformUtils.hpp>
+#include <util/RuntimeException.hpp>
+#include <util/Janitor.hpp>
+#include <util/Mutexes.hpp>
+#include <util/XMLString.hpp>
+#include <util/XMLUniDefs.hpp>
+#include <util/XMLUni.hpp>
+
+#if defined(XML_USE_ICU_TRANSCODER)
+ #include <util/Transcoders/ICU/ICUTransService.hpp>
+#else
+ // Use native transcoder. Same as -DXML_USE_NATIVE_TRANSCODER
+ #include <util/Transcoders/Iconv/IconvTransService.hpp>
+#endif
+
+
+#if defined(XML_USE_ICU_MESSAGELOADER)
+ #include <util/MsgLoaders/ICU/ICUMsgLoader.hpp>
+#else
+ // Same as -DXML_USE_INMEM_MESSAGELOADER
+ #include <util/MsgLoaders/InMemory/InMemMsgLoader.hpp>
+#endif
+
+
+#if defined (XML_USE_NETACCESSOR_SOCKET)
+ #include <util/NetAccessors/Socket/SocketNetAccessor.hpp>
+#endif
+
+
+
+// ---------------------------------------------------------------------------
+// Local Methods
+// ---------------------------------------------------------------------------
+
+static void WriteCharStr( FILE* stream, const char* const toWrite)
+{
+ if (fputs(toWrite, stream) == EOF)
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Strm_StdErrWriteFailure);
+ }
+}
+
+static void WriteUStrStdErr( const XMLCh* const toWrite)
+{
+ char* tmpVal = XMLString::transcode(toWrite);
+ ArrayJanitor<char> janText(tmpVal);
+ if (fputs(tmpVal, stderr) == EOF)
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Strm_StdErrWriteFailure);
+ }
+}
+
+static void WriteUStrStdOut( const XMLCh* const toWrite)
+ {
+ char* tmpVal = XMLString::transcode(toWrite);
+ ArrayJanitor<char> janText(tmpVal);
+ if (fputs(tmpVal, stdout) == EOF)
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Strm_StdOutWriteFailure);
+ }
+}
+
+XMLNetAccessor* XMLPlatformUtils::makeNetAccessor()
+{
+#if defined (XML_USE_NETACCESSOR_SOCKET)
+ return new SocketNetAccessor();
+#else
+ return 0;
+#endif
+}
+
+
+
+XMLCh* XMLPlatformUtils::weavePaths(const XMLCh* const basePath
+ , const XMLCh* const relativePath)
+
+{
+ // Create a buffer as large as both parts and empty it
+ XMLCh* tmpBuf = new XMLCh[XMLString::stringLen(basePath)
+ + XMLString::stringLen(relativePath)
+ + 2];
+ *tmpBuf = 0;
+
+ //
+ // If we have no base path, then just take the relative path as
+ // is.
+ //
+ if (!basePath)
+ {
+ XMLString::copyString(tmpBuf, relativePath);
+ return tmpBuf;
+ }
+
+ if (!*basePath)
+ {
+ XMLString::copyString(tmpBuf, relativePath);
+ return tmpBuf;
+ }
+
+ const XMLCh* basePtr = basePath + (XMLString::stringLen(basePath) - 1);
+ if ((*basePtr != chForwardSlash)
+ && (*basePtr != chBackSlash))
+ {
+ while ((basePtr >= basePath)
+ && ((*basePtr != chForwardSlash) && (*basePtr != chBackSlash)))
+ {
+ basePtr--;
+ }
+ }
+
+ // There is no relevant base path, so just take the relative part
+ if (basePtr < basePath)
+ {
+ XMLString::copyString(tmpBuf, relativePath);
+ return tmpBuf;
+ }
+
+ // After this, make sure the buffer gets handled if we exit early
+ ArrayJanitor<XMLCh> janBuf(tmpBuf);
+
+ //
+ // We have some path part, so we need to check to see if we ahve to
+ // weave any of the parts together.
+ //
+ const XMLCh* pathPtr = relativePath;
+ while (true)
+ {
+ // If it does not start with some period, then we are done
+ if (*pathPtr != chPeriod)
+ break;
+
+ unsigned int periodCount = 1;
+ pathPtr++;
+ if (*pathPtr == chPeriod)
+ {
+ pathPtr++;
+ periodCount++;
+ }
+
+ // Has to be followed by a \ or / or the null to mean anything
+ if ((*pathPtr != chForwardSlash) && (*pathPtr != chBackSlash)
+ && *pathPtr)
+ {
+ break;
+ }
+ if (*pathPtr)
+ pathPtr++;
+
+ // If its one period, just eat it, else move backwards in the base
+ if (periodCount == 2)
+ {
+ basePtr--;
+ while ((basePtr >= basePath)
+ && ((*basePtr != chForwardSlash) && (*basePtr != chBackSlash)))
+ {
+ basePtr--;
+ }
+
+ // The base cannot provide enough levels, so its in error/
+ if (basePtr < basePath)
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_BasePathUnderflow);
+ }
+ }
+
+ // Copy the base part up to the base pointer
+ XMLCh* bufPtr = tmpBuf;
+ const XMLCh* tmpPtr = basePath;
+ while (tmpPtr <= basePtr)
+ *bufPtr++ = *tmpPtr++;
+
+ // And then copy on the rest of our path
+ XMLString::copyString(bufPtr, pathPtr);
+
+ // Orphan the buffer and return it
+ janBuf.orphan();
+ return tmpBuf;
+}
+
+
+// ---------------------------------------------------------------------------
+// XMLPlatformUtils: Private Static Methods
+// ---------------------------------------------------------------------------
+
+//
+// This method is called by the platform independent part of this class
+// when client code asks to have one of the supported message sets loaded.
+//
+
+XMLMsgLoader* XMLPlatformUtils::loadAMsgSet(const XMLCh* const msgDomain)
+{
+ XMLMsgLoader* retVal;
+ try
+ {
+#if defined (XML_USE_ICU_MESSAGELOADER)
+ retVal = new ICUMsgLoader(msgDomain);
+#else
+ // same as -DXML_USE_INMEM_MESSAGELOADER
+ retVal = new InMemMsgLoader(msgDomain);
+#endif
+ }
+
+ catch(...)
+ {
+ panic(XMLPlatformUtils::Panic_CantLoadMsgDomain);
+ }
+ return retVal;
+}
+
+
+//
+// This method is called very early in the bootstrapping process. This guy
+// must create a transcoding service and return it. It cannot use any string
+// methods, any transcoding services, throw any exceptions, etc... It just
+// makes a transcoding service and returns it, or returns zero on failure.
+//
+
+XMLTransService* XMLPlatformUtils::makeTransService()
+{
+#if defined (XML_USE_ICU_TRANSCODER)
+ // Use ICU transcoding services.
+ // same as -DXML_USE_ICU_MESSAGELOADER
+ return new ICUTransService;
+#else
+ // Use native transcoding services.
+ // same as -DXML_USE_INMEM_MESSAGELOADER
+ return new IconvTransService;
+
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// XMLPlatformUtils: The panic method
+// ---------------------------------------------------------------------------
+void XMLPlatformUtils::panic(const PanicReasons reason)
+{
+ const char* reasonStr = "Unknown reason";
+ if (reason == Panic_NoTransService)
+ reasonStr = "Could not load a transcoding service";
+ else if (reason == Panic_NoDefTranscoder)
+ reasonStr = "Could not load a local code page transcoder";
+ else if (reason == Panic_CantFindLib)
+ reasonStr = "Could not find the xerces-c DLL";
+ else if (reason == Panic_UnknownMsgDomain)
+ reasonStr = "Unknown message domain";
+ else if (reason == Panic_CantLoadMsgDomain)
+ reasonStr = "Cannot load message domain";
+ else if (reason == Panic_SynchronizationErr)
+ reasonStr = "Cannot synchronize system or mutex";
+ else if (reason == Panic_SystemInit)
+ reasonStr = "Cannot initialize the system or mutex";
+
+ fprintf(stderr, "%s\n", reasonStr);
+
+ exit(-1);
+}
+
+
+// ---------------------------------------------------------------------------
+// XMLPlatformUtils: File Methods
+// ---------------------------------------------------------------------------
+
+unsigned int XMLPlatformUtils::curFilePos(FileHandle theFile)
+{
+ int curPos = ftell( (FILE*)theFile);
+ if (curPos == -1)
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotGetSize);
+
+ return (unsigned int)curPos;
+}
+
+void XMLPlatformUtils::closeFile(FileHandle theFile)
+{
+ if (fclose((FILE*)theFile))
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotCloseFile);
+}
+
+unsigned int XMLPlatformUtils::fileSize(FileHandle theFile)
+{
+ // Get the current position
+ long int curPos = ftell((FILE*) theFile);
+ if (curPos == -1)
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotGetCurPos);
+
+ // Seek to the end and save that value for return
+ if (fseek((FILE*) theFile, 0, SEEK_END))
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotSeekToEnd);
+
+ long int retVal = ftell((FILE*)theFile);
+ if (retVal == -1)
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotSeekToEnd);
+
+ // And put the pointer back
+
+ if (fseek( (FILE*)theFile, curPos, SEEK_SET) )
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotSeekToPos);
+
+ return (unsigned int)retVal;
+}
+
+FileHandle XMLPlatformUtils::openFile(const XMLCh* const fileName)
+{
+ const char* tmpFileName = XMLString::transcode(fileName);
+ ArrayJanitor<char> janText((char*)tmpFileName);
+ FileHandle retVal = (FILE*)fopen( tmpFileName , "rb" );
+
+ if (retVal == NULL)
+ return 0;
+ return retVal;
+}
+
+FileHandle XMLPlatformUtils::openFile(const char* const fileName)
+{
+ FileHandle retVal = (FILE*)fopen( fileName , "rb" );
+
+ if (retVal == NULL)
+ return 0;
+ return retVal;
+}
+
+
+FileHandle XMLPlatformUtils::openStdInHandle()
+{
+ return (FileHandle)fdopen(dup(0), "rb");
+}
+
+
+
+unsigned int
+XMLPlatformUtils::readFileBuffer( FileHandle theFile
+ , const unsigned int toRead
+ , XMLByte* const toFill)
+{
+ size_t noOfItemsRead = fread((void*) toFill, 1, toRead, (FILE*)theFile);
+
+ if(ferror((FILE*)theFile))
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotReadFromFile);
+ }
+
+ return (unsigned int)noOfItemsRead;
+}
+
+
+void XMLPlatformUtils::resetFile(FileHandle theFile)
+{
+ // Seek to the start of the file
+ if (fseek((FILE*)theFile, 0, SEEK_SET))
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::File_CouldNotResetFile);
+}
+
+
+// ---------------------------------------------------------------------------
+// XMLPlatformUtils: Timing Methods
+// ---------------------------------------------------------------------------
+
+unsigned long XMLPlatformUtils::getCurrentMillis()
+{
+ timeb aTime;
+ ftime(&aTime);
+ return (unsigned long)(aTime.time*1000 + aTime.millitm);
+
+}
+
+XMLCh* XMLPlatformUtils::getFullPath(const XMLCh* const srcPath)
+{
+
+ //
+ // NOTE: THe path provided has always already been opened successfully,
+ // so we know that its not some pathological freaky path. It comes in
+ // in native format, and goes out as Unicode always
+ //
+ char* newSrc = XMLString::transcode(srcPath);
+ ArrayJanitor<char> janText(newSrc);
+
+ // Use a local buffer that is big enough for the largest legal path
+ char *absPath = new char[1024];
+ // get the absolute path
+ char* retPath = realpath(newSrc, absPath);
+ ArrayJanitor<char> janText2(retPath);
+
+ if (!retPath)
+ {
+ ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetBasePathName);
+ }
+ return XMLString::transcode(absPath);
+}
+
+bool XMLPlatformUtils::isRelative(const XMLCh* const toCheck)
+{
+ // Check for pathological case of empty path
+ if (!toCheck[0])
+ return false;
+
+ //
+ // If it starts with a slash, then it cannot be relative. This covers
+ // both something like "\Test\File.xml" and an NT Lan type remote path
+ // that starts with a node like "\\MyNode\Test\File.xml".
+ //
+ if (toCheck[0] == XMLCh('/'))
+ return false;
+
+ // Else assume its a relative path
+ return true;
+}
+
+
+// -----------------------------------------------------------------------
+// Mutex methods
+// -----------------------------------------------------------------------
+
+#if !defined(APP_NO_THREADS)
+
+// ---------------------------------------------------------------------------
+// XMLPlatformUtils: Platform init method
+// ---------------------------------------------------------------------------
+
+static XMLMutex atomicOpsMutex;
+
+void XMLPlatformUtils::platformInit()
+{
+ //
+ // The atomicOps mutex needs to be created early.
+ // Normally, mutexes are created on first use, but there is a
+ // circular dependency between compareAndExchange() and
+ // mutex creation that must be broken.
+
+ atomicOpsMutex.fHandle = XMLPlatformUtils::makeMutex();
+}
+
+void* XMLPlatformUtils::makeMutex()
+{
+ pthread_mutex_t* mutex = new pthread_mutex_t;
+ pthread_mutexattr_t* attr = new pthread_mutexattr_t;
+ pthread_mutexattr_init(attr);
+ pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE);
+ if (pthread_mutex_init(mutex, attr))
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Mutex_CouldNotCreate);
+ }
+ pthread_mutexattr_destroy(attr);
+ delete attr;
+ return (void*)(mutex);
+
+}
+
+void XMLPlatformUtils::closeMutex(void* const mtxHandle)
+{
+ if (mtxHandle != NULL)
+ {
+ if (pthread_mutex_destroy((pthread_mutex_t*) mtxHandle))
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Mutex_CouldNotDestroy);
+ }
+ delete mtxHandle;
+ }
+}
+
+
+void XMLPlatformUtils::lockMutex(void* const mtxHandle)
+{
+ if (mtxHandle != NULL)
+ {
+ if (pthread_mutex_lock((pthread_mutex_t*) mtxHandle))
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Mutex_CouldNotLock);
+ }
+ }
+}
+
+
+void XMLPlatformUtils::unlockMutex(void* const mtxHandle)
+{
+ if (mtxHandle != NULL)
+ {
+ if (pthread_mutex_unlock((pthread_mutex_t*) mtxHandle))
+ {
+ ThrowXML(XMLPlatformUtilsException,
+ XMLExcepts::Mutex_CouldNotUnlock);
+ }
+ }
+}
+
+
+// -----------------------------------------------------------------------
+// Miscellaneous synchronization methods
+// -----------------------------------------------------------------------
+
+void* XMLPlatformUtils::compareAndSwap(void** toFill
+ , const void* const newValue
+ , const void* const toCompare)
+{
+ XMLMutexLock lockMutex(&atomicOpsMutex);
+
+ void *retVal = *toFill;
+ if (*toFill == toCompare)
+ *toFill = (void *)newValue;
+
+ return retVal;
+}
+
+int XMLPlatformUtils::atomicIncrement(int &location)
+{
+ XMLMutexLock localLock(&atomicOpsMutex);
+
+ return ++location;
+}
+
+int XMLPlatformUtils::atomicDecrement(int &location)
+{
+ XMLMutexLock localLock(&atomicOpsMutex);
+
+ return --location;
+}
+
+#else // #if !defined (APP_NO_THREADS)
+
+void XMLPlatformUtils::platformInit()
+{
+}
+
+void* XMLPlatformUtils::makeMutex()
+{
+ return 0;
+}
+
+void XMLPlatformUtils::closeMutex(void* const mtxHandle)
+{
+}
+
+void XMLPlatformUtils::lockMutex(void* const mtxHandle)
+{
+}
+
+void XMLPlatformUtils::unlockMutex(void* const mtxHandle)
+{
+}
+
+void* XMLPlatformUtils::compareAndSwap (void** toFill,
+ const void* const newValue,
+ const void* const toCompare)
+{
+ void *retVal = *toFill;
+ if (*toFill == toCompare)
+ *toFill = (void *)newValue;
+ return retVal;
+}
+
+int XMLPlatformUtils::atomicIncrement(int &location)
+{
+ return ++location;
+}
+
+int XMLPlatformUtils::atomicDecrement(int &location)
+{
+ return --location;
+}
+
+#endif // APP_NO_THREADS
+
+void XMLPlatformUtils::platformTerm()
+{
+ // We don't have any termination requirements at this time
+}
+
diff --git a/textproc/xerces-c/files/md5 b/textproc/xerces-c/files/md5
new file mode 100644
index 00000000000..f6294687514
--- /dev/null
+++ b/textproc/xerces-c/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1.1.1 2001/01/13 16:38:06 skrll Exp $
+
+MD5 (xerces-c-src1_3_0.tar.gz) = a4ae10402823dba553b63431cfd712dc
diff --git a/textproc/xerces-c/files/patch-sum b/textproc/xerces-c/files/patch-sum
new file mode 100644
index 00000000000..fdd5c9a2838
--- /dev/null
+++ b/textproc/xerces-c/files/patch-sum
@@ -0,0 +1,18 @@
+$NetBSD: patch-sum,v 1.1.1.1 2001/01/13 16:38:06 skrll Exp $
+
+MD5 (patch-aa) = 46f3ae05f95fad471654f57efae2db42
+MD5 (patch-ab) = 73234b9a85ba378df3be96fce07d2d8d
+MD5 (patch-ac) = 4304bdac0b9ae5074fb28637676fd150
+MD5 (patch-ad) = 7d40312f4c4889f51242add5bb0269b8
+MD5 (patch-ae) = 718cfac9401bfcc4758e00b0efa46b77
+MD5 (patch-af) = 759f795f4fbb8894dcee91bc98c4fbc4
+MD5 (patch-ag) = e5a5b87d24ccd69eacba3f75ecceccfc
+MD5 (patch-ah) = ad5d235fb590cdeb226c99aa85f0e8ad
+MD5 (patch-ai) = 6d58523a337c0d47ea2ee4fd8f4d6a68
+MD5 (patch-aj) = 47c095d503cc474f4d2d12c98b7aff1c
+MD5 (patch-ak) = 0a92c4c42c996b01e2bbc332b484bc86
+MD5 (patch-al) = 898482d5f94a22efc165d8bbe8afa12e
+MD5 (patch-am) = ec0236e11161ad01f811b25b3894f83d
+MD5 (patch-an) = 88f7fa10309a661f09661b3921fefa3b
+MD5 (patch-ao) = 9dd873e632216a67188d3070cc60f371
+MD5 (patch-ap) = 362fe9e75c10c9a9f4efe8d19d55c08c
diff --git a/textproc/xerces-c/patches/patch-aa b/textproc/xerces-c/patches/patch-aa
new file mode 100644
index 00000000000..e5d8cf695cc
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-aa
@@ -0,0 +1,24 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/01/13 16:38:22 skrll Exp $
+
+--- Makefile.incl.orig Sat Sep 30 18:37:28 2000
++++ Makefile.incl
+@@ -369,6 +369,19 @@
+ SHLIBSUFFIX=.so
+ endif
+
++#=============== NETBSD SPECIFIC OPTIONS ========================
++ifeq (${PLATFORM}, NETBSD)
++ PLATFORM_COMPILE_OPTIONS = -fPIC -instances=static -D${PLATFORM}
++ MAKE_SHARED = ${CXX} -D${PLATFORM} -shared
++ MAKE_SHARED_C = ${CC} -D${PLATFORM} -shared
++ ifeq (${TRANSCODER}, ICU)
++ ALLLIBS = ${LIBS} -L${LOCALBASE} -licuuc -licudata -lm
++ else
++ ALLLIBS = ${LIBS} -L${LOCALBASE} -lm
++ endif
++ SHLIBSUFFIX=.so
++endif
++
+ ###################### STANDARD TOOLS #############################
+ ifeq (${PLATFORM}, OS400)
+ CP = -cp -fph
diff --git a/textproc/xerces-c/patches/patch-ab b/textproc/xerces-c/patches/patch-ab
new file mode 100644
index 00000000000..8086bd763cf
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ab
@@ -0,0 +1,28 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- configure.orig Sat Sep 30 18:37:26 2000
++++ configure
+@@ -1315,6 +1315,7 @@
+ *-*-os400*) platform=OS400 ;;
+ *-*-OS400*) platform=OS400 ;;
+ *-*-osf*) platform=TRU64 ;;
++ *-*-netbsd*) platform=NETBSD ;;
+ *) platform=UNKNOWN ;;
+ esac
+
+@@ -1485,6 +1486,7 @@
+ util/Platforms/PTX/Makefile \
+ util/Platforms/UnixWare/Makefile \
+ util/Platforms/Tru64/Makefile \
++util/Platforms/NetBSD/Makefile \
+ util/Compilers/Makefile \
+ util/MsgLoaders/InMemory/Makefile \
+ util/MsgLoaders/ICU/Makefile \
+@@ -1613,6 +1615,7 @@
+ util/Platforms/PTX/Makefile \
+ util/Platforms/UnixWare/Makefile \
+ util/Platforms/Tru64/Makefile \
++util/Platforms/NetBSD/Makefile \
+ util/Compilers/Makefile \
+ util/MsgLoaders/InMemory/Makefile \
+ util/MsgLoaders/ICU/Makefile \
diff --git a/textproc/xerces-c/patches/patch-ac b/textproc/xerces-c/patches/patch-ac
new file mode 100644
index 00000000000..6f1e76ef69b
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ac
@@ -0,0 +1,12 @@
+$NetBSD: patch-ac,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- dom/Makefile.in.orig Sat Sep 30 18:37:26 2000
++++ dom/Makefile.in
+@@ -225,5 +225,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(DOM_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(DOM_CPP_PUBHEADERS) $(DOM_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(DOM_CPP_PUBHEADERS) $(DOM_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-ad b/textproc/xerces-c/patches/patch-ad
new file mode 100644
index 00000000000..c1d653a36b0
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ad
@@ -0,0 +1,12 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- framework/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ framework/Makefile.in
+@@ -179,5 +179,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(FRAMEWORK_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(FRAMEWORK_CPP_PUBHEADERS) $(FRAMEWORK_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(FRAMEWORK_CPP_PUBHEADERS) $(FRAMEWORK_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-ae b/textproc/xerces-c/patches/patch-ae
new file mode 100644
index 00000000000..9eb144e5b4c
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ae
@@ -0,0 +1,12 @@
+$NetBSD: patch-ae,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- internal/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ internal/Makefile.in
+@@ -119,5 +119,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(INTERNAL_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(INTERNAL_CPP_PUBHEADERS) $(INTERNAL_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(INTERNAL_CPP_PUBHEADERS) $(INTERNAL_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-af b/textproc/xerces-c/patches/patch-af
new file mode 100644
index 00000000000..7e4bf6a7787
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-af
@@ -0,0 +1,12 @@
+$NetBSD: patch-af,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- parsers/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ parsers/Makefile.in
+@@ -112,5 +112,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(PARSERS_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(PARSERS_CPP_PUBHEADERS) $(PARSERS_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(PARSERS_CPP_PUBHEADERS) $(PARSERS_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-ag b/textproc/xerces-c/patches/patch-ag
new file mode 100644
index 00000000000..913dd73b2f2
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ag
@@ -0,0 +1,12 @@
+$NetBSD: patch-ag,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- sax/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ sax/Makefile.in
+@@ -119,5 +119,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(SAX_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(SAX_CPP_PUBHEADERS) $(SAX_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(SAX_CPP_PUBHEADERS) $(SAX_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-ah b/textproc/xerces-c/patches/patch-ah
new file mode 100644
index 00000000000..6b527ba07ed
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ah
@@ -0,0 +1,12 @@
+$NetBSD: patch-ah,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- sax2/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ sax2/Makefile.in
+@@ -110,5 +110,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(SAX2_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(SAX2_CPP_PUBHEADERS) $(SAX2_C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(SAX2_CPP_PUBHEADERS) $(SAX2_C_FILES) $(PREFIX)/include/$(MODULE)
diff --git a/textproc/xerces-c/patches/patch-ai b/textproc/xerces-c/patches/patch-ai
new file mode 100644
index 00000000000..9c42c258936
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ai
@@ -0,0 +1,13 @@
+$NetBSD: patch-ai,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/AutoSense.hpp.orig Sat Sep 30 18:37:28 2000
++++ util/AutoSense.hpp
+@@ -179,6 +179,8 @@
+ #define XML_MACOSX
+ #elif defined(__alpha) && defined(__osf__)
+ #define XML_TRU64
++#elif defined(__NetBSD__)
++ #define XML_NETBSD
+ #else
+ #error Code requires port to host OS!
+ #endif
diff --git a/textproc/xerces-c/patches/patch-aj b/textproc/xerces-c/patches/patch-aj
new file mode 100644
index 00000000000..6e8a718ad18
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-aj
@@ -0,0 +1,35 @@
+$NetBSD: patch-aj,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/Compilers/GCCDefs.hpp.orig Sat Sep 30 18:37:28 2000
++++ util/Compilers/GCCDefs.hpp
+@@ -130,7 +130,7 @@
+ #define XERCES_DEBUG
+ #endif
+
+-
++#ifndef __NetBSD__
+ // ---------------------------------------------------------------------------
+ // Provide some common string ops that are different/notavail on GCC
+ // ---------------------------------------------------------------------------
+@@ -147,11 +147,19 @@
+ return char(toLower + 0x20);
+ return toLower;
+ }
+-
+ int stricmp(const char* const str1, const char* const str2);
+ int strnicmp(const char* const str1, const char* const str2, const unsigned int count);
++#else /* __NetBSD__ */
++#ifndef XML_NETBSD_STRICMP_DEFINED
++#define XML_NETBSD_STRICMP_DEFINED
++#include <strings.h>
++inline int stricmp(const char* const str1, const char* const str2);
++inline int strnicmp(const char* const str1, const char* const str2, const unsigned int count);
+
+-
++inline int stricmp(const char* const str1, const char* const str2) { return strcasecmp(str1,str2);}
++inline int strnicmp(const char* const str1, const char* const str2, const unsigned int count) { return strncasecmp(str1,str2,count);}
++#endif /* XML_NETBSD_STRICMP_DEFINED */
++#endif /* __NetBSD__ */
+
+ // ---------------------------------------------------------------------------
+ // The name of the DLL that is built by the GCC version of the system.
diff --git a/textproc/xerces-c/patches/patch-ak b/textproc/xerces-c/patches/patch-ak
new file mode 100644
index 00000000000..8582e73d287
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ak
@@ -0,0 +1,15 @@
+$NetBSD: patch-ak,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/Makefile.in.orig Sat Sep 30 18:37:28 2000
++++ util/Makefile.in
+@@ -392,8 +392,8 @@
+
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)
+- $(CP) $(UTIL_CPP_PUBHEADERS) $(C_FILES) $(PREFIX)/$(MODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)
++ $(CP) $(UTIL_CPP_PUBHEADERS) $(C_FILES) $(PREFIX)/include/$(MODULE)
+ cd Platforms ; $(MAKE) $@ ; cd ..
+ cd Transcoders/$(TRANSCODERMODULE) ; $(MAKE) $@ ; cd ../..
+ cd MsgLoaders/$(MESSAGELOADERMODULE) ; $(MAKE) $@ ; cd ../..
diff --git a/textproc/xerces-c/patches/patch-al b/textproc/xerces-c/patches/patch-al
new file mode 100644
index 00000000000..58210b9db45
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-al
@@ -0,0 +1,12 @@
+$NetBSD: patch-al,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/Makefile.util.submodule.orig Sat Sep 30 18:37:32 2000
++++ util/Makefile.util.submodule
+@@ -76,5 +76,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/$(SUBMODULE)/,$(CPP_PUBHEADERS))
+
+ install:
+- -mkdir -p $(PREFIX)/$(MODULE)/$(SUBMODULE)
+- $(CP) $(CPP_PUBHEADERS) $(PREFIX)/$(MODULE)/$(SUBMODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)/$(SUBMODULE)
++ $(CP) $(CPP_PUBHEADERS) $(PREFIX)/include/$(MODULE)/$(SUBMODULE)
diff --git a/textproc/xerces-c/patches/patch-am b/textproc/xerces-c/patches/patch-am
new file mode 100644
index 00000000000..0b54d03d8e6
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-am
@@ -0,0 +1,14 @@
+$NetBSD: patch-am,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/Platforms/Makefile.in.orig Sat Sep 30 18:37:34 2000
++++ util/Platforms/Makefile.in
+@@ -148,6 +148,9 @@
+ ifeq (${PLATFORM}, TRU64)
+ SUBMODULE = Tru64
+ endif
++ifeq (${PLATFORM}, NETBSD)
++ SUBMODULE = NetBSD
++endif
+
+ includes::
+ ${CD} $(SUBMODULE) ; $(MAKE) $@ ; ${CD} ..
diff --git a/textproc/xerces-c/patches/patch-an b/textproc/xerces-c/patches/patch-an
new file mode 100644
index 00000000000..e2c26d06ae0
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-an
@@ -0,0 +1,13 @@
+$NetBSD: patch-an,v 1.1.1.1 2001/01/13 16:38:23 skrll Exp $
+
+--- util/Transcoders/Iconv/IconvTransService.cpp.orig Sat Sep 30 18:37:34 2000
++++ util/Transcoders/Iconv/IconvTransService.cpp
+@@ -66,7 +66,7 @@
+ #include <util/XMLUni.hpp>
+ #include "IconvTransService.hpp"
+ #include <wchar.h>
+-#if defined (XML_GCC) || defined (XML_PTX) || defined (XML_IBMVAOS2)
++#if (defined (XML_GCC) || defined (XML_PTX) || defined (XML_IBMVAOS2)) && (!defined (XML_NETBSD))
+ #include <wctype.h>
+ #endif
+ #include <string.h>
diff --git a/textproc/xerces-c/patches/patch-ao b/textproc/xerces-c/patches/patch-ao
new file mode 100644
index 00000000000..0c4410918f6
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ao
@@ -0,0 +1,14 @@
+$NetBSD: patch-ao,v 1.1.1.1 2001/01/13 16:38:22 skrll Exp $
+
+--- util/XercesDefs.hpp.orig Sat Sep 30 18:37:34 2000
++++ util/XercesDefs.hpp
+@@ -214,6 +214,9 @@
+ #include <util/Platforms/Tru64/Tru64Defs.hpp>
+ #endif
+
++#if defined(XML_NETBSD)
++#include <util/Platforms/NetBSD/NetBSDDefs.hpp>
++#endif
+
+ // ---------------------------------------------------------------------------
+ // And now we subinclude a header according to the development environment
diff --git a/textproc/xerces-c/patches/patch-ap b/textproc/xerces-c/patches/patch-ap
new file mode 100644
index 00000000000..bf647eaba95
--- /dev/null
+++ b/textproc/xerces-c/patches/patch-ap
@@ -0,0 +1,12 @@
+$NetBSD: patch-ap,v 1.1.1.1 2001/01/13 16:38:27 skrll Exp $
+
+--- validators/DTD/Makefile.in.orig Sat Sep 30 18:37:36 2000
++++ validators/DTD/Makefile.in
+@@ -159,5 +159,5 @@
+ $(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/$(SUBMODULE)/,$(VALIDATORS_DTD_CPP_PUBHEADERS))
+
+ install::
+- -mkdir -p $(PREFIX)/$(MODULE)/$(SUBMODULE)
+- $(CP) $(VALIDATORS_DTD_CPP_PUBHEADERS) $(VALIDATORS_DTD_C_FILES) $(PREFIX)/$(MODULE)/$(SUBMODULE)
++ -mkdir -p $(PREFIX)/include/$(MODULE)/$(SUBMODULE)
++ $(CP) $(VALIDATORS_DTD_CPP_PUBHEADERS) $(VALIDATORS_DTD_C_FILES) $(PREFIX)/include/$(MODULE)/$(SUBMODULE)
diff --git a/textproc/xerces-c/pkg/COMMENT b/textproc/xerces-c/pkg/COMMENT
new file mode 100644
index 00000000000..8eda0df1c8a
--- /dev/null
+++ b/textproc/xerces-c/pkg/COMMENT
@@ -0,0 +1 @@
+The Apache Project's validating XML parser with DOM and SAX support
diff --git a/textproc/xerces-c/pkg/DESCR b/textproc/xerces-c/pkg/DESCR
new file mode 100644
index 00000000000..e8372d6dacc
--- /dev/null
+++ b/textproc/xerces-c/pkg/DESCR
@@ -0,0 +1,8 @@
+Xerces (named after the Xerces Blue butterfly) provides world-class XML
+parsing and generation. Fully-validating parsers are available for both
+Java and C++, implementing the W3C XML and DOM (Level 1 and 2) standards,
+as well as the defacto SAX (version 2) standard. The parsers are highly
+modular and configurable. Initial support for XML Schema (draft W3C
+standard) is also provided.
+
+This package provides the C++ version of Xerces.
diff --git a/textproc/xerces-c/pkg/PLIST b/textproc/xerces-c/pkg/PLIST
new file mode 100644
index 00000000000..6f2acc58ad5
--- /dev/null
+++ b/textproc/xerces-c/pkg/PLIST
@@ -0,0 +1,206 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/01/13 16:38:22 skrll Exp $
+include/dom/DOM.hpp
+include/dom/DOMString.hpp
+include/dom/DOM_Attr.hpp
+include/dom/DOM_CDATASection.hpp
+include/dom/DOM_CharacterData.hpp
+include/dom/DOM_Comment.hpp
+include/dom/DOM_DOMException.hpp
+include/dom/DOM_DOMImplementation.hpp
+include/dom/DOM_Document.hpp
+include/dom/DOM_DocumentFragment.hpp
+include/dom/DOM_DocumentType.hpp
+include/dom/DOM_Element.hpp
+include/dom/DOM_Entity.hpp
+include/dom/DOM_EntityReference.hpp
+include/dom/DOM_NamedNodeMap.hpp
+include/dom/DOM_Node.hpp
+include/dom/DOM_NodeFilter.hpp
+include/dom/DOM_NodeIterator.hpp
+include/dom/DOM_NodeList.hpp
+include/dom/DOM_Notation.hpp
+include/dom/DOM_ProcessingInstruction.hpp
+include/dom/DOM_Range.hpp
+include/dom/DOM_RangeException.hpp
+include/dom/DOM_Text.hpp
+include/dom/DOM_TreeWalker.hpp
+include/dom/DOM_XMLDecl.hpp
+include/dom/DomMemDebug.hpp
+include/framework/LocalFileInputSource.hpp
+include/framework/MemBufInputSource.hpp
+include/framework/StdInInputSource.hpp
+include/framework/URLInputSource.hpp
+include/framework/XMLAttDef.hpp
+include/framework/XMLAttDefList.hpp
+include/framework/XMLAttr.hpp
+include/framework/XMLBuffer.hpp
+include/framework/XMLBufferMgr.hpp
+include/framework/XMLContentModel.hpp
+include/framework/XMLDocumentHandler.hpp
+include/framework/XMLElementDecl.hpp
+include/framework/XMLEntityDecl.hpp
+include/framework/XMLEntityHandler.hpp
+include/framework/XMLErrorCodes.hpp
+include/framework/XMLErrorReporter.hpp
+include/framework/XMLFormatter.hpp
+include/framework/XMLNotationDecl.hpp
+include/framework/XMLPScanToken.hpp
+include/framework/XMLRecognizer.hpp
+include/framework/XMLRefInfo.hpp
+include/framework/XMLValidator.hpp
+include/framework/XMLValidityCodes.hpp
+include/internal/CharTypeTables.hpp
+include/internal/ElemStack.hpp
+include/internal/EndOfEntityException.hpp
+include/internal/ReaderMgr.hpp
+include/internal/VecAttrListImpl.hpp
+include/internal/VecAttributesImpl.hpp
+include/internal/XMLReader.hpp
+include/internal/XMLScanner.hpp
+include/parsers/DOMParser.hpp
+include/parsers/SAX2XMLReaderImpl.hpp
+include/parsers/SAXParser.hpp
+include/sax/AttributeList.hpp
+include/sax/DTDHandler.hpp
+include/sax/DocumentHandler.hpp
+include/sax/EntityResolver.hpp
+include/sax/ErrorHandler.hpp
+include/sax/HandlerBase.hpp
+include/sax/InputSource.hpp
+include/sax/Locator.hpp
+include/sax/Parser.hpp
+include/sax/SAXException.hpp
+include/sax/SAXParseException.hpp
+include/sax2/Attributes.hpp
+include/sax2/ContentHandler.hpp
+include/sax2/DefaultHandler.hpp
+include/sax2/SAX2XMLReader.hpp
+include/sax2/XMLReaderFactory.hpp
+include/util/ArrayIndexOutOfBoundsException.hpp
+include/util/AutoSense.hpp
+include/util/BinFileInputStream.hpp
+include/util/BinInputStream.hpp
+include/util/BinMemInputStream.hpp
+include/util/BitOps.hpp
+include/util/BitSet.hpp
+include/util/Compilers/BorlandCDefs.hpp
+include/util/Compilers/CSetDefs.hpp
+include/util/Compilers/CodeWarriorDefs.hpp
+include/util/Compilers/DECCXXDefs.hpp
+include/util/Compilers/GCCDefs.hpp
+include/util/Compilers/HPCCDefs.hpp
+include/util/Compilers/IBMVAOS2Defs.hpp
+include/util/Compilers/IBMVAW32Defs.hpp
+include/util/Compilers/MIPSproDefs.hpp
+include/util/Compilers/MVSCPPDefs.hpp
+include/util/Compilers/OS400SetDefs.hpp
+include/util/Compilers/PTXCCDefs.hpp
+include/util/Compilers/SCOCCDefs.hpp
+include/util/Compilers/SunCCDefs.hpp
+include/util/Compilers/SunKaiDefs.hpp
+include/util/Compilers/TandemCCDefs.hpp
+include/util/Compilers/VCPPDefs.hpp
+include/util/CountedPointer.c
+include/util/CountedPointer.hpp
+include/util/EmptyStackException.hpp
+include/util/FlagJanitor.c
+include/util/FlagJanitor.hpp
+include/util/HashBase.hpp
+include/util/HashPtr.hpp
+include/util/HashXMLCh.hpp
+include/util/IOException.hpp
+include/util/IllegalArgumentException.hpp
+include/util/InvalidCastException.hpp
+include/util/Janitor.c
+include/util/Janitor.hpp
+include/util/KVStringPair.hpp
+include/util/KeyValuePair.c
+include/util/KeyValuePair.hpp
+include/util/MsgLoaders/InMemory/CppErrMsgs_EN_US.hpp
+include/util/MsgLoaders/InMemory/InMemMsgLoader.hpp
+include/util/Mutexes.hpp
+include/util/NameIdPool.c
+include/util/NameIdPool.hpp
+include/util/NoDefTranscoderException.hpp
+include/util/NoSuchElementException.hpp
+include/util/NullPointerException.hpp
+include/util/PlatformUtils.hpp
+include/util/Platforms/NetBSD/NetBSDDefs.hpp
+include/util/RefArrayOf.c
+include/util/RefArrayOf.hpp
+include/util/RefHashTableOf.c
+include/util/RefHashTableOf.hpp
+include/util/RefStackOf.c
+include/util/RefStackOf.hpp
+include/util/RefVectorOf.c
+include/util/RefVectorOf.hpp
+include/util/RuntimeException.hpp
+include/util/StringPool.hpp
+include/util/TransENameMap.c
+include/util/TransENameMap.hpp
+include/util/TransService.hpp
+include/util/Transcoders/ICU/ICUTransService.hpp
+include/util/TranscodingException.hpp
+include/util/UTFDataFormatException.hpp
+include/util/UnexpectedEOFException.hpp
+include/util/UnsupportedEncodingException.hpp
+include/util/ValueArrayOf.c
+include/util/ValueArrayOf.hpp
+include/util/ValueStackOf.c
+include/util/ValueStackOf.hpp
+include/util/ValueVectorOf.c
+include/util/ValueVectorOf.hpp
+include/util/XML256TableTranscoder.hpp
+include/util/XML88591Transcoder.hpp
+include/util/XMLASCIITranscoder.hpp
+include/util/XMLChTranscoder.hpp
+include/util/XMLDeleterFor.c
+include/util/XMLDeleterFor.hpp
+include/util/XMLEBCDICTranscoder.hpp
+include/util/XMLEnumerator.hpp
+include/util/XMLExceptMsgs.hpp
+include/util/XMLException.hpp
+include/util/XMLIBM1140Transcoder.hpp
+include/util/XMLMsgLoader.hpp
+include/util/XMLNetAccessor.hpp
+include/util/XMLString.hpp
+include/util/XMLUCS4Transcoder.hpp
+include/util/XMLURL.hpp
+include/util/XMLUTF16Transcoder.hpp
+include/util/XMLUTF8Transcoder.hpp
+include/util/XMLUni.hpp
+include/util/XMLUniDefs.hpp
+include/util/XMLWin1252Transcoder.hpp
+include/util/XercesDefs.hpp
+include/validators/DTD/CMBinaryOp.hpp
+include/validators/DTD/CMLeaf.hpp
+include/validators/DTD/CMNode.hpp
+include/validators/DTD/CMStateSet.hpp
+include/validators/DTD/CMUnaryOp.hpp
+include/validators/DTD/ContentSpecNode.hpp
+include/validators/DTD/DFAContentModel.hpp
+include/validators/DTD/DTDAttDef.hpp
+include/validators/DTD/DTDAttDefList.hpp
+include/validators/DTD/DTDElementDecl.hpp
+include/validators/DTD/DTDEntityDecl.hpp
+include/validators/DTD/DTDValidator.hpp
+include/validators/DTD/DocTypeHandler.hpp
+include/validators/DTD/MixedContentModel.hpp
+include/validators/DTD/SimpleContentModel.hpp
+lib/libxerces-c1_3.so
+@dirrm include/validators/DTD
+@dirrm include/validators
+@dirrm include/util/Transcoders/ICU
+@dirrm include/util/Transcoders
+@dirrm include/util/Platforms/${OPSYS}
+@dirrm include/util/Platforms
+@dirrm include/util/MsgLoaders/InMemory
+@dirrm include/util/MsgLoaders
+@dirrm include/util/Compilers
+@dirrm include/util
+@dirrm include/sax2
+@dirrm include/sax
+@dirrm include/parsers
+@dirrm include/internal
+@dirrm include/framework
+@dirrm include/dom