From 5052dd1fcb1cb52877c1c26a6a784fc8bf264d1a Mon Sep 17 00:00:00 2001 From: joerg Date: Sat, 31 Dec 2005 00:56:42 +0000 Subject: Add DragonFly support. Fix a number of GCC 3.4 issues. --- textproc/xerces-c/Makefile | 6 +- textproc/xerces-c/distinfo | 22 +- textproc/xerces-c/patches/patch-af | 30 +- textproc/xerces-c/patches/patch-ag | 23 ++ textproc/xerces-c/patches/patch-ah | 12 + textproc/xerces-c/patches/patch-ai | 13 + textproc/xerces-c/patches/patch-aj | 26 ++ textproc/xerces-c/patches/patch-ak | 26 ++ textproc/xerces-c/patches/patch-al | 12 + textproc/xerces-c/patches/patch-am | 23 ++ textproc/xerces-c/patches/patch-an | 28 ++ textproc/xerces-c/patches/patch-ao | 23 ++ textproc/xerces-c/patches/patch-ap | 14 + textproc/xerces-c/patches/patch-aq | 14 + textproc/xerces-c/patches/patch-ar | 15 + textproc/xerces-c/patches/patch-as | 74 ++++ textproc/xerces-c/patches/patch-at | 667 +++++++++++++++++++++++++++++++++++++ textproc/xerces-c/patches/patch-au | 89 +++++ textproc/xerces-c/patches/patch-av | 13 + textproc/xerces-c/patches/patch-aw | 21 ++ textproc/xerces-c/patches/patch-ax | 171 ++++++++++ 21 files changed, 1315 insertions(+), 7 deletions(-) create mode 100644 textproc/xerces-c/patches/patch-ag create mode 100644 textproc/xerces-c/patches/patch-ah create mode 100644 textproc/xerces-c/patches/patch-ai create mode 100644 textproc/xerces-c/patches/patch-aj create mode 100644 textproc/xerces-c/patches/patch-ak create mode 100644 textproc/xerces-c/patches/patch-al create mode 100644 textproc/xerces-c/patches/patch-am create mode 100644 textproc/xerces-c/patches/patch-an create mode 100644 textproc/xerces-c/patches/patch-ao create mode 100644 textproc/xerces-c/patches/patch-ap create mode 100644 textproc/xerces-c/patches/patch-aq create mode 100644 textproc/xerces-c/patches/patch-ar create mode 100644 textproc/xerces-c/patches/patch-as create mode 100644 textproc/xerces-c/patches/patch-at create mode 100644 textproc/xerces-c/patches/patch-au create mode 100644 textproc/xerces-c/patches/patch-av create mode 100644 textproc/xerces-c/patches/patch-aw create mode 100644 textproc/xerces-c/patches/patch-ax (limited to 'textproc') diff --git a/textproc/xerces-c/Makefile b/textproc/xerces-c/Makefile index 846ab094cd1..936c8498524 100644 --- a/textproc/xerces-c/Makefile +++ b/textproc/xerces-c/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.25 2005/10/23 23:35:17 rillig Exp $ +# $NetBSD: Makefile,v 1.26 2005/12/31 00:56:42 joerg Exp $ # DISTNAME= xerces-c-src_2_3_0 @@ -50,6 +50,10 @@ PLIST_SUBST+= ${PLIST_SUBST.${ICONV_TYPE}-iconv} .include "../../converters/libiconv/buildlink3.mk" +pre-configure: + @${CP} ${PKGSRCDIR}/mk/gnu-config/config.guess ${WRKSRC} + @${CP} ${PKGSRCDIR}/mk/gnu-config/config.sub ${WRKSRC} + post-install: ${INSTALL_DATA} ${WRKSRC}/dom/impl/*.hpp \ ${PREFIX}/include/xercesc/dom/impl diff --git a/textproc/xerces-c/distinfo b/textproc/xerces-c/distinfo index ba407b04c31..0ce6cfc1ef4 100644 --- a/textproc/xerces-c/distinfo +++ b/textproc/xerces-c/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2005/02/24 14:48:50 agc Exp $ +$NetBSD: distinfo,v 1.9 2005/12/31 00:56:42 joerg Exp $ SHA1 (xerces-c-src_2_3_0.tar.gz) = ea47e1899d569344e7ff1ca09f31f725bbe92033 RMD160 (xerces-c-src_2_3_0.tar.gz) = 65234d5b0a3a53ad088108710adbf6d419aa61b5 @@ -8,4 +8,22 @@ SHA1 (patch-ab) = 673eee8137b79deae52297424a68293a00b53a91 SHA1 (patch-ac) = fb187d0c5b7dbc09d31be8dea09c88bea755f87d SHA1 (patch-ad) = 9e6afe4ac10a34201f05198bb62829438de5dc7c SHA1 (patch-ae) = 8e9abade53b8b390fe1e0d00bfa037ebc01f9deb -SHA1 (patch-af) = fd27fa9d54dcfd521d035b840008a109c241e57a +SHA1 (patch-af) = 232a0a8520df9896154a6de1c180558a41f9cce8 +SHA1 (patch-ag) = 1fc655d5271a7608db6b9c487936370f1a5e07f6 +SHA1 (patch-ah) = ea7118f8fbdcb8f74338bd3df8852c9b003ed9fb +SHA1 (patch-ai) = b17973cc69bc118ad4104e76a47a4623bd5aa469 +SHA1 (patch-aj) = d6c554ab31426bc14767945038aeeee7de460fd9 +SHA1 (patch-ak) = 7b5e5f45897e7b90c650df5c915c5e1565d72757 +SHA1 (patch-al) = 7521f31697a9898e2fa1de54e75aa408d00c4926 +SHA1 (patch-am) = 89ae1533f714a6bca9522c01c932d265b7eb6823 +SHA1 (patch-an) = a5163709320872b5d4c35be8fc33fc1cea237bae +SHA1 (patch-ao) = 1670e577ed0f4ae2d62383a3ec774a3089da9145 +SHA1 (patch-ap) = 3be27f7bdb09177af13360e9a7cddd97d4382b52 +SHA1 (patch-aq) = 34366da43cbea723c502e131fce2e5919193b885 +SHA1 (patch-ar) = 50b16ef061bc35bcc78d7b10fb8b12cbbf87274c +SHA1 (patch-as) = fc62935c5653e9ae9a0a8e53c910e8c57753d8cb +SHA1 (patch-at) = e153dc19474c0c2668c97dbd705d51fdc6dc1071 +SHA1 (patch-au) = d689cb28a58a60390bc046d56b507a7855182650 +SHA1 (patch-av) = 2eb019a7492e470d128ae4bc4332c7f85dc5ad84 +SHA1 (patch-aw) = ff41b39f0fca3f512362b51d1dec5c9113ca5f9d +SHA1 (patch-ax) = 7728907cc7a2ccfcbd659fcb13440c8f3c02008c diff --git a/textproc/xerces-c/patches/patch-af b/textproc/xerces-c/patches/patch-af index f810903c6c9..1b22f2a4fb6 100644 --- a/textproc/xerces-c/patches/patch-af +++ b/textproc/xerces-c/patches/patch-af @@ -1,8 +1,30 @@ -$NetBSD: patch-af,v 1.4 2004/09/18 02:46:13 minskim Exp $ +$NetBSD: patch-af,v 1.5 2005/12/31 00:56:42 joerg Exp $ ---- Makefile.incl.orig Tue May 27 15:04:46 2003 -+++ Makefile.incl Fri Sep 17 00:36:28 2004 -@@ -579,6 +579,11 @@ +--- Makefile.incl.orig 2003-05-27 15:04:46.000000000 +0000 ++++ Makefile.incl +@@ -373,6 +373,21 @@ SHLIBSUFFIX=.so + LD_SONAME = -Wl,-soname,${SO_NAME} + endif + ++#=============== DRAGONFLY SPECIFIC OPTIONS ========================= ++ifeq (${PLATFORM}, DRAGONFLY) ++MAKE_SHARED = ${CXX} -D${PLATFORM} -shared -fPIC ${LDFLAGS} ++MAKE_SHARED_C = ${CC} -D${PLATFORM} -shared -fPIC ${LDFLAGS} ++ifeq (${TRANSCODER}, ICU) ++ PLATFORM_COMPILE_OPTIONS = -fPIC -D${PLATFORM} -I/usr/local/include ++ ALLLIBS = ${LIBS} -L/usr/local/lib -licuuc -L${ICUROOT} -licudata -lgcc ++else ++ PLATFORM_COMPILE_OPTIONS = -fPIC -D${PLATFORM} ++ ALLLIBS = ${LIBS} ++endif ++SHLIBSUFFIX=.so ++## Compiler switch to embed a library name ++LD_SONAME = -Wl,-soname,${SO_NAME} ++endif + #=============== NETBSD SPECIFIC OPTIONS ========================= + ifeq (${PLATFORM}, NETBSD) + MAKE_SHARED = ${CXX} -D${PLATFORM} -shared -fPIC ${LDFLAGS} +@@ -579,6 +594,11 @@ ifeq (${PLATFORM}, CYGWIN) endif diff --git a/textproc/xerces-c/patches/patch-ag b/textproc/xerces-c/patches/patch-ag new file mode 100644 index 00000000000..c8655da362a --- /dev/null +++ b/textproc/xerces-c/patches/patch-ag @@ -0,0 +1,23 @@ +$NetBSD: patch-ag,v 1.4 2005/12/31 00:56:42 joerg Exp $ + +--- ../../tests/runConfigure.orig 2005-12-30 23:54:50.000000000 +0000 ++++ ../../tests/runConfigure +@@ -196,7 +196,7 @@ echo "Extra link options: $linkeroptions + # Now check if the options are correct or not, bail out if incorrect + # + case $platform in +- aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin | qnx) ++ aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin | qnx | dragonfly) + # platform has been recognized + ;; + *) +@@ -264,6 +264,9 @@ else + elif test $platform = "freebsd"; then + threadingLibs="-pthread -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" ++ elif test $platform = "dragonfly"; then ++ threadingLibs="-pthread -lc_r" ++ threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + elif test $platform = "netbsd"; then + threadingLibs="-pthread" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" diff --git a/textproc/xerces-c/patches/patch-ah b/textproc/xerces-c/patches/patch-ah new file mode 100644 index 00000000000..232ae2a3b29 --- /dev/null +++ b/textproc/xerces-c/patches/patch-ah @@ -0,0 +1,12 @@ +$NetBSD: patch-ah,v 1.4 2005/12/31 00:56:42 joerg Exp $ + +--- ../../tests/configure.orig 2005-12-30 23:55:36.000000000 +0000 ++++ ../../tests/configure +@@ -1363,6 +1363,7 @@ case "${host}" in + *-*-linux*) platform=LINUX ;; + *-*-nto*) platform=QNX ;; + *-*-freebsd*) platform=FREEBSD ;; ++ *-*-dragonfly*) platform=DRAGONFLY ;; + *-*-netbsd*) platform=NETBSD ;; + *-*-irix*) platform=IRIX ;; + *-*-aix*) platform=AIX ;; diff --git a/textproc/xerces-c/patches/patch-ai b/textproc/xerces-c/patches/patch-ai new file mode 100644 index 00000000000..c02b0f66ea9 --- /dev/null +++ b/textproc/xerces-c/patches/patch-ai @@ -0,0 +1,13 @@ +$NetBSD: patch-ai,v 1.4 2005/12/31 00:56:42 joerg Exp $ + +--- ../../tests/ThreadTest/ThreadTest.cpp.orig 2005-12-30 23:56:17.000000000 +0000 ++++ ../../tests/ThreadTest/ThreadTest.cpp +@@ -122,7 +122,7 @@ void ThreadFuncs::startThread(ThreadFunc + } + + +-#elif defined (AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined (OS390) || defined(FREEBSD) || defined(__CYGWIN__) || defined(__QNXNTO__) ++#elif defined (AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined (OS390) || defined(FREEBSD) || defined(__CYGWIN__) || defined(__QNXNTO__) || defined(DRAGONFLY) + #include + #include + #include diff --git a/textproc/xerces-c/patches/patch-aj b/textproc/xerces-c/patches/patch-aj new file mode 100644 index 00000000000..a8e97bdd44f --- /dev/null +++ b/textproc/xerces-c/patches/patch-aj @@ -0,0 +1,26 @@ +$NetBSD: patch-aj,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- ../../tests/Makefile.incl.orig 2005-12-30 23:56:39.000000000 +0000 ++++ ../../tests/Makefile.incl +@@ -234,6 +234,21 @@ ifeq (${PLATFORM}, FREEBSD) + SHLIBSUFFIX=.so + endif + ++#=============== DRAGONFLY SPECIFIC OPTIONS ========================= ++ifeq (${PLATFORM}, DRAGONFLY) ++ CMP= -c ${CXXFLAGS} ++ CC= ${COMPILER} -c -D${PLATFORM} -fPIC ++ LINK = ${COMPILER} -D${PLATFORM} -fPIC ${LDFLAGS} ++ PLATFORM_LIB_LINK_OPTIONS=-Wl,-rpath,${XERCESCROOT}/lib ++ ifdef ICUROOT ++ PLATFORM_LIB_LINK_OPTIONS+=-L${ICUROOT} -Wl,-rpath,${ICUROOT} ++ EXTRA_LINK_OPTIONS=-licudata -lstdc++ ${EXTRA_LIBS} ++ else ++ EXTRA_LINK_OPTIONS=${EXTRA_LIBS} -lstdc++ ++ endif ++ SHLIBSUFFIX=.so ++endif ++ + #=============== NETBSD SPECIFIC OPTIONS ========================= + ifeq (${PLATFORM}, NETBSD) + CMP= -c ${CXXFLAGS} diff --git a/textproc/xerces-c/patches/patch-ak b/textproc/xerces-c/patches/patch-ak new file mode 100644 index 00000000000..5b44bebd53b --- /dev/null +++ b/textproc/xerces-c/patches/patch-ak @@ -0,0 +1,26 @@ +$NetBSD: patch-ak,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- ../../samples/Makefile.incl.orig 2005-12-30 23:57:33.000000000 +0000 ++++ ../../samples/Makefile.incl +@@ -235,6 +235,21 @@ ifeq (${PLATFORM}, FREEBSD) + SHLIBSUFFIX=.so + endif + ++#=============== DRAGONFLY SPECIFIC OPTIONS ========================= ++ifeq (${PLATFORM}, DRAGONFLY) ++ CMP= -c ${CXXFLAGS} ++ CC= ${COMPILER} -c -D${PLATFORM} -fPIC ++ LINK = ${COMPILER} -D${PLATFORM} -fPIC ${LDFLAGS} ++ PLATFORM_LIB_LINK_OPTIONS=-Wl,-rpath,${XERCESCROOT}/lib ++ ifdef ICUROOT ++ PLATFORM_LIB_LINK_OPTIONS+=-L${ICUROOT} -Wl,-rpath,${ICUROOT} ++ EXTRA_LINK_OPTIONS=-licudata -lstdc++ ${EXTRA_LIBS} ++ else ++ EXTRA_LINK_OPTIONS=${EXTRA_LIBS} -lstdc++ ++ endif ++ SHLIBSUFFIX=.so ++endif ++ + #=============== NETBSD SPECIFIC OPTIONS ========================= + ifeq (${PLATFORM}, NETBSD) + CMP= -c ${CXXFLAGS} diff --git a/textproc/xerces-c/patches/patch-al b/textproc/xerces-c/patches/patch-al new file mode 100644 index 00000000000..e23d6962247 --- /dev/null +++ b/textproc/xerces-c/patches/patch-al @@ -0,0 +1,12 @@ +$NetBSD: patch-al,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- ../../samples/configure.orig 2005-12-30 23:58:23.000000000 +0000 ++++ ../../samples/configure +@@ -1363,6 +1363,7 @@ case "${host}" in + *-*-linux*) platform=LINUX ;; + *-*-nto*) platform=QNX ;; + *-*-freebsd*) platform=FREEBSD ;; ++ *-*-dragonfly*) platform=DRAGONFLY ;; + *-*-netbsd*) platform=NETBSD ;; + *-*-irix*) platform=IRIX ;; + *-*-aix*) platform=AIX ;; diff --git a/textproc/xerces-c/patches/patch-am b/textproc/xerces-c/patches/patch-am new file mode 100644 index 00000000000..28d1b39b5d9 --- /dev/null +++ b/textproc/xerces-c/patches/patch-am @@ -0,0 +1,23 @@ +$NetBSD: patch-am,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- ../../samples/runConfigure.orig 2005-12-30 23:58:45.000000000 +0000 ++++ ../../samples/runConfigure +@@ -196,7 +196,7 @@ echo "Extra link options: $linkeroptions + # Now check if the options are correct or not, bail out if incorrect + # + case $platform in +- aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin) ++ aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin | dragonfly) + # platform has been recognized + ;; + *) +@@ -264,6 +264,9 @@ else + elif test $platform = "freebsd"; then + threadingLibs="-pthread -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" ++ elif test $platform = "dragonfly"; then ++ threadingLibs="-pthread -lc_r" ++ threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + elif test $platform = "netbsd"; then + threadingLibs="-pthread" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" diff --git a/textproc/xerces-c/patches/patch-an b/textproc/xerces-c/patches/patch-an new file mode 100644 index 00000000000..4a6fcfbd749 --- /dev/null +++ b/textproc/xerces-c/patches/patch-an @@ -0,0 +1,28 @@ +$NetBSD: patch-an,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- configure.orig 2005-12-31 00:00:01.000000000 +0000 ++++ configure +@@ -1309,6 +1309,7 @@ case "${host}" in + *-*-nto*) platform=QNX ;; + *-*-linux*) platform=LINUX ;; + *-*-freebsd*) platform=FREEBSD ;; ++ *-*-dragonfly*) platform=DRAGONFLY ;; + *-*-netbsd*) platform=NETBSD ;; + *-*-irix*) platform=IRIX ;; + *-*-aix*) platform=AIX +@@ -1512,6 +1513,7 @@ util/Platforms/AIX/Makefile \ + util/Platforms/BeOS/Makefile \ + util/Platforms/QNX/Makefile \ + util/Platforms/Linux/Makefile \ ++util/Platforms/DragonFly/Makefile \ + util/Platforms/FreeBSD/Makefile \ + util/Platforms/NetBSD/Makefile \ + util/Platforms/HPUX/Makefile \ +@@ -1669,6 +1671,7 @@ util/Platforms/BeOS/Makefile \ + util/Platforms/QNX/Makefile \ + util/Platforms/Linux/Makefile \ + util/Platforms/FreeBSD/Makefile \ ++util/Platforms/DragonFly/Makefile \ + util/Platforms/NetBSD/Makefile \ + util/Platforms/HPUX/Makefile \ + util/Platforms/OS390/Makefile \ diff --git a/textproc/xerces-c/patches/patch-ao b/textproc/xerces-c/patches/patch-ao new file mode 100644 index 00000000000..da5ec432ad7 --- /dev/null +++ b/textproc/xerces-c/patches/patch-ao @@ -0,0 +1,23 @@ +$NetBSD: patch-ao,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- runConfigure.orig 2005-12-31 00:00:43.000000000 +0000 ++++ runConfigure +@@ -227,7 +227,7 @@ echo "Extra configure options: $configur + # + + case $platform in +- aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin | qnx) ++ aix | openserver | unixware | beos | linux | freebsd | netbsd | solaris | hp-10 | hp-11 | os400 | irix | ptx | tru64 | macosx | cygwin | qnx | dragonfly) + # platform has been recognized + ;; + *) +@@ -305,6 +305,9 @@ else + elif test $platform = "freebsd"; then + threadingLibs="-pthread -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" ++ elif test $platform = "dragonfly"; then ++ threadingLibs="-pthread -lc_r" ++ threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + elif test $platform = "netbsd"; then + threadingLibs="-pthread -lpthread" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" diff --git a/textproc/xerces-c/patches/patch-ap b/textproc/xerces-c/patches/patch-ap new file mode 100644 index 00000000000..f138af714c5 --- /dev/null +++ b/textproc/xerces-c/patches/patch-ap @@ -0,0 +1,14 @@ +$NetBSD: patch-ap,v 1.3 2005/12/31 00:56:42 joerg Exp $ + +--- util/AutoSense.hpp.orig 2005-12-31 00:01:35.000000000 +0000 ++++ util/AutoSense.hpp +@@ -222,6 +222,9 @@ + #elif defined(__FreeBSD__) + #define XML_FREEBSD + #define XML_UNIX ++#elif defined(__DragonFly__) ++ #define XML_DRAGONFLY ++ #define XML_UNIX + #elif defined(IRIX) || defined(__sgi) + #define XML_IRIX + #define XML_UNIX diff --git a/textproc/xerces-c/patches/patch-aq b/textproc/xerces-c/patches/patch-aq new file mode 100644 index 00000000000..71b7038ffb3 --- /dev/null +++ b/textproc/xerces-c/patches/patch-aq @@ -0,0 +1,14 @@ +$NetBSD: patch-aq,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- util/Platforms/Makefile.in.orig 2005-12-31 00:12:22.000000000 +0000 ++++ util/Platforms/Makefile.in +@@ -172,6 +172,9 @@ endif + ifeq (${PLATFORM}, FREEBSD) + SUBMODULE = FreeBSD + endif ++ifeq (${PLATFORM}, DRAGONFLY) ++ SUBMODULE = DragonFly ++endif + ifeq (${PLATFORM}, NETBSD) + SUBMODULE = NetBSD + endif diff --git a/textproc/xerces-c/patches/patch-ar b/textproc/xerces-c/patches/patch-ar new file mode 100644 index 00000000000..1d1ec1c6bbb --- /dev/null +++ b/textproc/xerces-c/patches/patch-ar @@ -0,0 +1,15 @@ +$NetBSD: patch-ar,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- util/XercesDefs.hpp.orig 2005-12-31 00:13:13.000000000 +0000 ++++ util/XercesDefs.hpp +@@ -280,6 +280,10 @@ + #include + #endif + ++#if defined(XML_DRAGONFLY) ++#include ++#endif ++ + #if defined(XML_OS390) + #include + #endif diff --git a/textproc/xerces-c/patches/patch-as b/textproc/xerces-c/patches/patch-as new file mode 100644 index 00000000000..19696bf4cdd --- /dev/null +++ b/textproc/xerces-c/patches/patch-as @@ -0,0 +1,74 @@ +$NetBSD: patch-as,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- /dev/null 2005-12-31 00:16:10.000000000 +0000 ++++ util/Platforms/DragonFly/DragonFlyDefs.hpp +@@ -0,0 +1,69 @@ ++/* ++ * 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 ++ * . ++ */ ++ ++/* ++ * ++ * ++ */ ++ ++ ++#define ENDIANMODE_LITTLE ++ ++typedef void* FileHandle; ++ ++#ifndef DRAGONFLY ++#define DRAGONFLY ++#endif diff --git a/textproc/xerces-c/patches/patch-at b/textproc/xerces-c/patches/patch-at new file mode 100644 index 00000000000..36077dc4109 --- /dev/null +++ b/textproc/xerces-c/patches/patch-at @@ -0,0 +1,667 @@ +$NetBSD: patch-at,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- /dev/null 2005-12-31 00:16:30.000000000 +0000 ++++ util/Platforms/DragonFly/DragonFlyPlatformUtils.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 ++ * . ++ */ ++ ++/* ++ * ++ * ++ */ ++ ++ ++// --------------------------------------------------------------------------- ++// Includes ++// --------------------------------------------------------------------------- ++ ++#if !defined(APP_NO_THREADS) ++#include ++#endif ++ ++/* #ifndef __USE_UNIX98 ++ #error __USE_UNIX98 is not defined in your compile settings ++#endif */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include /* for strcasecmp & strncasecmp */ ++#include /* for win_t */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(XML_USE_ICU_TRANSCODER) ++ #include ++#elif defined (XML_USE_GNU_TRANSCODER) ++ #include ++#else ++ // Use native transcoder. Same as -DXML_USE_NATIVE_TRANSCODER ++ #include ++#endif ++ ++ ++#if defined(XML_USE_ICU_MESSAGELOADER) ++ #include ++#elif defined(XML_USE_ICONV_MESSAGELOADER) ++ #include ++#else ++ // Same as -DXML_USE_INMEM_MESSAGELOADER ++ #include ++#endif ++ ++ ++#if defined (XML_USE_NETACCESSOR_SOCKET) ++ #include ++#endif ++ ++XERCES_CPP_NAMESPACE_BEGIN ++ ++// --------------------------------------------------------------------------- ++// 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 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 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 ++} ++ ++// --------------------------------------------------------------------------- ++// 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); ++#elif defined (XML_USE_ICONV_MESSAGELOADER) ++ retVal = new MsgCatalogLoader(msgDomain); ++#else ++ // same as -DXML_USE_INMEM_MESSAGELOADER ++ retVal = new InMemMsgLoader(msgDomain); ++#endif ++ } ++ ++ catch(...) ++ { ++ panic(PanicHandler::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; ++#elif defined (XML_USE_GNU_TRANSCODER) ++ return new IconvGNUTransService; ++#else ++ // Use native transcoding services. ++ // same as -DXML_USE_INMEM_MESSAGELOADER ++ return new IconvTransService; ++ ++#endif ++} ++ ++// --------------------------------------------------------------------------- ++// XMLPlatformUtils: The panic method ++// --------------------------------------------------------------------------- ++void XMLPlatformUtils::panic(const PanicHandler::PanicReasons reason) ++{ ++ fgUserPanicHandler? fgUserPanicHandler->panic(reason) : fgDefaultPanicHandler->panic(reason); ++} ++ ++ ++// --------------------------------------------------------------------------- ++// XMLPlatformUtils: File Methods ++// --------------------------------------------------------------------------- ++ ++unsigned int XMLPlatformUtils::curFilePos(FileHandle theFile) ++{ ++ if (theFile == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ int curPos = ftell( (FILE*)theFile); ++ if (curPos == -1) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotGetSize); ++ ++ return (unsigned int)curPos; ++} ++ ++void XMLPlatformUtils::closeFile(FileHandle theFile) ++{ ++ if (theFile == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ if (fclose((FILE*)theFile)) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotCloseFile); ++} ++ ++unsigned int XMLPlatformUtils::fileSize(FileHandle theFile) ++{ ++ if (theFile == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ // 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) ++{ ++ if (fileName == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ const char* tmpFileName = XMLString::transcode(fileName); ++ ArrayJanitor janText((char*)tmpFileName); ++ FileHandle retVal = (FILE*)fopen( tmpFileName , "r+" ); ++ ++ if (retVal == NULL) ++ return 0; ++ return retVal; ++} ++ ++FileHandle XMLPlatformUtils::openFile(const char* const fileName) ++{ ++ if (fileName == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ FileHandle retVal = (FILE*)fopen( fileName , "r+" ); ++ ++ if (retVal == NULL) ++ return 0; ++ return retVal; ++} ++ ++FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName) ++{ ++ if (fileName == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ const char* tmpFileName = XMLString::transcode(fileName); ++ ArrayJanitor janText((char*)tmpFileName); ++ ++ FileHandle retVal = (FILE*)fopen( tmpFileName, "r+" ); ++ if (retVal == NULL) ++ return 0; ++ return retVal; ++} ++ ++FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName) ++{ ++ if (fileName == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ FileHandle retVal = (FILE*)fopen( fileName, "r+" ); ++ ++ if (retVal == NULL) ++ return 0; ++ return retVal; ++} ++ ++FileHandle XMLPlatformUtils::openStdInHandle() ++{ ++ int nfd = dup(0); ++ if (nfd == -1) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotDupHandle); ++ return (FileHandle)fdopen(dup(0), "r"); ++} ++ ++ ++ ++unsigned int ++XMLPlatformUtils::readFileBuffer( FileHandle theFile ++ , const unsigned int toRead ++ , XMLByte* const toFill) ++{ ++ if ( !theFile || !toFill ) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ if (toRead == 0) ++ return 0; ++ 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::writeBufferToFile( FileHandle const theFile ++ , long toWrite ++ , const XMLByte* const toFlush ) ++{ ++ if ( !theFile || !toFlush ) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ if ( toWrite <= 0 ) ++ return; ++ ++ const XMLByte* tmpFlush = (const XMLByte*) toFlush; ++ size_t bytesWritten = 0; ++ ++ while (true) ++ { ++ bytesWritten = fwrite(tmpFlush, sizeof(XMLByte), toWrite, (FILE*)theFile); ++ ++ if(ferror((FILE*)theFile)) ++ { ++#if 0 ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotWriteToFile); ++#else ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotReadFromFile); ++#endif ++ } ++ ++ if (bytesWritten < (size_t) toWrite) //incomplete write ++ { ++ tmpFlush += bytesWritten; ++ toWrite -= bytesWritten; ++ bytesWritten = 0; ++ } ++ else ++ return; ++ } ++} ++ ++void XMLPlatformUtils::resetFile(FileHandle theFile) ++{ ++ if (theFile == NULL) ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::CPtr_PointerIsZero); ++ // 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() ++{ ++ struct timeval t; ++ struct timezone tz; ++ ++ gettimeofday(&t, &tz); ++ return (unsigned long)(t.tv_sec*1000 + t.tv_usec); ++} ++ ++XMLCh* XMLPlatformUtils::getFullPath(const XMLCh* const srcPath, MemoryManager* const) ++{ ++ ++ // ++ // 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 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 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; ++} ++ ++XMLCh* XMLPlatformUtils::getCurrentDirectory(MemoryManager* const) ++{ ++ char dirBuf[PATH_MAX + 1]; ++ char *curDir = getcwd(&dirBuf[0], PATH_MAX + 1); ++ ++ if (!curDir) ++ { ++ ThrowXML(XMLPlatformUtilsException, ++ XMLExcepts::File_CouldNotGetBasePathName); ++ } ++ ++ return XMLString::transcode(curDir); ++} ++ ++inline bool XMLPlatformUtils::isAnySlash(XMLCh c) ++{ ++ return ( chBackSlash == c || chForwardSlash == c); ++} ++ ++ ++// ----------------------------------------------------------------------- ++// 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. ++ ++ if (atomicOpsMutex.fHandle == 0) ++ 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 (pthread_mutex_t*)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() ++{ ++#if !defined(APP_NO_THREADS) ++ // delete the mutex we created ++ closeMutex(atomicOpsMutex.fHandle); ++ atomicOpsMutex.fHandle = 0; ++#endif ++} ++ ++#include ++ ++XERCES_CPP_NAMESPACE_END diff --git a/textproc/xerces-c/patches/patch-au b/textproc/xerces-c/patches/patch-au new file mode 100644 index 00000000000..170f644d614 --- /dev/null +++ b/textproc/xerces-c/patches/patch-au @@ -0,0 +1,89 @@ +$NetBSD: patch-au,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- /dev/null 2005-12-31 00:15:57.000000000 +0000 ++++ util/Platforms/DragonFly/Makefile.in +@@ -0,0 +1,84 @@ ++# ++# The Apache Software License, Version 1.1 ++# ++# Copyright (c) 2001 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) 2001, International ++# Business Machines, Inc., http://www.ibm.com . For more information ++# on the Apache Software Foundation, please see ++# . ++# ++# ++ ++PLATFORM = @platform@ ++CC = @cc@ ++CXX = @cxx@ ++GCC = @GCC@ ++GXX = @GXX@ ++CXXFLAGS = @cxxflags@ ++CFLAGS = @cflags@ ++PREFIX = @prefix@ ++PREFIX_INCLUDE = @prefix_include@ ++LDFLAGS = @ldflags@ ++LIBS = @libs@ ++OSVER = @osver@ ++USELIBWWW = @uselibwww@ ++MESSAGELOADER = @messageloader@ ++TRANSCODER = @transcoder@ ++THREADS = @threads@ ++ ++MODULE = util ++ ++include ../../../Makefile.incl ++ ++SUBMODULE = Platforms/DragonFly ++CXXFLAGS += -D_GNU_SOURCE -D__USE_GNU ++CPP_PUBHEADERS = DragonFlyDefs.hpp ++CPP_OBJECTS = DragonFlyPlatformUtils.$(TO) ++ ++include ../../Makefile.util.submodule diff --git a/textproc/xerces-c/patches/patch-av b/textproc/xerces-c/patches/patch-av new file mode 100644 index 00000000000..a739b1abdb4 --- /dev/null +++ b/textproc/xerces-c/patches/patch-av @@ -0,0 +1,13 @@ +$NetBSD: patch-av,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- util/RefVectorOf.c.orig 2005-12-31 00:35:24.000000000 +0000 ++++ util/RefVectorOf.c +@@ -136,7 +136,7 @@ template RefVectorOffCurCount; index++) + delete this->fElemList[index]; + } +- fMemoryManager->deallocate(this->fElemList);//delete [] this->fElemList; ++ this->fMemoryManager->deallocate(this->fElemList);//delete [] this->fElemList; + } + + diff --git a/textproc/xerces-c/patches/patch-aw b/textproc/xerces-c/patches/patch-aw new file mode 100644 index 00000000000..55901cf1a32 --- /dev/null +++ b/textproc/xerces-c/patches/patch-aw @@ -0,0 +1,21 @@ +$NetBSD: patch-aw,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- util/RefArrayVectorOf.c.orig 2005-12-31 00:36:54.000000000 +0000 ++++ util/RefArrayVectorOf.c +@@ -22,12 +22,12 @@ RefArrayVectorOf::RefArrayVectorO + + template RefArrayVectorOf::~RefArrayVectorOf() + { +- if (fAdoptedElems) ++ if (this->fAdoptedElems) + { +- for (unsigned int index = 0; index < fCurCount; index++) +- fMemoryManager->deallocate(fElemList[index]);//delete[] fElemList[index]; ++ for (unsigned int index = 0; index < this->fCurCount; index++) ++ this->fMemoryManager->deallocate(this->fElemList[index]);//delete[] fElemList[index]; + } +- fMemoryManager->deallocate(fElemList);//delete [] fElemList; ++ this->fMemoryManager->deallocate(this->fElemList);//delete [] fElemList; + } + + diff --git a/textproc/xerces-c/patches/patch-ax b/textproc/xerces-c/patches/patch-ax new file mode 100644 index 00000000000..a5cef1208a7 --- /dev/null +++ b/textproc/xerces-c/patches/patch-ax @@ -0,0 +1,171 @@ +$NetBSD: patch-ax,v 1.1 2005/12/31 00:56:42 joerg Exp $ + +--- util/RefArrayOf.c.orig 2005-12-31 00:39:18.000000000 +0000 ++++ util/RefArrayOf.c +@@ -105,9 +105,9 @@ RefArrayOf::RefArrayOf(const unsi + , fArray(0) + , fMemoryManager(manager) + { +- fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; +- for (unsigned int index = 0; index < fSize; index++) +- fArray[index] = 0; ++ this->fArray = (TElem**) this->fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; ++ for (unsigned int index = 0; index < this->fSize; index++) ++ this->fArray[index] = 0; + } + + template +@@ -119,9 +119,9 @@ RefArrayOf::RefArrayOf(TElem* val + , fArray(0) + , fMemoryManager(manager) + { +- fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; +- for (unsigned int index = 0; index < fSize; index++) +- fArray[index] = values[index]; ++ this->fArray = (TElem**) this->fMemoryManager->allocate(this->fSize * sizeof(TElem*));//new TElem*[fSize]; ++ for (unsigned int index = 0; index < this->fSize; index++) ++ this->fArray[index] = values[index]; + } + + template RefArrayOf:: +@@ -131,14 +131,14 @@ RefArrayOf(const RefArrayOf& sour + , fArray(0) + , fMemoryManager(source.fMemoryManager) + { +- fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; +- for (unsigned int index = 0; index < fSize; index++) +- fArray[index] = source.fArray[index]; ++ this->fArray = (TElem**) this->fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; ++ for (unsigned int index = 0; index < this->fSize; index++) ++ this->fArray[index] = source.fArray[index]; + } + + template RefArrayOf::~RefArrayOf() + { +- fMemoryManager->deallocate(fArray);//delete [] fArray; ++ this->fMemoryManager->deallocate(this->fArray);//delete [] fArray; + } + + +@@ -148,9 +148,9 @@ template RefArrayOf + template TElem*& RefArrayOf:: + operator[](const unsigned int index) + { +- if (index >= fSize) ++ if (index >= this->fSize) + ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex); +- return fArray[index]; ++ return this->fArray[index]; + } + + template const TElem* RefArrayOf:: +@@ -158,7 +158,7 @@ operator[](const unsigned int index) con + { + if (index >= fSize) + ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex); +- return fArray[index]; ++ return this->fArray[index]; + } + + template RefArrayOf& RefArrayOf:: +@@ -170,14 +170,14 @@ operator=(const RefArrayOf& toAss + // Reallocate if not the same size + if (toAssign.fSize != fSize) + { +- fMemoryManager->deallocate(fArray);//delete [] fArray; +- fSize = toAssign.fSize; +- fArray = (TElem**) fMemoryManager->allocate(fSize * sizeof(TElem*));//new TElem*[fSize]; ++ this->fMemoryManager->deallocate(this->fArray);//delete [] fArray; ++ this->fSize = toAssign.fSize; ++ this->fArray = (TElem**) this->fMemoryManager->allocate(this->fSize * sizeof(TElem*));//new TElem*[fSize]; + } + + // Copy over the source elements + for (unsigned int index = 0; index < fSize; index++) +- fArray[index] = toAssign.fArray[index]; ++ this->fArray[index] = toAssign.fArray[index]; + + return *this; + } +@@ -248,16 +248,16 @@ template void RefArrayOf= fSize) + ThrowXML(ArrayIndexOutOfBoundsException, XMLExcepts::Array_BadIndex); + +- delete fArray[index]; +- fArray[index] = 0; ++ delete this->fArray[index]; ++ this->fArray[index] = 0; + } + + template void RefArrayOf::deleteAllElements() + { +- for (unsigned int index = 0; index < fSize; index++) ++ for (unsigned int index = 0; index < this->fSize; index++) + { + delete fArray[index]; +- fArray[index] = 0; ++ this->fArray[index] = 0; + } + } + +@@ -270,7 +270,7 @@ template void RefArrayOfallocate ++ TElem** newArray = (TElem**) this->fMemoryManager->allocate + ( + newSize * sizeof(TElem*) + );//new TElem*[newSize]; +@@ -278,15 +278,15 @@ template void RefArrayOffArray[index]; + + for (; index < newSize; index++) + newArray[index] = 0; + + // Delete the old array and udpate our members +- fMemoryManager->deallocate(fArray);//delete [] fArray; +- fArray = newArray; +- fSize = newSize; ++ this->fMemoryManager->deallocate(fArray);//delete [] fArray; ++ this->fArray = newArray; ++ this->fSize = newSize; + } + + +@@ -307,7 +307,7 @@ RefArrayEnumerator( RefArrayOf RefArrayEnumerator::~RefArrayEnumerator() + { + if (fAdopted) +- delete fToEnum; ++ delete this->fToEnum; + } + + +@@ -316,19 +316,19 @@ template RefArrayEnumerato + // --------------------------------------------------------------------------- + template bool RefArrayEnumerator::hasMoreElements() const + { +- if (fCurIndex >= fToEnum->length()) ++ if (fCurIndex >= this->fToEnum->length()) + return false; + return true; + } + + template TElem& RefArrayEnumerator::nextElement() + { +- return *(*fToEnum)[fCurIndex++]; ++ return *(*this->fToEnum)[this->fCurIndex++]; + } + + template void RefArrayEnumerator::Reset() + { +- fCurIndex = 0; ++ this->fCurIndex = 0; + } + + XERCES_CPP_NAMESPACE_END -- cgit v1.2.3