--- src/xercesc/runConfigure.dist	2003-05-27 17:04:47.000000000 +0200
+++ src/xercesc/runConfigure	2003-06-02 16:17:22.000000000 +0200
@@ -189,6 +189,7 @@
         linkeroptions="$linkeroptions $2"; shift 2;;
 
    -P)
+        prefix=$2
         configureoptions="$configureoptions --prefix=$2"; shift 2;;
 
    -C)
@@ -303,8 +304,16 @@
                ;;
         esac
     elif test $platform = "freebsd"; then
-        threadingLibs="-pthread -lc_r"
-        threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS"
+         case $thread in
+             pth)
+                 threadingLibs="-L$prefix/lib -lpth -lc_r"
+                 threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS -DUSE_PTH -I$prefix/include"
+                 ;;
+             *)
+                 threadingLibs="-pthread -lc_r"
+                 threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS"
+                 ;;
+         esac
     elif test $platform = "netbsd"; then
         threadingLibs="-pthread -lpthread"
         threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS"
--- src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp.dist	2003-05-27 17:04:52.000000000 +0200
+++ src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp	2003-06-02 16:15:22.000000000 +0200
@@ -113,8 +113,12 @@
 // ---------------------------------------------------------------------------
 
 #if !defined(APP_NO_THREADS)
+#ifdef USE_PTH
+#include    <pth.h>
+#else
 #include    <pthread.h>
 #endif
+#endif
 
 #ifndef _GNU_SOURCE
     #error _GNU_SOURCE is not defined in your compile settings
@@ -506,6 +510,14 @@
 
 void* XMLPlatformUtils::makeMutex()
 {
+#ifdef USE_PTH
+    pth_mutex_t* mutex = new pth_mutex_t;
+    if (pth_mutex_init(mutex))
+    {
+        ThrowXML(XMLPlatformUtilsException,
+                 XMLExcepts::Mutex_CouldNotCreate);
+    }
+#else
     pthread_mutex_t* mutex = new pthread_mutex_t;
     pthread_mutexattr_t*  attr = new pthread_mutexattr_t;
     pthread_mutexattr_init(attr);
@@ -517,20 +529,24 @@
     }
     pthread_mutexattr_destroy(attr);
     delete attr;
+#endif
     return (void*)(mutex);
-
 }
 
 void XMLPlatformUtils::closeMutex(void* const mtxHandle)
 {
     if (mtxHandle != NULL)
     {
+#ifdef USE_PTH
+        delete (pth_mutex_t*)mtxHandle;
+#else
         if (pthread_mutex_destroy((pthread_mutex_t*) mtxHandle))
         {
             ThrowXML(XMLPlatformUtilsException,
                      XMLExcepts::Mutex_CouldNotDestroy);
         }
         delete (pthread_mutex_t*)mtxHandle;
+#endif
     }
 }
 
@@ -539,7 +555,11 @@
 {
     if (mtxHandle != NULL)
     {
+#ifdef USE_PTH
+        if (pth_mutex_acquire((pth_mutex_t*) mtxHandle, FALSE, NULL))
+#else
         if (pthread_mutex_lock((pthread_mutex_t*) mtxHandle))
+#endif
         {
             ThrowXML(XMLPlatformUtilsException,
                      XMLExcepts::Mutex_CouldNotLock);
@@ -552,7 +572,11 @@
 {
     if (mtxHandle != NULL)
     {
+#ifdef USE_PTH
+        if (pth_mutex_release((pth_mutex_t*) mtxHandle))
+#else
         if (pthread_mutex_unlock((pthread_mutex_t*) mtxHandle))
+#endif
         {
             ThrowXML(XMLPlatformUtilsException,
                      XMLExcepts::Mutex_CouldNotUnlock);
