Sun Dec 4 21:59:37 2011 UTC ()
devel/ptlib: Add support for DragonFly

These 19 patches required for building ptlib on DragonFly will be sent
support@equival.com.au for upstream incorporation.


(marino)
diff -r1.13 -r1.14 pkgsrc/devel/ptlib/Makefile
diff -r1.8 -r1.9 pkgsrc/devel/ptlib/PLIST
diff -r1.10 -r1.11 pkgsrc/devel/ptlib/distinfo
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-Nucleus-NucleusPTime.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-Nucleus-pmachdep.h
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-include_ptbuildopts.h.in
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-make_unix.mak
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-plugins_sound_esd_sound_esd.h
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.h
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-plugins_vidinput_bsd_vidinput_bsd.h
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-config.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-ossaix.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-osutil.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-pipechan.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-pmachdep.h
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-serchan.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-socket.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-switch.cxx
diff -r0 -r1.1 pkgsrc/devel/ptlib/patches/patch-unix-tlib.cxx
diff -r0 -r1.3 pkgsrc/devel/ptlib/patches/patch-configure

cvs diff -r1.13 -r1.14 pkgsrc/devel/ptlib/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/ptlib/Attic/Makefile 2010/06/27 11:14:50 1.13
+++ pkgsrc/devel/ptlib/Attic/Makefile 2011/12/04 21:59:36 1.14
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.13 2010/06/27 11:14:50 obache Exp $ 1# $NetBSD: Makefile,v 1.14 2011/12/04 21:59:36 marino Exp $
2 2
3DISTNAME= ptlib-2.6.5 3DISTNAME= ptlib-2.6.5
4PKGREVISION= 2 4PKGREVISION= 3
5CATEGORIES= devel 5CATEGORIES= devel
6MASTER_SITES= ${MASTER_SITE_GNOME:=sources/ptlib/2.6/} 6MASTER_SITES= ${MASTER_SITE_GNOME:=sources/ptlib/2.6/}
7EXTRACT_SUFX= .tar.bz2 7EXTRACT_SUFX= .tar.bz2
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://www.ekiga.net/ 10HOMEPAGE= http://www.ekiga.net/
11COMMENT= Portable Windows Libary 11COMMENT= Portable Windows Libary
12# modified-bsd stands for Spencer's regex license, quite similar 12# modified-bsd stands for Spencer's regex license, quite similar
13LICENSE= mpl-1.0 AND modified-bsd 13LICENSE= mpl-1.0 AND modified-bsd
14 14
15PKG_DESTDIR_SUPPORT= user-destdir 15PKG_DESTDIR_SUPPORT= user-destdir
16 16
17CONFLICTS+= pwlib-[0-9]* 17CONFLICTS+= pwlib-[0-9]*
@@ -19,37 +19,45 @@ CONFLICTS+= pwlib-[0-9]* @@ -19,37 +19,45 @@ CONFLICTS+= pwlib-[0-9]*
19USE_TOOLS+= bison flex gmake pkg-config 19USE_TOOLS+= bison flex gmake pkg-config
20BUILD_TARGET= optshared 20BUILD_TARGET= optshared
21USE_LANGUAGES= c c++ 21USE_LANGUAGES= c c++
22USE_LIBTOOL= yes 22USE_LIBTOOL= yes
23GNU_CONFIGURE= yes 23GNU_CONFIGURE= yes
24CONFIGURE_ARGS+= --enable-httpforms 24CONFIGURE_ARGS+= --enable-httpforms
25CONFIGURE_ARGS+= --enable-httpsvc 25CONFIGURE_ARGS+= --enable-httpsvc
26CONFIGURE_ARGS+= --enable-plugins 26CONFIGURE_ARGS+= --enable-plugins
27CONFIGURE_ARGS+= --enable-jabber 27CONFIGURE_ARGS+= --enable-jabber
28CONFIGURE_ARGS+= --enable-vxml 28CONFIGURE_ARGS+= --enable-vxml
29CONFIGURE_ARGS+= --enable-xmlrpc 29CONFIGURE_ARGS+= --enable-xmlrpc
30CONFIGURE_ARGS+= --enable-soap 30CONFIGURE_ARGS+= --enable-soap
31CONFIGURE_ARGS+= --enable-oss 31CONFIGURE_ARGS+= --enable-oss
32CONFIGURE_ARGS+= --enable-v4l2 
33CONFIGURE_ARGS+= --enable-opal 32CONFIGURE_ARGS+= --enable-opal
34CONFIGURE_ARGS+= --enable-openldap 33CONFIGURE_ARGS+= --enable-openldap
35#CONFIGURE_ARGS+= --enable-openssl 34#CONFIGURE_ARGS+= --enable-openssl
36CONFIGURE_ARGS+= --enable-expat 35CONFIGURE_ARGS+= --enable-expat
37#CONFIGURE_ARGS+= --enable-samples 36#CONFIGURE_ARGS+= --enable-samples
38CONFIGURE_ARGS+= --disable-bsdvideo 37CONFIGURE_ARGS+= --disable-bsdvideo
39CONFIGURE_ARGS+= --disable-sunaudio 38CONFIGURE_ARGS+= --disable-sunaudio
40CONFIGURE_ARGS+= --disable-alsa 39CONFIGURE_ARGS+= --disable-alsa
41CONFIGURE_ARGS+= --disable-avc 40CONFIGURE_ARGS+= --disable-avc
42CONFIGURE_ARGS+= --disable-dc 41CONFIGURE_ARGS+= --disable-dc
43PTHREAD_OPTS+= require 42PTHREAD_OPTS+= require
44 43
 44.include "../../mk/bsd.prefs.mk"
 45
 46PLIST_VARS+= video4l2
 47
 48.if ${OPSYS} != "DragonFly"
 49CONFIGURE_ARGS+= --enable-v4l2
 50PLIST.video4l2= yes
 51.endif
 52
45post-install: 53post-install:
46 ${INSTALL_DATA} ${WRKSRC}/version.h ${DESTDIR}${PREFIX}/share/ptlib 54 ${INSTALL_DATA} ${WRKSRC}/version.h ${DESTDIR}${PREFIX}/share/ptlib
47 55
48.include "../../databases/openldap-client/buildlink3.mk" 56.include "../../databases/openldap-client/buildlink3.mk"
49.include "../../devel/SDL/buildlink3.mk" 57.include "../../devel/SDL/buildlink3.mk"
50.include "../../graphics/libv4l/buildlink3.mk" 58.include "../../graphics/libv4l/buildlink3.mk"
51.include "../../security/openssl/buildlink3.mk" 59.include "../../security/openssl/buildlink3.mk"
52.include "../../textproc/expat/buildlink3.mk" 60.include "../../textproc/expat/buildlink3.mk"
53.include "../../mk/oss.buildlink3.mk" 61.include "../../mk/oss.buildlink3.mk"
54.include "../../mk/pthread.buildlink3.mk" 62.include "../../mk/pthread.buildlink3.mk"
55.include "../../mk/bsd.pkg.mk" 63.include "../../mk/bsd.pkg.mk"

cvs diff -r1.8 -r1.9 pkgsrc/devel/ptlib/Attic/PLIST (expand / switch to unified diff)

--- pkgsrc/devel/ptlib/Attic/PLIST 2009/07/23 22:11:47 1.8
+++ pkgsrc/devel/ptlib/Attic/PLIST 2011/12/04 21:59:36 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1@comment $NetBSD: PLIST,v 1.8 2009/07/23 22:11:47 wiz Exp $ 1@comment $NetBSD: PLIST,v 1.9 2011/12/04 21:59:36 marino Exp $
2bin/ptlib-config 2bin/ptlib-config
3include/ptbuildopts.h 3include/ptbuildopts.h
4include/ptclib/asnber.h 4include/ptclib/asnber.h
5include/ptclib/asner.h 5include/ptclib/asner.h
6include/ptclib/asnper.h 6include/ptclib/asnper.h
7include/ptclib/asnxer.h 7include/ptclib/asnxer.h
8include/ptclib/cypher.h 8include/ptclib/cypher.h
9include/ptclib/delaychan.h 9include/ptclib/delaychan.h
10include/ptclib/dtmf.h 10include/ptclib/dtmf.h
11include/ptclib/enum.h 11include/ptclib/enum.h
12include/ptclib/ftp.h 12include/ptclib/ftp.h
13include/ptclib/guid.h 13include/ptclib/guid.h
14include/ptclib/html.h 14include/ptclib/html.h
@@ -152,22 +152,22 @@ include/ptlib/unix/ptlib/thread.h @@ -152,22 +152,22 @@ include/ptlib/unix/ptlib/thread.h
152include/ptlib/unix/ptlib/timeint.h 152include/ptlib/unix/ptlib/timeint.h
153include/ptlib/unix/ptlib/timer.h 153include/ptlib/unix/ptlib/timer.h
154include/ptlib/unix/ptlib/udpsock.h 154include/ptlib/unix/ptlib/udpsock.h
155include/ptlib/unix/ptlib/video.h 155include/ptlib/unix/ptlib/video.h
156include/ptlib/vconvert.h 156include/ptlib/vconvert.h
157include/ptlib/video.h 157include/ptlib/video.h
158include/ptlib/videoio.h 158include/ptlib/videoio.h
159include/ptlib/videoio1394dc.h 159include/ptlib/videoio1394dc.h
160lib/libpt.so 160lib/libpt.so
161lib/libpt.so.${PKGVERSION} 161lib/libpt.so.${PKGVERSION}
162lib/libpt_s.a 162lib/libpt_s.a
163lib/pkgconfig/ptlib.pc 163lib/pkgconfig/ptlib.pc
164lib/${PKGNAME}/devices/sound/oss_pwplugin.so 164lib/${PKGNAME}/devices/sound/oss_pwplugin.so
165lib/${PKGNAME}/devices/videoinput/v4l2_pwplugin.so 165${PLIST.video4l2}lib/${PKGNAME}/devices/videoinput/v4l2_pwplugin.so
166share/ptlib/make/common.mak 166share/ptlib/make/common.mak
167share/ptlib/make/lib.mak 167share/ptlib/make/lib.mak
168share/ptlib/make/plugins.mak 168share/ptlib/make/plugins.mak
169share/ptlib/make/ptbuildopts.mak 169share/ptlib/make/ptbuildopts.mak
170share/ptlib/make/ptlib-config 170share/ptlib/make/ptlib-config
171share/ptlib/make/ptlib.mak 171share/ptlib/make/ptlib.mak
172share/ptlib/make/unix.mak 172share/ptlib/make/unix.mak
173share/ptlib/version.h 173share/ptlib/version.h

cvs diff -r1.10 -r1.11 pkgsrc/devel/ptlib/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/ptlib/Attic/distinfo 2009/11/10 11:15:12 1.10
+++ pkgsrc/devel/ptlib/Attic/distinfo 2011/12/04 21:59:36 1.11
@@ -1,5 +1,24 @@ @@ -1,5 +1,24 @@
1$NetBSD: distinfo,v 1.10 2009/11/10 11:15:12 wiz Exp $ 1$NetBSD: distinfo,v 1.11 2011/12/04 21:59:36 marino Exp $
2 2
3SHA1 (ptlib-2.6.5.tar.bz2) = 919487aee09d5a1ea5c4f0abdc01bc49d9dcb596 3SHA1 (ptlib-2.6.5.tar.bz2) = 919487aee09d5a1ea5c4f0abdc01bc49d9dcb596
4RMD160 (ptlib-2.6.5.tar.bz2) = ab2f8897b64ab7b1eb9fecc35470ce09af42bcf2 4RMD160 (ptlib-2.6.5.tar.bz2) = ab2f8897b64ab7b1eb9fecc35470ce09af42bcf2
5Size (ptlib-2.6.5.tar.bz2) = 3302864 bytes 5Size (ptlib-2.6.5.tar.bz2) = 3302864 bytes
 6SHA1 (patch-Nucleus-NucleusPTime.cxx) = 3d8288a12f077867768d5ab0fc2a4e01c1cdb5fc
 7SHA1 (patch-Nucleus-pmachdep.h) = e78bd26dbe72538aeeb88bdb75faa35768e328d9
 8SHA1 (patch-configure) = 3af145c86d6a7060cb197228ae8046edbde437d4
 9SHA1 (patch-configure.ac) = 0813261dd595f2980bf691ad6fc69b27a527f803
 10SHA1 (patch-include_ptbuildopts.h.in) = 93559a280ec01e3eaa8396cd83bce7cf4ac275c5
 11SHA1 (patch-make_unix.mak) = 03a436317afc6f77e574bf712b1926327bf00f6e
 12SHA1 (patch-plugins_sound_esd_sound_esd.h) = 6caff0b4890fe3b137e5dd7ceb1013abe1f7fec8
 13SHA1 (patch-plugins_sound_oss_sound_oss.cxx) = d00476fb46a0bf2474e8963a8fe9f1765d393d04
 14SHA1 (patch-plugins_sound_oss_sound_oss.h) = 7661d3d2f270680f293ddd4bb58cac8f6f021862
 15SHA1 (patch-plugins_vidinput_bsd_vidinput_bsd.h) = 33ee2ced0dd8a1e0e567f8700bba92431193dc10
 16SHA1 (patch-unix-config.cxx) = bf263b858d4b964786360c702bd634aa989a8751
 17SHA1 (patch-unix-ossaix.cxx) = 5e473ffb524811c4da35fe8cb2f5f77b4807de5c
 18SHA1 (patch-unix-osutil.cxx) = 33482828d543fda07fd4070f05295e5536a89e64
 19SHA1 (patch-unix-pipechan.cxx) = 03117bf11b31c14255f30afe397d8e4b06d93760
 20SHA1 (patch-unix-pmachdep.h) = 4ff7e803fca00f1e86f34234289efbb0910e26c3
 21SHA1 (patch-unix-serchan.cxx) = 20131e476b495b7e0babaeb1755c4bfc130909d6
 22SHA1 (patch-unix-socket.cxx) = 15364058387caad5da2827cc823da6d578525835
 23SHA1 (patch-unix-switch.cxx) = b68d3dad99a7ff90113b9f4b6b19331c472bcca2
 24SHA1 (patch-unix-tlib.cxx) = 6f4c6e8750316698484cea5dae4cd91d5717881d

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-Nucleus-NucleusPTime.cxx
$NetBSD: patch-Nucleus-NucleusPTime.cxx,v 1.1 2011/12/04 21:59:36 marino Exp $

--- src/ptlib/Nucleus++/NucleusPTime.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/Nucleus++/NucleusPTime.cxx
@@ -302,7 +302,7 @@ int PTime::GetTimeZone(PTime::TimeZoneTy
     return tz;
   else
     return tz + ::daylight*60;
-#elif defined(P_FREEBSD)
+#elif defined(P_FREEBSD) || defined(P_DRAGONFLY)
   time_t t;
   time(&t);
   struct tm  * tm = localtime(&t);

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-Nucleus-pmachdep.h
$NetBSD: patch-Nucleus-pmachdep.h,v 1.1 2011/12/04 21:59:36 marino Exp $

--- include/ptlib/Nucleus++/ptlib/pmachdep.h.orig	2009-09-21 00:25:51.000000000 +0000
+++ include/ptlib/Nucleus++/ptlib/pmachdep.h
@@ -62,6 +62,34 @@ typedef size_t socklen_t;
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
+#elif defined(P_DRAGONFLY)
+
+#if defined(P_PTHREADS)
+#define _THREAD_SAFE
+#define P_THREAD_SAFE_CLIB
+
+#include <pthread.h>
+extern "C" int sigwait(sigset_t *set);
+#endif
+
+#include <paths.h>
+#include <errno.h>
+#include <dlfcn.h>
+#include <termios.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/signal.h>
+#include <net/if.h>
+
+#define HAS_IFREQ
+
+#define PSETPGRP()  setpgrp(0, 0)
+
+typedef int socklen_t;
+
+///////////////////////////////////////////////////////////////////////////////
 #elif defined(P_FREEBSD)
 
 #if defined(P_PTHREADS)

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2011/12/04 21:59:37 marino Exp $

--- configure.ac.orig	2009-09-21 00:25:59.000000000 +0000
+++ configure.ac
@@ -232,6 +232,16 @@ case "$target_os" in
 		   AC_CHECK_FUNC([swab], [AC_DEFINE([USE_SYSTEM_SWAB], [], [Use system swab()] )] )
                    ;;
 
+  dragonfly*)      OSTYPE=DragonFly ;
+                   OS_TAG="P_DRAGONFLY" ;
+                   if test "x$OSRELEASE" = "x"; then
+                     OSRELEASE="`sysctl -n kern.osreldate`" ;
+                   fi
+                   need_pragma=yes ;
+		   AC_DEFINE(P_PTHREADS, 1, "PThreads found")
+		   AC_CHECK_FUNC([swab], [AC_DEFINE([USE_SYSTEM_SWAB], [], [Use system swab()] )] )
+		   ;;
+
   freebsd*|kfreebsd*)       OSTYPE=FreeBSD ;
 		   OS_TAG="P_FREEBSD" ;
                    if test "x$OSRELEASE" = "x"; then

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-include_ptbuildopts.h.in
$NetBSD: patch-include_ptbuildopts.h.in,v 1.1 2011/12/04 21:59:37 marino Exp $

--- include/ptbuildopts.h.in.orig	2009-09-21 00:25:53.000000000 +0000
+++ include/ptbuildopts.h.in
@@ -43,6 +43,7 @@
 //
 
 #undef    P_LINUX
+#undef    P_DRAGONFLY
 #undef    P_FREEBSD
 #undef    P_OPENBSD
 #undef    P_NETBSD

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-make_unix.mak
$NetBSD: patch-make_unix.mak,v 1.1 2011/12/04 21:59:37 marino Exp $

--- make/unix.mak.orig	2009-09-21 00:25:30.000000000 +0000
+++ make/unix.mak
@@ -57,7 +57,7 @@ release tagbuild
 .PHONY: all $(STANDARD_TARGETS)
 
 
-ifeq (,$(findstring $(OSTYPE),linux FreeBSD OpenBSD NetBSD solaris beos Darwin Carbon AIX Nucleus VxWorks rtems QNX cygwin mingw))
+ifeq (,$(findstring $(OSTYPE),linux DragonFly FreeBSD OpenBSD NetBSD solaris beos Darwin Carbon AIX Nucleus VxWorks rtems QNX cygwin mingw))
 
 default_target :
 	@echo
@@ -166,6 +166,31 @@ endif # linux
 
 ####################################################
 
+ifeq ($(OSTYPE),DragonFly)
+
+ifeq ($(MACHTYPE),x86)
+ifdef CPUTYPE
+STDCCFLAGS	+= -mcpu=$(CPUTYPE)
+endif
+endif
+
+ifeq ($(MACHTYPE),x86_64)
+STDCCFLAGS	+= -DP_64BIT
+endif
+
+P_USE_RANLIB	:= 1
+#STDCCFLAGS     += -DP_USE_PRAGMA		# migrated to configure
+
+ifeq ($(P_SHAREDLIB),1)
+ifndef PROG
+STDCCFLAGS	+= -fPIC -DPIC
+endif # PROG
+endif # P_SHAREDLIB
+
+endif # DragonFly
+
+####################################################
+
 ifeq ($(OSTYPE),FreeBSD)
 
 ifeq ($(MACHTYPE),x86)

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-plugins_sound_esd_sound_esd.h
$NetBSD: patch-plugins_sound_esd_sound_esd.h,v 1.1 2011/12/04 21:59:37 marino Exp $

--- plugins/sound_esd/sound_esd.h.orig	2009-09-21 00:25:31.000000000 +0000
+++ plugins/sound_esd/sound_esd.h
@@ -11,6 +11,10 @@
 #include <sys/soundcard.h>
 #endif
 
+#ifdef P_DRAGONFLY
+#include <sys/soundcard.h>
+#endif
+
 #ifdef P_FREEBSD
 #if P_FREEBSD >= 500000
 #include <sys/soundcard.h>

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-plugins_sound_oss_sound_oss.cxx
$NetBSD: patch-plugins_sound_oss_sound_oss.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- plugins/sound_oss/sound_oss.cxx.orig	2009-09-21 00:25:31.000000000 +0000
+++ plugins/sound_oss/sound_oss.cxx
@@ -182,6 +182,11 @@ static void CollectSoundDevices(PDirecto
               devname = devdir + "dsp0";
               PTRACE(1, "OSS\tCollectSoundDevices FreeBSD devname set to devfs(5) name:" << devname );
 #endif /* defined (P_FREEBSD) */
+#if defined (P_DRAGONFLY)
+              // Same as FreeBSD
+              devname = devdir + "dsp0";
+              PTRACE(1, "OSS\tCollectSoundDevices DragonFly devname set to devfs(5) name:" << devname );
+#endif /* defined (P_DRAGONFLY) */
               dsp.SetAt(cardnum+1, devname);
             }
           }

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-plugins_sound_oss_sound_oss.h
$NetBSD: patch-plugins_sound_oss_sound_oss.h,v 1.1 2011/12/04 21:59:37 marino Exp $

--- plugins/sound_oss/sound_oss.h.orig	2009-09-21 00:25:31.000000000 +0000
+++ plugins/sound_oss/sound_oss.h
@@ -15,6 +15,10 @@
 #include <sys/soundcard.h>
 #endif
 
+#ifdef P_DRAGONFLY
+#include <sys/soundcard.h>
+#endif
+
 #ifdef P_FREEBSD
 #if P_FREEBSD >= 500000
 #include <sys/soundcard.h>

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-plugins_vidinput_bsd_vidinput_bsd.h
$NetBSD: patch-plugins_vidinput_bsd_vidinput_bsd.h,v 1.1 2011/12/04 21:59:37 marino Exp $

--- plugins/vidinput_bsd/vidinput_bsd.h.orig	2009-09-21 00:25:31.000000000 +0000
+++ plugins/vidinput_bsd/vidinput_bsd.h
@@ -13,6 +13,11 @@
 #include <ptlib/vconvert.h>
 #include <ptclib/delaychan.h>
 
+#if defined(P_DRAGONFLY)
+#include <sys/param.h>
+#include <machine/ioctl_meteor.h>
+#endif
+
 #if defined(P_FREEBSD)
 #include <sys/param.h>
 # if __FreeBSD_version >= 502100

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-config.cxx
$NetBSD: patch-unix-config.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/config.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/config.cxx
@@ -49,7 +49,7 @@
 #define	EXTENSION		".ini"
 #define	ENVIRONMENT_CONFIG_STR	"/\~~environment~~\/"
 
-#if defined(P_MACOSX) || defined(P_SOLARIS) || defined(P_FREEBSD)
+#if defined(P_MACOSX) || defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_DRAGONFLY)
 #define environ (NULL)
 #endif
 

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-ossaix.cxx
$NetBSD: patch-unix-ossaix.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/ossaix.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/ossaix.cxx
@@ -40,6 +40,10 @@
 #include <sys/time.h>
 #endif
 
+#if defined(P_DRAGONFLY)
+#include <machine/soundcard.h>
+#endif
+
 #ifdef P_FREEBSD
 #include <machine/soundcard.h>
 #endif

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-osutil.cxx
$NetBSD: patch-unix-osutil.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/osutil.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/osutil.cxx
@@ -79,7 +79,7 @@
 #define P_USE_LANGINFO
 #endif
 
-#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS)
+#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_DRAGONFLY)
 #define P_USE_STRFTIME
 
 #include <sys/param.h>
@@ -534,7 +534,7 @@ PString PDirectory::GetVolume() const
     }
     fclose(fp);
 
-#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS)
+#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_DRAGONFLY)
 
     struct statfs * mnt;
     int count = getmntinfo(&mnt, MNT_NOWAIT);
@@ -574,7 +574,7 @@ PString PDirectory::GetVolume() const
 
 PBoolean PDirectory::GetVolumeSpace(PInt64 & total, PInt64 & free, DWORD & clusterSize) const
 {
-#if defined(P_LINUX) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS)
+#if defined(P_LINUX) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_DRAGONFLY)
 
   struct statfs fs;
 
@@ -1429,7 +1429,7 @@ int PTime::GetTimeZone(PTime::TimeZoneTy
     return tz;
   else
     return tz + ::daylight*60;
-#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(__BEOS__) || defined(P_QNX)
+#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(__BEOS__) || defined(P_QNX) || defined(P_DRAGONFLY)
   time_t t;
   time(&t);
   struct tm ts;

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-pipechan.cxx
$NetBSD: patch-unix-pipechan.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/pipechan.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/pipechan.cxx
@@ -199,7 +199,7 @@ PBoolean PPipeChannel::PlatformOpen(cons
 
   // Set up new environment if one specified.
   if (environment != NULL) {
-#if defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(__BEOS__) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_IRIX) || defined(P_QNX)
+#if defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(__BEOS__) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_IRIX) || defined(P_QNX) || defined(P_DRAGONFLY)
     extern char ** environ;
 #  if defined(P_MACOSX)
 #    define environ (*_NSGetEnviron())

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-pmachdep.h
$NetBSD: patch-unix-pmachdep.h,v 1.1 2011/12/04 21:59:37 marino Exp $

--- include/ptlib/unix/ptlib/pmachdep.h.orig	2009-09-21 00:25:51.000000000 +0000
+++ include/ptlib/unix/ptlib/pmachdep.h
@@ -62,6 +62,34 @@ typedef size_t socklen_t;
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
+#elif defined(P_DRAGONFLY)
+
+#if defined(P_PTHREADS)
+#ifndef _THREAD_SAFE
+#define _THREAD_SAFE
+#endif
+#define P_THREAD_SAFE_CLIB
+
+#include <pthread.h>
+#endif
+
+#include <paths.h>
+#include <errno.h>
+#include <dlfcn.h>
+#include <termios.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+#include <sys/signal.h>
+#include <net/if.h>
+#include <netinet/tcp.h>
+
+#define HAS_IFREQ
+
+#define PSETPGRP()  setpgrp(0, 0)
+
+///////////////////////////////////////////////////////////////////////////////
 #elif defined(P_FREEBSD)
 
 #if defined(P_PTHREADS)

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-serchan.cxx
$NetBSD: patch-unix-serchan.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/serchan.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/serchan.cxx
@@ -43,7 +43,7 @@
 #define  TCSETATTR(f,t)  tcsetattr(f,TCSANOW,t)
 #define  TCGETATTR(f,t)  tcgetattr(f,t)
 
-#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_RTEMS)
+#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined (P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_RTEMS) || defined(P_DRAGONFLY)
 #include <sys/ttycom.h>
 #define TCGETA TIOCGETA
 #define TCSETAW TIOCSETAW

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-socket.cxx
$NetBSD: patch-unix-socket.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/socket.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/socket.cxx
@@ -55,7 +55,7 @@
 #define  ifr_macaddr         ifr_hwaddr.sa_data
 #endif
 
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_SOLARIS) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_IRIX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_SOLARIS) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_IRIX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX) || defined(P_DRAGONFLY)
 #define ifr_netmask ifr_addr
 
 #include <net/if_dl.h>
@@ -76,7 +76,7 @@
 
 #endif
 
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined(P_QNX) || defined(P_DRAGONFLY)
 #include <sys/sysctl.h>
 #endif
 
@@ -90,7 +90,7 @@
 #include <be/bone/sys/sockio.h> // for SIOCGI*
 #endif
 
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX) || defined(P_DRAGONFLY)
 // Define _SIZEOF_IFREQ for platforms (eg OpenBSD) which do not have it.
 #ifndef _SIZEOF_ADDR_IFREQ
 #define _SIZEOF_ADDR_IFREQ(ifr) \
@@ -515,7 +515,7 @@ PBoolean PIPSocket::IsLocalHost(const PS
         }
       }
       
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX) || defined(P_DRAGONFLY)
       // move the ifName pointer along to the next ifreq entry
       ifName = (struct ifreq *)((char *)ifName + _SIZEOF_ADDR_IFREQ(*ifName));
 #elif !defined(P_NETBSD)
@@ -1069,7 +1069,7 @@ PBoolean PIPSocket::GetRouteTable(RouteT
   return nTime > 0;
 }
 
-#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_QNX) 
+#elif defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_QNX) || defined(P_DRAGONFLY)
 
 PBoolean process_rtentry(struct rt_msghdr *rtm, char *ptr, unsigned long *p_net_addr,
                      unsigned long *p_net_mask, unsigned long *p_dest_addr, int *p_metric);
@@ -1693,7 +1693,7 @@ PBoolean PIPSocket::GetInterfaceTable(In
         }
       }
 
-#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX)
+#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_MACOSX) || defined(P_VXWORKS) || defined(P_RTEMS) || defined(P_QNX) || defined(P_DRAGONFLY)
       // move the ifName pointer along to the next ifreq entry
       ifName = (struct ifreq *)((char *)ifName + _SIZEOF_ADDR_IFREQ(*ifName));
 #elif !defined(P_NETBSD)

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-switch.cxx
$NetBSD: patch-unix-switch.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/switch.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/switch.cxx
@@ -54,7 +54,7 @@
 #endif
 #endif
 
-#if defined(P_FREEBSD) || defined(P_OPENBSD)  || defined(P_NETBSD)
+#if defined(P_FREEBSD) || defined(P_OPENBSD)  || defined(P_NETBSD) || defined(P_DRAGONFLY)
 #define	SET_STACK	context[0]._jb[2] = (int)stackTop-16;
 #if defined(P_NETBSD)
 #include <sys/mman.h>

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-unix-tlib.cxx
$NetBSD: patch-unix-tlib.cxx,v 1.1 2011/12/04 21:59:37 marino Exp $

--- src/ptlib/unix/tlib.cxx.orig	2009-09-21 00:25:17.000000000 +0000
+++ src/ptlib/unix/tlib.cxx
@@ -70,7 +70,7 @@
 #include <sys/mman.h>
 #endif
 
-#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_BEOS) || defined(P_IRIX) || defined(P_QNX)
+#if defined(P_LINUX) || defined(P_SUN4) || defined(P_SOLARIS) || defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD) || defined(P_MACOSX) || defined(P_MACOS) || defined (P_AIX) || defined(P_BEOS) || defined(P_IRIX) || defined(P_QNX) || defined(P_DRAGONFLY)
 #include <sys/utsname.h>
 #define  HAS_UNAME
 #elif defined(P_RTEMS)

File Added: pkgsrc/devel/ptlib/patches/Attic/patch-configure
$NetBSD: patch-configure,v 1.3 2011/12/04 21:59:36 marino Exp $

--- configure.orig	2009-09-21 00:25:59.000000000 +0000
+++ configure
@@ -3828,6 +3828,108 @@ fi
 
                    ;;
 
+  dragonfly*)      OSTYPE=DragonFly ;
+                   OS_TAG="P_DRAGONFLY" ;
+                   if test "x$OSRELEASE" = "x"; then
+                     OSRELEASE="`sysctl -n kern.osreldate`" ;
+                   fi
+                   need_pragma=yes ;
+
+cat >>confdefs.h <<\_ACEOF
+#define P_PTHREADS 1
+_ACEOF
+
+		   { echo "$as_me:$LINENO: checking for swab" >&5
+echo $ECHO_N "checking for swab... $ECHO_C" >&6; }
+if test "${ac_cv_func_swab+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define swab to an innocuous variant, in case <limits.h> declares swab.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define swab innocuous_swab
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char swab (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef swab
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char swab ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_swab || defined __stub___swab
+choke me
+#endif
+
+int
+main ()
+{
+return swab ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_swab=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_swab=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_swab" >&5
+echo "${ECHO_T}$ac_cv_func_swab" >&6; }
+if test $ac_cv_func_swab = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_SYSTEM_SWAB
+_ACEOF
+
+fi
+
+		   ;;
+
   freebsd*|kfreebsd*)       OSTYPE=FreeBSD ;
 		   OS_TAG="P_FREEBSD" ;
                    if test "x$OSRELEASE" = "x"; then
@@ -8264,7 +8366,7 @@ echo "${ECHO_T}no" >&6; }
               { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
               case "$target_os" in
-                freebsd*|openbsd*|netbsd*|darwin*|beos*)
+                dragonfly*|freebsd*|openbsd*|netbsd*|darwin*|beos*)
                   { echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
 echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6; }
 if test "${ac_cv_lib_c_dlopen+set}" = set; then