diff -rubBP ptypes-1.7.4/Makefile ptypes-1.7.4-CM/Makefile
--- ptypes-1.7.4/Makefile	Mon Dec  9 00:59:42 2002
+++ ptypes-1.7.4-CM/Makefile	Fri Jun 27 16:32:25 2003
@@ -15,15 +15,14 @@
 # src/ptypes_test and the sample program bin/wshare.
 #
 
+TARGET=$(shell uname | sed -e 's/\///g')
+
 all:
-	cd src ; make -f Makefile.`uname` all
-	cd wshare ; make -f Makefile.`uname` all
+	cd src ; make -f Makefile.$(TARGET) all
 
 clean:
-	cd src ; make -f Makefile.`uname` clean
-	cd wshare ; make -f Makefile.`uname` clean
+	cd src ; make -f Makefile.$(TARGET) clean
 
 clean-src:
-	cd src ; make -f Makefile.`uname` clean-src
-	cd wshare ; make -f Makefile.`uname` clean-src
+	cd src ; make -f Makefile.$(TARGET) clean-src
 
Only in ptypes-1.7.4: bin
diff -rubBP ptypes-1.7.4/include/pasync.h ptypes-1.7.4-CM/include/pasync.h
--- ptypes-1.7.4/include/pasync.h	Mon Dec  9 00:59:42 2002
+++ ptypes-1.7.4-CM/include/pasync.h	Fri Jun 27 16:36:01 2003
@@ -16,6 +16,9 @@
 #ifdef WIN32
 #  define _WINSOCKAPI_   // prevent inclusion of winsock.h in windows.h
 #  include <windows.h>
+#elif defined(__bsdi__)
+#  include <pthread.h>
+#  include <sys/semaphore.h>
 #else
 #  include <pthread.h>
 #  include <semaphore.h>
@@ -208,7 +211,7 @@
 // -------------------------------------------------------------------- //
 
 
-#if defined(WIN32) || defined(__DARWIN__)
+#if defined(WIN32) || defined(__DARWIN__) || defined(__bsdi__)
 #  define __PTYPES_RWLOCK__
 #elif defined(linux)
    // on Linux rwlocks are included only with -D_GNU_SOURCE.
@@ -274,7 +277,7 @@
 // -------------------------------------------------------------------- //
 
 
-#if defined(WIN32) || defined(__DARWIN__)
+#if defined(WIN32) || defined(__DARWIN__)  || defined(__bsdi__)
 #  define __SEM_TO_TIMEDSEM__
 #endif
 
diff -rubBP ptypes-1.7.4/include/pinet.h ptypes-1.7.4-CM/include/pinet.h
--- ptypes-1.7.4/include/pinet.h	Mon Dec  9 00:59:42 2002
+++ ptypes-1.7.4-CM/include/pinet.h	Fri Jun 27 16:36:01 2003
@@ -119,7 +119,7 @@
 #endif
 
 
-#if defined(__DARWIN__) || defined(WIN32)
+#if defined(__DARWIN__) || defined(WIN32) || defined(__bsdi__)
   typedef int psocklen;
 #else
   typedef socklen_t psocklen;
diff -rubBP ptypes-1.7.4/src/Makefile.BSDOS ptypes-1.7.4-CM/src/Makefile.BSDOS
--- ptypes-1.7.4/src/Makefile.BSDOS	Wed Dec 31 16:00:00 1969
+++ ptypes-1.7.4-CM/src/Makefile.BSDOS	Fri Jun 27 16:36:33 2003
@@ -0,0 +1,27 @@
+#
+#
+#  C++ Portable Types Library (PTypes)
+#  Version 1.7.4   Released 9-Dec-2002
+#
+#  Copyright (c) 2001, 2002 Hovik Melikyan
+#
+#  http://www.melikyan.com/ptypes/
+#  http://ptypes.sourceforge.net/
+#
+#
+#
+# Makefile for BSD/OS (BSDI), called from ../Makefile
+#
+
+CXX = g++
+
+CXXOPTS = -pthread -D_GNU_SOURCE 
+
+SOEXT = so
+
+LIBTOOL = $(CXX) -shared -pthread
+
+SOSTRIP = strip
+
+include Makefile.common
+
diff -rubBP ptypes-1.7.4/src/pipbase.cxx ptypes-1.7.4-CM/src/pipbase.cxx
--- ptypes-1.7.4/src/pipbase.cxx	Mon Dec  9 00:59:42 2002
+++ ptypes-1.7.4-CM/src/pipbase.cxx	Fri Jun 27 16:36:01 2003
@@ -227,7 +227,11 @@
 ipaddress phostbyname(const char* name)
 {
     ipaddress ip;
+#if defined(__bsdi__)
+    hostent hp;
+#else
     hostent* hp;
+#endif
 
     if ((ip = ::inet_addr(name)) != ipnone)
     {
@@ -236,11 +240,21 @@
     }
     else
     {
+#if defined(__bsdi__)
+        char buf[80]={0};
+        int worthless;
+        if (::gethostbyname_r(name, &hp, buf, sizeof(buf)-1, &worthless) == nil)
+            return ipnone;
+        if (hp.h_addrtype != AF_INET)
+            return ipnone;
+        memcpy(ip.data, hp.h_addr, sizeof(ip.data));
+#else
         if ((hp = ::gethostbyname(name)) == nil)
             return ipnone;
         if (hp->h_addrtype != AF_INET)
             return ipnone;
-        memcpy(ip.data, hp->h_addr, sizeof(ip.data)) ;
+        memcpy(ip.data, hp->h_addr, sizeof(ip.data));
+#endif
     }
 
     return ip;
@@ -249,10 +263,20 @@
 
 string phostbyaddr(ipaddress ip)
 {
-    hostent* hp;
     string r;
+
+#if defined(__bsdi__)
+    hostent hp;
+    char buf[80] = {0};
+    int worthless;
+
+    if (::gethostbyaddr_r(pconst(ip.data), sizeof(ip.data), AF_INET, &hp, buf, sizeof(buf)-1, &worthless) != nil)
+        r = hp.h_name;
+#else
+    hostent* hp;
     if ((hp = ::gethostbyaddr(pconst(ip.data), sizeof(ip.data), AF_INET)) != nil)
         r = hp->h_name;
+#endif
     return r;
 }
 
diff -rubBP ptypes-1.7.4/src/ptime.cxx ptypes-1.7.4-CM/src/ptime.cxx
--- ptypes-1.7.4/src/ptime.cxx	Mon Dec  9 00:59:42 2002
+++ ptypes-1.7.4-CM/src/ptime.cxx	Fri Jun 27 16:36:01 2003
@@ -267,8 +267,8 @@
 {
 #if defined(WIN32)
     TIME_ZONE_INFORMATION tz;
-    GetTimeZoneInformation(&tz);
-    if (tz.DaylightDate.wMonth != 0)
+    DWORD res = GetTimeZoneInformation(&tz);
+    if ((res == TIME_ZONE_ID_DAYLIGHT) && (tz.DaylightDate.wMonth != 0))
         return - (tz.Bias +  tz.DaylightBias);
     else
         return - tz.Bias;
@@ -276,12 +276,19 @@
 #elif defined(__sun__)
     if (timezone == 0)
         tzset();
-    if (daylight != 0)
+//    if (daylight != 0)
+//        return - altzone / 60;
+//    else
+//        return - timezone / 60;
+    time_t t0 = time(NULL);
+    tm loctm;
+    localtime_r(&t0, &loctm);
+    if(loctm.tm_isdst!=0 && daylight!=0)
         return - altzone / 60;
     else
         return - timezone / 60;
 
-#elif defined(__DARWIN__)
+#elif defined(__DARWIN__) || defined(__bsdi__)
     time_t u;
     time(&u);
     tm* t = localtime(&u);
