summaryrefslogtreecommitdiff
path: root/devel/ptlib
diff options
context:
space:
mode:
authormarino <marino>2011-12-04 21:59:36 +0000
committermarino <marino>2011-12-04 21:59:36 +0000
commit5600dc1a00c15e19d380cdbdc2b299d58b7a6d4d (patch)
tree03e18951408784950beb5d9bf349c22ef040f728 /devel/ptlib
parentcce85723d285b6e45c2562a3333c20c398c2cc8f (diff)
downloadpkgsrc-5600dc1a00c15e19d380cdbdc2b299d58b7a6d4d.tar.gz
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.
Diffstat (limited to 'devel/ptlib')
-rw-r--r--devel/ptlib/Makefile14
-rw-r--r--devel/ptlib/PLIST4
-rw-r--r--devel/ptlib/distinfo21
-rw-r--r--devel/ptlib/patches/patch-Nucleus-NucleusPTime.cxx13
-rw-r--r--devel/ptlib/patches/patch-Nucleus-pmachdep.h39
-rw-r--r--devel/ptlib/patches/patch-configure122
-rw-r--r--devel/ptlib/patches/patch-configure.ac21
-rw-r--r--devel/ptlib/patches/patch-include_ptbuildopts.h.in12
-rw-r--r--devel/ptlib/patches/patch-make_unix.mak45
-rw-r--r--devel/ptlib/patches/patch-plugins_sound_esd_sound_esd.h15
-rw-r--r--devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.cxx16
-rw-r--r--devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.h15
-rw-r--r--devel/ptlib/patches/patch-plugins_vidinput_bsd_vidinput_bsd.h16
-rw-r--r--devel/ptlib/patches/patch-unix-config.cxx13
-rw-r--r--devel/ptlib/patches/patch-unix-ossaix.cxx15
-rw-r--r--devel/ptlib/patches/patch-unix-osutil.cxx40
-rw-r--r--devel/ptlib/patches/patch-unix-pipechan.cxx13
-rw-r--r--devel/ptlib/patches/patch-unix-pmachdep.h39
-rw-r--r--devel/ptlib/patches/patch-unix-serchan.cxx13
-rw-r--r--devel/ptlib/patches/patch-unix-socket.cxx58
-rw-r--r--devel/ptlib/patches/patch-unix-switch.cxx13
-rw-r--r--devel/ptlib/patches/patch-unix-tlib.cxx13
22 files changed, 564 insertions, 6 deletions
diff --git a/devel/ptlib/Makefile b/devel/ptlib/Makefile
index 59ef4843e17..5acd4c2469b 100644
--- a/devel/ptlib/Makefile
+++ b/devel/ptlib/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.13 2010/06/27 11:14:50 obache Exp $
+# $NetBSD: Makefile,v 1.14 2011/12/04 21:59:36 marino Exp $
DISTNAME= ptlib-2.6.5
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNOME:=sources/ptlib/2.6/}
EXTRACT_SUFX= .tar.bz2
@@ -29,7 +29,6 @@ CONFIGURE_ARGS+= --enable-vxml
CONFIGURE_ARGS+= --enable-xmlrpc
CONFIGURE_ARGS+= --enable-soap
CONFIGURE_ARGS+= --enable-oss
-CONFIGURE_ARGS+= --enable-v4l2
CONFIGURE_ARGS+= --enable-opal
CONFIGURE_ARGS+= --enable-openldap
#CONFIGURE_ARGS+= --enable-openssl
@@ -42,6 +41,15 @@ CONFIGURE_ARGS+= --disable-avc
CONFIGURE_ARGS+= --disable-dc
PTHREAD_OPTS+= require
+.include "../../mk/bsd.prefs.mk"
+
+PLIST_VARS+= video4l2
+
+.if ${OPSYS} != "DragonFly"
+CONFIGURE_ARGS+= --enable-v4l2
+PLIST.video4l2= yes
+.endif
+
post-install:
${INSTALL_DATA} ${WRKSRC}/version.h ${DESTDIR}${PREFIX}/share/ptlib
diff --git a/devel/ptlib/PLIST b/devel/ptlib/PLIST
index 678f621be48..495c7436690 100644
--- a/devel/ptlib/PLIST
+++ b/devel/ptlib/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.8 2009/07/23 22:11:47 wiz Exp $
+@comment $NetBSD: PLIST,v 1.9 2011/12/04 21:59:36 marino Exp $
bin/ptlib-config
include/ptbuildopts.h
include/ptclib/asnber.h
@@ -162,7 +162,7 @@ lib/libpt.so.${PKGVERSION}
lib/libpt_s.a
lib/pkgconfig/ptlib.pc
lib/${PKGNAME}/devices/sound/oss_pwplugin.so
-lib/${PKGNAME}/devices/videoinput/v4l2_pwplugin.so
+${PLIST.video4l2}lib/${PKGNAME}/devices/videoinput/v4l2_pwplugin.so
share/ptlib/make/common.mak
share/ptlib/make/lib.mak
share/ptlib/make/plugins.mak
diff --git a/devel/ptlib/distinfo b/devel/ptlib/distinfo
index 4e593014fcf..83bd326bbe2 100644
--- a/devel/ptlib/distinfo
+++ b/devel/ptlib/distinfo
@@ -1,5 +1,24 @@
-$NetBSD: distinfo,v 1.10 2009/11/10 11:15:12 wiz Exp $
+$NetBSD: distinfo,v 1.11 2011/12/04 21:59:36 marino Exp $
SHA1 (ptlib-2.6.5.tar.bz2) = 919487aee09d5a1ea5c4f0abdc01bc49d9dcb596
RMD160 (ptlib-2.6.5.tar.bz2) = ab2f8897b64ab7b1eb9fecc35470ce09af42bcf2
Size (ptlib-2.6.5.tar.bz2) = 3302864 bytes
+SHA1 (patch-Nucleus-NucleusPTime.cxx) = 3d8288a12f077867768d5ab0fc2a4e01c1cdb5fc
+SHA1 (patch-Nucleus-pmachdep.h) = e78bd26dbe72538aeeb88bdb75faa35768e328d9
+SHA1 (patch-configure) = 3af145c86d6a7060cb197228ae8046edbde437d4
+SHA1 (patch-configure.ac) = 0813261dd595f2980bf691ad6fc69b27a527f803
+SHA1 (patch-include_ptbuildopts.h.in) = 93559a280ec01e3eaa8396cd83bce7cf4ac275c5
+SHA1 (patch-make_unix.mak) = 03a436317afc6f77e574bf712b1926327bf00f6e
+SHA1 (patch-plugins_sound_esd_sound_esd.h) = 6caff0b4890fe3b137e5dd7ceb1013abe1f7fec8
+SHA1 (patch-plugins_sound_oss_sound_oss.cxx) = d00476fb46a0bf2474e8963a8fe9f1765d393d04
+SHA1 (patch-plugins_sound_oss_sound_oss.h) = 7661d3d2f270680f293ddd4bb58cac8f6f021862
+SHA1 (patch-plugins_vidinput_bsd_vidinput_bsd.h) = 33ee2ced0dd8a1e0e567f8700bba92431193dc10
+SHA1 (patch-unix-config.cxx) = bf263b858d4b964786360c702bd634aa989a8751
+SHA1 (patch-unix-ossaix.cxx) = 5e473ffb524811c4da35fe8cb2f5f77b4807de5c
+SHA1 (patch-unix-osutil.cxx) = 33482828d543fda07fd4070f05295e5536a89e64
+SHA1 (patch-unix-pipechan.cxx) = 03117bf11b31c14255f30afe397d8e4b06d93760
+SHA1 (patch-unix-pmachdep.h) = 4ff7e803fca00f1e86f34234289efbb0910e26c3
+SHA1 (patch-unix-serchan.cxx) = 20131e476b495b7e0babaeb1755c4bfc130909d6
+SHA1 (patch-unix-socket.cxx) = 15364058387caad5da2827cc823da6d578525835
+SHA1 (patch-unix-switch.cxx) = b68d3dad99a7ff90113b9f4b6b19331c472bcca2
+SHA1 (patch-unix-tlib.cxx) = 6f4c6e8750316698484cea5dae4cd91d5717881d
diff --git a/devel/ptlib/patches/patch-Nucleus-NucleusPTime.cxx b/devel/ptlib/patches/patch-Nucleus-NucleusPTime.cxx
new file mode 100644
index 00000000000..c360a51f99e
--- /dev/null
+++ b/devel/ptlib/patches/patch-Nucleus-NucleusPTime.cxx
@@ -0,0 +1,13 @@
+$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);
diff --git a/devel/ptlib/patches/patch-Nucleus-pmachdep.h b/devel/ptlib/patches/patch-Nucleus-pmachdep.h
new file mode 100644
index 00000000000..37a67629e94
--- /dev/null
+++ b/devel/ptlib/patches/patch-Nucleus-pmachdep.h
@@ -0,0 +1,39 @@
+$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)
diff --git a/devel/ptlib/patches/patch-configure b/devel/ptlib/patches/patch-configure
new file mode 100644
index 00000000000..f9e5042882d
--- /dev/null
+++ b/devel/ptlib/patches/patch-configure
@@ -0,0 +1,122 @@
+$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
diff --git a/devel/ptlib/patches/patch-configure.ac b/devel/ptlib/patches/patch-configure.ac
new file mode 100644
index 00000000000..737f29e2c13
--- /dev/null
+++ b/devel/ptlib/patches/patch-configure.ac
@@ -0,0 +1,21 @@
+$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
diff --git a/devel/ptlib/patches/patch-include_ptbuildopts.h.in b/devel/ptlib/patches/patch-include_ptbuildopts.h.in
new file mode 100644
index 00000000000..f19431deb51
--- /dev/null
+++ b/devel/ptlib/patches/patch-include_ptbuildopts.h.in
@@ -0,0 +1,12 @@
+$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
diff --git a/devel/ptlib/patches/patch-make_unix.mak b/devel/ptlib/patches/patch-make_unix.mak
new file mode 100644
index 00000000000..45a2145ed56
--- /dev/null
+++ b/devel/ptlib/patches/patch-make_unix.mak
@@ -0,0 +1,45 @@
+$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)
diff --git a/devel/ptlib/patches/patch-plugins_sound_esd_sound_esd.h b/devel/ptlib/patches/patch-plugins_sound_esd_sound_esd.h
new file mode 100644
index 00000000000..91e3d19f58f
--- /dev/null
+++ b/devel/ptlib/patches/patch-plugins_sound_esd_sound_esd.h
@@ -0,0 +1,15 @@
+$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>
diff --git a/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.cxx b/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.cxx
new file mode 100644
index 00000000000..7fff15ce863
--- /dev/null
+++ b/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.cxx
@@ -0,0 +1,16 @@
+$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);
+ }
+ }
diff --git a/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.h b/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.h
new file mode 100644
index 00000000000..6e799595ed0
--- /dev/null
+++ b/devel/ptlib/patches/patch-plugins_sound_oss_sound_oss.h
@@ -0,0 +1,15 @@
+$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>
diff --git a/devel/ptlib/patches/patch-plugins_vidinput_bsd_vidinput_bsd.h b/devel/ptlib/patches/patch-plugins_vidinput_bsd_vidinput_bsd.h
new file mode 100644
index 00000000000..4bf5f5bd302
--- /dev/null
+++ b/devel/ptlib/patches/patch-plugins_vidinput_bsd_vidinput_bsd.h
@@ -0,0 +1,16 @@
+$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
diff --git a/devel/ptlib/patches/patch-unix-config.cxx b/devel/ptlib/patches/patch-unix-config.cxx
new file mode 100644
index 00000000000..7d34a9d794e
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-config.cxx
@@ -0,0 +1,13 @@
+$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
+
diff --git a/devel/ptlib/patches/patch-unix-ossaix.cxx b/devel/ptlib/patches/patch-unix-ossaix.cxx
new file mode 100644
index 00000000000..7c3ff5fd3f2
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-ossaix.cxx
@@ -0,0 +1,15 @@
+$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
diff --git a/devel/ptlib/patches/patch-unix-osutil.cxx b/devel/ptlib/patches/patch-unix-osutil.cxx
new file mode 100644
index 00000000000..78b761bce48
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-osutil.cxx
@@ -0,0 +1,40 @@
+$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;
diff --git a/devel/ptlib/patches/patch-unix-pipechan.cxx b/devel/ptlib/patches/patch-unix-pipechan.cxx
new file mode 100644
index 00000000000..77192ef88f3
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-pipechan.cxx
@@ -0,0 +1,13 @@
+$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())
diff --git a/devel/ptlib/patches/patch-unix-pmachdep.h b/devel/ptlib/patches/patch-unix-pmachdep.h
new file mode 100644
index 00000000000..1a595862de1
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-pmachdep.h
@@ -0,0 +1,39 @@
+$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)
diff --git a/devel/ptlib/patches/patch-unix-serchan.cxx b/devel/ptlib/patches/patch-unix-serchan.cxx
new file mode 100644
index 00000000000..499a0b24fea
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-serchan.cxx
@@ -0,0 +1,13 @@
+$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
diff --git a/devel/ptlib/patches/patch-unix-socket.cxx b/devel/ptlib/patches/patch-unix-socket.cxx
new file mode 100644
index 00000000000..6d52e1439fe
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-socket.cxx
@@ -0,0 +1,58 @@
+$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)
diff --git a/devel/ptlib/patches/patch-unix-switch.cxx b/devel/ptlib/patches/patch-unix-switch.cxx
new file mode 100644
index 00000000000..f928cb85e31
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-switch.cxx
@@ -0,0 +1,13 @@
+$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>
diff --git a/devel/ptlib/patches/patch-unix-tlib.cxx b/devel/ptlib/patches/patch-unix-tlib.cxx
new file mode 100644
index 00000000000..d6bc077a0c7
--- /dev/null
+++ b/devel/ptlib/patches/patch-unix-tlib.cxx
@@ -0,0 +1,13 @@
+$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)