Index: packages/Makefile.fpc.fpcmake
===================================================================
--- packages/Makefile.fpc.fpcmake	(revision 29091)
+++ packages/Makefile.fpc.fpcmake	(working copy)
@@ -25,6 +25,10 @@
                gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib \
                imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg  httpd22 pxlib numlib \
                users iconvenc gmp fcl-extra libxml
+dirs_dragonfly=rtl-console fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
+               gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo  bfd aspell svgalib \
+               imlib utmp  fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 librsvg  httpd22 pxlib numlib \
+               users iconvenc gmp fcl-extra libxml
 dirs_darwin=rtl-console fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
                libpng gdbm tcl syslog libcurl bfd aspell utmp fftw pcap openssl numlib iconvenc gmp fcl-extra univint iosxlocale
 dirs_iphonesim=rtl-console fv fcl-web fastcgi fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \
@@ -154,7 +158,7 @@
 iosxlocle_shared: univint_shared
 endif
 
-ifneq ($(findstring $(OS_TARGET),beos haiku freebsd darwin iphonesim solaris netbsd openbsd linux win32 win64 wince),)
+ifneq ($(findstring $(OS_TARGET),beos haiku freebsd darwin iphonesim solaris netbsd openbsd linux win32 win64 wince dragonfly),)
 fppkg_all: fpmkunit_all fcl-base_all fcl-xml_all fcl-process_all fcl-net_all paszlib_all fcl-web_all fpmkunit_all
 fppkg_debug: fpmkunit_debug fcl-base_debug fcl-xml_debug fcl-process_debug fcl-net_debug paszlib_debug fcl-web_debug fpmkunit_debug
 fppkg_smart: fpmkunit_smart fcl-base_smart fcl-xml_smart fcl-process_smart fcl-net_smart paszlib_smart fcl-web_smart fpmkunit_smart
@@ -204,7 +208,7 @@
 fcl-registry_release: fpmkunit_release fcl-xml_release
 fcl-registry_shared: fpmkunit_shared fcl-xml_shared
 
-ifeq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris),)
+ifeq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris dragonfly),)
 fcl-net_all: fpmkunit_all fcl-passrc_all fcl-xml_all
 fcl-net_debug: fpmkunit_debug fcl-passrc_debug fcl-xml_debug
 fcl-net_smart: fpmkunit_smart fcl-passrc_smart fcl-xml_smart
@@ -248,7 +252,7 @@
 fcl-async_release: fpmkunit_release
 fcl-async_shared: fpmkunit_shared
 
-ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku),)
+ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku dragonfly),)
 fcl-db_all: fcl-xml_all fcl-base_all mysql_all ibase_all oracle_all odbc_all postgres_all sqlite_all pxlib_all fcl-json_all fpmkunit_all
 fcl-db_debug: fcl-xml_debug fcl-base_debug mysql_debug ibase_debug oracle_debug odbc_debug postgres_debug sqlite_debug pxlib_debug fcl-json_debug fpmkunit_debug
 fcl-db_smart: fcl-xml_smart fcl-base_smart mysql_smart ibase_smart oracle_smart odbc_smart postgres_smart sqlite_smart pxlib_smart fcl-json_smart fpmkunit_smart
@@ -282,7 +286,7 @@
 libpng_release: zlib_release fpmkunit_release
 libpng_shared: zlib_shared fpmkunit_shared
 
-ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris),)
+ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris dragonfly),)
 cairo_all: x11_all fcl-image_all fpmkunit_all
 cairo_debug: x11_debug fcl-image_debug fpmkunit_debug
 cairo_smart: x11_smart fcl-image_smart fpmkunit_smart
@@ -324,7 +328,7 @@
 graph_release: ptc_release
 endif
 
-ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris),)
+ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris dragonfly),)
 gtk1_all: x11_all opengl_all fpmkunit_all
 gtk1_debug: x11_debug opengl_debug fpmkunit_debug
 gtk1_smart: x11_smart opengl_smart fpmkunit_smart
@@ -370,7 +374,7 @@
 libpng_debug: zlib_debug
 libpng_release: zlib_release
 
-ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris),)
+ifneq ($(findstring $(OS_TARGET),linux darwin iphonesim freebsd openbsd netbsd solaris dragonfly),)
 sdl_all: pthreads_all x11_all fpmkunit_all
 sdl_shared: pthreads_shared x11_shared fpmkunit_shared
 sdl_smart: pthreads_smart x11_smart fpmkunit_smart
@@ -458,7 +462,7 @@
 librsvg_debug: gtk2_debug fpmkunit_debug
 librsvg_release: gtk2_release fpmkunit_release
 
-ifneq ($(findstring $(OS_TARGET),linux freebsd darwin iphonesim beos haiku),)
+ifneq ($(findstring $(OS_TARGET),linux freebsd darwin iphonesim beos haiku dragonfly),)
 fcl-xml_all: iconvenc_all
 fcl-xml_shared: iconvenc_shared
 fcl-xml_smart: iconvenc_smart
Index: packages/aspell/fpmake.pp
===================================================================
--- packages/aspell/fpmake.pp	(revision 29091)
+++ packages/aspell/fpmake.pp	(working copy)
@@ -23,7 +23,7 @@
     P.Author := 'header:Aleš Katona, library: Kevin Atkinson';
     P.License := 'header: LGPL with modification, library: LGPL 2.0 or 2.1';
     P.HomepageURL := 'www.freepascal.org';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,netbsd,openbsd,linux,win32,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,netbsd,openbsd,linux,win32,aix,dragonfly];
     P.Email := '';
     P.Description := 'The New Aspell, spelling library';
     P.NeedLibC:= true;
Index: packages/bfd/fpmake.pp
===================================================================
--- packages/bfd/fpmake.pp	(revision 29091)
+++ packages/bfd/fpmake.pp	(working copy)
@@ -23,7 +23,7 @@
     P.Email := '';
     P.Description := 'Binary File Descriptor library.';
     P.NeedLibC:= true;
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly];
 
     P.SourcePath.Add('src');
 
Index: packages/cairo/fpmake.pp
===================================================================
--- packages/cairo/fpmake.pp	(revision 29091)
+++ packages/cairo/fpmake.pp	(working copy)
@@ -19,7 +19,7 @@
     P.Author :=  'Library:  University of Southern California + Red Hat Inc., header: Luiz AmXrico Pereira CXmara';
     P.License := 'Library: MPL 1.1 + LGPL-2.1, header: LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
-    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,win32,win64,aix];
+    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,win32,win64,aix,dragonfly];
     // Do not build cairo on iPhone (=arm-darwin)
     if Defaults.CPU<>arm then
       P.OSes := P.OSes + [darwin];
Index: packages/dblib/fpmake.pp
===================================================================
--- packages/dblib/fpmake.pp	(revision 29091)
+++ packages/dblib/fpmake.pp	(working copy)
@@ -9,7 +9,7 @@
 procedure add_dblib(const ADirectory: string);
 
 Const
-  DBLibOSes         = [linux,freebsd,netbsd,openbsd,solaris,win32,win64,haiku,android];
+  DBLibOSes         = [linux,freebsd,netbsd,openbsd,solaris,win32,win64,haiku,android,dragonfly];
 
 Var
   P : TPackage;
Index: packages/fcl-db/fpmake.pp
===================================================================
--- packages/fcl-db/fpmake.pp	(revision 29091)
+++ packages/fcl-db/fpmake.pp	(working copy)
@@ -8,12 +8,12 @@
 procedure add_fcl_db(const ADirectory: string);
 
 const
-  ParadoxOSes         = [beos,haiku,linux,freebsd,netbsd,openbsd,win32];
-  DatadictOSes        = [aix,beos,darwin,haiku,linux,freebsd,win32,win64,wince,android];
-  SqldbConnectionOSes = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android];
-  SqliteOSes          = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android];
-  DBaseOSes           = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android,os2];
-  MSSQLOSes           = [beos,haiku,linux,freebsd,netbsd,openbsd,solaris,win32,win64,android];
+  ParadoxOSes         = [beos,haiku,linux,freebsd,netbsd,openbsd,win32,dragonfly];
+  DatadictOSes        = [aix,beos,darwin,haiku,linux,freebsd,win32,win64,wince,android,dragonfly];
+  SqldbConnectionOSes = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android,dragonfly];
+  SqliteOSes          = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android,dragonfly];
+  DBaseOSes           = [aix,beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,solaris,win32,win64,wince,android,os2,dragonfly];
+  MSSQLOSes           = [beos,haiku,linux,freebsd,netbsd,openbsd,solaris,win32,win64,android,dragonfly];
   SqldbWithoutOracleOSes   = [win64];
 
 
Index: packages/fcl-db/src/sqldb/interbase/fpmake.inc
===================================================================
--- packages/fcl-db/src/sqldb/interbase/fpmake.inc	(revision 29091)
+++ packages/fcl-db/src/sqldb/interbase/fpmake.inc	(working copy)
@@ -6,7 +6,7 @@
 Targets.ResetDefaults;
 Targets.DefaultDir:='db/sqldb/interbase';
 { Drivers only for the following OSes }
-Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku];
+Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku,dragonfly];
 T:=Targets.AddUnit('ibconnection');
 T.ResourceStrings:=True;
 T:=Targets.AddUnit('fbadmin');
Index: packages/fcl-db/src/sqldb/mssql/fpmake.inc
===================================================================
--- packages/fcl-db/src/sqldb/mssql/fpmake.inc	(revision 29091)
+++ packages/fcl-db/src/sqldb/mssql/fpmake.inc	(working copy)
@@ -6,6 +6,6 @@
 Targets.ResetDefaults;
 Targets.DefaultDir:='db/sqldb/mssql';
 { Drivers only for the following OSes }
-Targets.DefaultOS:=[win32,win64,openbsd,netbsd,freebsd,linux,haiku];
+Targets.DefaultOS:=[win32,win64,openbsd,netbsd,freebsd,linux,haiku,dragonfly];
 T:=Targets.AddUnit('mssqlconn');
 T.ResourceStrings:=False;
Index: packages/fcl-db/src/sqldb/mysql/fpmake.inc
===================================================================
--- packages/fcl-db/src/sqldb/mysql/fpmake.inc	(revision 29091)
+++ packages/fcl-db/src/sqldb/mysql/fpmake.inc	(working copy)
@@ -6,4 +6,4 @@
 Targets.ResetDefaults;
 Targets.DefaultDir:='db/sqldb/mysql';
 { Drivers only for the following OSes }
-Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku];
+Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku,dragonfly];
Index: packages/fcl-db/src/sqldb/postgres/fpmake.inc
===================================================================
--- packages/fcl-db/src/sqldb/postgres/fpmake.inc	(revision 29091)
+++ packages/fcl-db/src/sqldb/postgres/fpmake.inc	(working copy)
@@ -6,7 +6,7 @@
 Targets.ResetDefaults;
 Targets.DefaultDir:='db/sqldb/postgres';
 { Drivers only for the following OSes }
-Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku];
+Targets.DefaultOS:=[win32,openbsd,netbsd,freebsd,darwin,linux,haiku,dragonfly];
 T:=Targets.AddUnit('pqconnection');
 T.ResourceStrings:=True;
 T:=Targets.AddUnit('pqeventmonitor');
Index: packages/fcl-image/fpmake.pp
===================================================================
--- packages/fcl-image/fpmake.pp	(revision 29091)
+++ packages/fcl-image/fpmake.pp	(working copy)
@@ -222,14 +222,14 @@
         begin
           AddUnit('fpimage');
         end;
-    T:=P.Targets.AddUnit('freetypeh.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix]);
-    T:=P.Targets.AddUnit('freetype.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix]);
+    T:=P.Targets.AddUnit('freetypeh.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix,dragonfly]);
+    T:=P.Targets.AddUnit('freetype.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix,dragonfly]);
       with T.Dependencies do
         begin
           AddUnit('freetypeh');
           AddUnit('fpimgcmn');
         end;
-    T:=P.Targets.AddUnit('ftfont.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix]);
+    T:=P.Targets.AddUnit('ftfont.pp',[solaris,iphonesim,darwin,freebsd,openbsd,netbsd,linux,haiku,beos,win32,win64,aix,dragonfly]);
       with T.Dependencies do
         begin
           AddUnit('fpcanvas');
Index: packages/fcl-net/fpmake.pp
===================================================================
--- packages/fcl-net/fpmake.pp	(revision 29091)
+++ packages/fcl-net/fpmake.pp	(working copy)
@@ -21,7 +21,7 @@
     P.Dependencies.Add('openssl',AllOSes - [amiga,aros]);
     P.Dependencies.Add('fcl-xml');
     P.Dependencies.Add('fcl-passrc');
-    P.Dependencies.Add('fcl-async',[linux,freebsd,netbsd,openbsd]);
+    P.Dependencies.Add('fcl-async',[linux,freebsd,netbsd,openbsd,dragonfly]);
     P.Dependencies.Add('rtl-extra');
 
     P.Author := 'Sebastian Guenther and Free Pascal development team';
@@ -61,7 +61,7 @@
     T.ResourceStrings := True;
 
     // HTTP Client
-    T:=P.Targets.AddUnit('fpsock.pp',[linux,freebsd,netbsd,openbsd]);
+    T:=P.Targets.AddUnit('fpsock.pp',[linux,freebsd,netbsd,openbsd,dragonfly]);
       with T.Dependencies do
         begin
           AddUnit('resolve');
Index: packages/fcl-net/src/cnetdb.pp
===================================================================
--- packages/fcl-net/src/cnetdb.pp	(revision 29091)
+++ packages/fcl-net/src/cnetdb.pp	(working copy)
@@ -194,7 +194,7 @@
 {$if defined(LINUX) or defined(OPENBSD)}
 {$define FIRST_ADDR_THEN_CANONNAME}
 {$endif}
-{$if defined(FREEBSD) or defined(NETBSD)}
+{$if defined(FREEBSD) or defined(NETBSD) or defined(DRAGONFLY)}
 {$define FIRST_CANONNAME_THEN_ADDR}
 {$endif}
 {$if not defined(FIRST_CANONNAME_THEN_ADDR) and not defined(FIRST_ADDR_THEN_CANONNAME)}
Index: packages/fcl-web/fpmake.pp
===================================================================
--- packages/fcl-web/fpmake.pp	(revision 29091)
+++ packages/fcl-web/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,win32,win64,wince,aix,amiga,aros];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,win32,win64,wince,aix,amiga,aros,dragonfly];
     P.Dependencies.Add('fcl-base');
     P.Dependencies.Add('fcl-db');
     P.Dependencies.Add('fcl-xml');
Index: packages/fpgtk/fpmake.pp
===================================================================
--- packages/fpgtk/fpmake.pp	(revision 29091)
+++ packages/fpgtk/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,win32,win64,os2,emx,aix];
+    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,win32,win64,os2,emx,aix,dragonfly];
     // Do not build fpgtk on iPhone (=arm-darwin)
     if Defaults.CPU<>arm then
       P.OSes := P.OSes + [darwin];
Index: packages/fpindexer/fpmake.pp
===================================================================
--- packages/fpindexer/fpmake.pp	(revision 29091)
+++ packages/fpindexer/fpmake.pp	(working copy)
@@ -7,8 +7,8 @@
 
 procedure add_fpindexer(const ADirectory: string);
 Const
-  SqldbConnectionOSes = [beos,haiku,linux,freebsd,win32,win64,wince,darwin,iphonesim,netbsd,openbsd,aix];
-  SqliteOSes          = [beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,win32,wince,aix];
+  SqldbConnectionOSes = [beos,haiku,linux,freebsd,win32,win64,wince,darwin,iphonesim,netbsd,openbsd,aix,dragonfly];
+  SqliteOSes          = [beos,haiku,linux,freebsd,darwin,iphonesim,netbsd,openbsd,win32,wince,aix,dragonfly];
     
 Var
   T : TTarget;
@@ -19,7 +19,7 @@
       P:=AddPackage('fpindexer');
       P.Directory:=ADirectory;
       P.Version:='2.7.1';
-      P.OSes := [beos,haiku,freebsd,darwin,solaris,netbsd,openbsd,linux,win32,win64,wince,aix];
+      P.OSes := [beos,haiku,freebsd,darwin,solaris,netbsd,openbsd,linux,win32,win64,wince,aix,dragonfly];
       P.Dependencies.Add('fcl-base');
       P.Dependencies.Add('fcl-db');
       P.Dependencies.Add('chm'); // for fastreaderhtml
Index: packages/fpmkunit/src/fpmkunit.pp
===================================================================
--- packages/fpmkunit/src/fpmkunit.pp	(revision 29091)
+++ packages/fpmkunit/src/fpmkunit.pp	(working copy)
@@ -112,7 +112,7 @@
     amiga,atari, solaris, qnx, netware, openbsd,wdosx,
     palmos,macos,darwin,emx,watcom,morphos,netwlibc,
     win64,wince,gba,nds,embedded,symbian,haiku,iphonesim,
-    aix,java,android,nativent,msdos,wii,aros
+    aix,java,android,nativent,msdos,wii,aros,dragonfly
   );
   TOSes = Set of TOS;
 
@@ -163,8 +163,8 @@
 
   AllOSes = [Low(TOS)..High(TOS)];
   AllCPUs = [Low(TCPU)..High(TCPU)];
-  AllUnixOSes  = [Linux,FreeBSD,NetBSD,OpenBSD,Darwin,QNX,BeOS,Solaris,Haiku,iphonesim,aix,Android];
-  AllBSDOSes      = [FreeBSD,NetBSD,OpenBSD,Darwin,iphonesim];
+  AllUnixOSes  = [Linux,FreeBSD,NetBSD,OpenBSD,Darwin,QNX,BeOS,Solaris,Haiku,iphonesim,aix,Android,dragonfly];
+  AllBSDOSes      = [FreeBSD,NetBSD,OpenBSD,Darwin,iphonesim,dragonfly];
   AllWindowsOSes  = [Win32,Win64,WinCE];
   AllAmigaLikeOSes = [Amiga,MorphOS,AROS];
   AllLimit83fsOses = [go32v2,os2,emx,watcom,msdos];
@@ -212,6 +212,7 @@
     { msdos }   ( false, false, false, false, false, false, false, false, false, false, false, false, false, true ),
     { wii }     ( false, false, false, true , false, false, false, false, false, false, false, false, false, false ),
     { aros }    ( true,  false, false, false, false, false, false, false, false, false, false, false, false, false )
+    { dragonfly}( false, false, false, false, false, true, false, false, false, false, false, false, false, false )
   );
 
   // Useful
@@ -2516,7 +2517,7 @@
 begin
   result := '';
   ErrorMessage:='';
-  if OS in [freebsd, openbsd] then
+  if OS in [freebsd, openbsd, dragonfly] then
     result := '/usr/local/lib'
   else if OS = netbsd then
     result := '/usr/pkg/lib'
@@ -3768,7 +3769,7 @@
 begin
   If (FDocInstallDir<>'') then
     Result:=FDocInstallDir
-  else if Defaults.BuildOS=freebsd then
+  else if Defaults.BuildOS=freebsd or Defaults.BuildOS=dragonfly then
     result := Prefix+PathDelim+'share'+PathDelim+'doc'+PathDelim+'$(PackageName)'
   else If UnixPaths then
     Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(PackageName)-$(PACKAGEVERSION)'
@@ -3781,7 +3782,7 @@
 begin
   If (FExamplesInstallDir<>'') then
     Result:=FExamplesInstallDir
-  else if Defaults.BuildOS=freebsd then
+  else if Defaults.BuildOS=freebsd or Defaults.BuildOS=dragonfly then
     result := Prefix+PathDelim+'share'+PathDelim+'examples'+PathDelim+'$(PackageName)'
   else If UnixPaths then
     Result:=Prefix+'share'+PathDelim+'doc'+PathDelim+'fpc-$(PackageName)-$(PACKAGEVERSION)'+PathDelim+'examples'
Index: packages/fppkg/fpmake.pp
===================================================================
--- packages/fppkg/fpmake.pp	(revision 29091)
+++ packages/fppkg/fpmake.pp	(working copy)
@@ -8,7 +8,7 @@
 procedure add_fppkg(const ADirectory: string);
 
 const
-  TargetsWithWGet = [linux,beos,haiku,freebsd,netbsd,openbsd,darwin,iphonesim,solaris,win32,win64,wince,aix];
+  TargetsWithWGet = [linux,beos,haiku,freebsd,netbsd,openbsd,darwin,iphonesim,solaris,win32,win64,wince,aix,dragonfly];
   TargetsWithfpWeb = TargetsWithWGet;
 
 Var
Index: packages/fv/fpmake.pp
===================================================================
--- packages/fv/fpmake.pp	(revision 29091)
+++ packages/fv/fpmake.pp	(working copy)
@@ -20,7 +20,7 @@
     P.Author := 'Leon De Boer and Pierre Mueller';
     P.License := 'LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,win32,win64,os2,emx,netware,netwlibc,go32v2,aix]+AllAmigaLikeOSes;
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,win32,win64,os2,emx,netware,netwlibc,go32v2,aix,dragonfly]+AllAmigaLikeOSes;
     P.Email := '';
     P.Description := 'Free Vision, a portable Turbo Vision clone.';
     P.NeedLibC:= false;
Index: packages/gdbint/fpmake.pp
===================================================================
--- packages/gdbint/fpmake.pp	(revision 29091)
+++ packages/gdbint/fpmake.pp	(working copy)
@@ -156,7 +156,7 @@
     // file within the BeforeCompile event.
     P.SupportBuildModes:= [bmOneByOne];
 
-    P.OSes:=[aix,beos,haiku,freebsd,netbsd,openbsd,linux,win32,win64,go32v2];
+    P.OSes:=[aix,beos,haiku,freebsd,netbsd,openbsd,linux,win32,win64,go32v2,dragonfly];
 
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
Index: packages/gdbint/src/gdbint.pp
===================================================================
--- packages/gdbint/src/gdbint.pp	(revision 29091)
+++ packages/gdbint/src/gdbint.pp	(working copy)
@@ -391,6 +391,41 @@
   {$LINKLIB gcc}
 {$endif linux}
 
+{$ifdef dragonfly}
+{$ifdef NotImplemented}
+  {$linklib kvm}
+  {$undef NotImplemented}
+  {$LINKLIB libgdb.a}
+  {$ifdef GDB_HAS_SIM}
+    {$LINKLIB libsim.a}
+  {$endif GDB_HAS_SIM}
+  {$LINKLIB libbfd.a}
+  {$LINKLIB libreadline.a}
+  {$LINKLIB libopcodes.a}
+  {$LINKLIB libhistory.a}
+  {$LINKLIB libiberty.a}
+  {$LINKLIB libgnu.a}
+  {$LINKLIB ncurses}
+  {$LINKLIB z}
+  {$LINKLIB m}
+  {$LINKLIB iberty}
+  {$ifndef GDB_DISABLE_INTL}
+    {$LINKLIB intl}
+  {$endif ndef GDB_DISABLE_INTL}
+  {$ifdef GDB_USES_LIBDECNUMBER}
+    {$LINKLIB decnumber}
+  {$endif GDB_USES_LIBDECNUMBER}
+  {$ifdef GDB_USES_EXPAT_LIB}
+    {$LINKLIB expat}
+  {$endif GDB_USES_EXPAT_LIB}
+  {$ifdef GDB_USES_LIBPYTHON}
+    {$LINKLIB python}
+  {$endif GDB_USES_LIBPYTHON}
+{$endif NotImplemented}
+  {$LINKLIB c}
+  {$LINKLIB gcc}
+{$endif freebsd}
+
 {$ifdef freebsd}
 {$ifdef NotImplemented}
   {$ifdef FreeBSD5}  //5.4+ ?
Index: packages/ggi/fpmake.pp
===================================================================
--- packages/ggi/fpmake.pp	(revision 29091)
+++ packages/ggi/fpmake.pp	(working copy)
@@ -23,7 +23,7 @@
     P.Email := '';
     P.Description := 'a project that aims to develop a reliable, stable and fast graphics system that works everywhere.';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
-    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux];
+    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,dragonfly];
    
     // note that this package may be severely outdated. Header copyright
     // lists 1999, and ggi itself is still developed, and major releases
Index: packages/libcurl/fpmake.pp
===================================================================
--- packages/libcurl/fpmake.pp	(revision 29091)
+++ packages/libcurl/fpmake.pp	(working copy)
@@ -21,7 +21,7 @@
     P.Author := 'Library: Daniel Stenberg, header: Free Pascal development team';
     P.License := 'Library: MIT, header: LGPL with modification, ';
     P.HomepageURL := 'www.freepascal.org';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly];
     P.Email := '';
     P.Description := 'Library to fetch files from URLs using many protocols.';
     P.NeedLibC:= true;  // true for headers that indirectly link to libc?
Index: packages/librsvg/fpmake.pp
===================================================================
--- packages/librsvg/fpmake.pp	(revision 29091)
+++ packages/librsvg/fpmake.pp	(working copy)
@@ -16,7 +16,7 @@
 {$ifdef ALLPACKAGES}
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
-    P.OSes := [beos,haiku,freebsd,netbsd,openbsd,linux,win32,aix];
+    P.OSes := [beos,haiku,freebsd,netbsd,openbsd,linux,win32,aix,dragonfly];
     // Do not build x11 on iPhone (=arm-darwin)
     if Defaults.CPU<>arm then
       P.OSes := P.OSes + [darwin];
Index: packages/ncurses/fpmake.pp
===================================================================
--- packages/ncurses/fpmake.pp	(revision 29091)
+++ packages/ncurses/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly];
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
 
Index: packages/pthreads/fpmake.pp
===================================================================
--- packages/pthreads/fpmake.pp	(revision 29091)
+++ packages/pthreads/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly];
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
 
Index: packages/pxlib/fpmake.pp
===================================================================
--- packages/pxlib/fpmake.pp	(revision 29091)
+++ packages/pxlib/fpmake.pp	(working copy)
@@ -15,7 +15,7 @@
 {$ifdef ALLPACKAGES}
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
-    P.OSes:=[Linux,beos,haiku,win32,freebsd,openbsd,netbsd];
+    P.OSes:=[Linux,beos,haiku,win32,freebsd,openbsd,netbsd,dragonfly];
     P.Version:='2.7.1';
     T:=P.Targets.AddUnit('src/pxlib.pp');
     T:=P.Targets.AddExampleunit('examples/ppxview.pp');
Index: packages/rtl-extra/fpmake.pp
===================================================================
--- packages/rtl-extra/fpmake.pp	(revision 29091)
+++ packages/rtl-extra/fpmake.pp	(working copy)
@@ -14,10 +14,10 @@
  
   // Android has a dummy clocale unit, while it also includes unix dir.
   ClocaleOSes   = UnixLikes -[beos];
-  CLocaleIncOSes= [Aix,freebsd,netbsd,openbsd,solaris,darwin,iphonesim];
+  CLocaleIncOSes= [Aix,freebsd,netbsd,openbsd,solaris,darwin,iphonesim,dragonfly];
 
   IPCOSes       = UnixLikes-[aix,android,beos,haiku,solaris];
-  IPCBSDs       = [FreeBSD,NetBSD,OpenBSD];
+  IPCBSDs       = [FreeBSD,NetBSD,OpenBSD,DragonFly];
 //  IPCcdeclOSes  = [Darwin,iphonesim];
 
   PrinterOSes   = [go32v2,msdos,os2,win32,win64]+unixlikes-[beos,haiku,morphos];
@@ -29,7 +29,7 @@
   WinSock2OSes  = [win32,win64,wince];
   // sockets of  morphos is implemented, but not active
   SocketsOSes   = UnixLikes+[amiga,aros,netware,netwlibc,os2,wince,win32,win64];
-  Socksyscall   = [beos,freebsd,haiku,linux,netbsd,openbsd];
+  Socksyscall   = [beos,freebsd,haiku,linux,netbsd,openbsd,dragonfly];
   Socklibc	= unixlikes-socksyscall;
   gpmOSes	= [Linux,Android];
   AllTargetsextra = ObjectsOSes + UComplexOSes + MatrixOSes+
Index: packages/rtl-unicode/fpmake.pp
===================================================================
--- packages/rtl-unicode/fpmake.pp	(revision 29091)
+++ packages/rtl-unicode/fpmake.pp	(working copy)
@@ -12,13 +12,13 @@
   // in workable state atm.
   UnixLikes = AllUnixOSes -[QNX];
 
-  CollationOSes = [aix,darwin,freebsd,linux,netbsd,openbsd,solaris,win32,win64];
-  CPUnits       = [aix,amiga,aros,android,beos,darwin,iphonesim,emx,gba,freebsd,go32v2,haiku,linux,morphos,netbsd,netware,netwlibc,openbsd,os2,solaris,watcom,wii,win32,win64,wince];
+  CollationOSes = [aix,darwin,freebsd,linux,netbsd,openbsd,solaris,win32,win64,dragonfly];
+  CPUnits       = [aix,amiga,aros,android,beos,darwin,iphonesim,emx,gba,freebsd,go32v2,haiku,linux,morphos,netbsd,netware,netwlibc,openbsd,os2,solaris,watcom,wii,win32,win64,wince,dragonfly];
   utf8bidiOSes  = [netware,netwlibc];
   freebidiOSes  = [netware,netwlibc];  
 
 // Character not movable because fpwidestring depends on it.
-//  CharacterOSes = [android,darwin,freebsd,linux,netbsd,openbsd,solaris,win32,win64];
+//  CharacterOSes = [android,darwin,freebsd,linux,netbsd,openbsd,solaris,win32,win64,dragonfly];
 
   UnicodeAllOSes =   CollationOSes + utf8bidiOSes + freebidiOSes + CPUnits;
 
Index: packages/svgalib/fpmake.pp
===================================================================
--- packages/svgalib/fpmake.pp	(revision 29091)
+++ packages/svgalib/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,linux,freebsd,solaris,netbsd,openbsd];
+    P.OSes := [beos,haiku,linux,freebsd,solaris,netbsd,openbsd,dragonfly];
     P.SourcePath.Add('src');
 
     T:=P.Targets.AddUnit('svgalib.pp');
Index: packages/syslog/fpmake.pp
===================================================================
--- packages/syslog/fpmake.pp	(revision 29091)
+++ packages/syslog/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,aix,dragonfly];
     P.SourcePath.Add('src');
 
     T:=P.Targets.AddUnit('systemlog.pp');
Index: packages/utmp/fpmake.pp
===================================================================
--- packages/utmp/fpmake.pp	(revision 29091)
+++ packages/utmp/fpmake.pp	(working copy)
@@ -18,7 +18,7 @@
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
     P.SourcePath.Add('src');
-    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux];
+    P.OSes := [beos,haiku,freebsd,darwin,iphonesim,solaris,netbsd,openbsd,linux,dragonfly];
 
     T:=P.Targets.AddUnit('utmp.pp');
 
Index: packages/x11/fpmake.pp
===================================================================
--- packages/x11/fpmake.pp	(revision 29091)
+++ packages/x11/fpmake.pp	(working copy)
@@ -17,7 +17,7 @@
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
-    P.OSes:=[beos,haiku,freebsd,solaris,netbsd,openbsd,linux,os2,emx,aix];
+    P.OSes:=[beos,haiku,freebsd,solaris,netbsd,openbsd,linux,os2,emx,aix,dragonfly];
     // Do not build x11 on iPhone (=arm-darwin)
     if Defaults.CPU<>arm then
       P.OSes := P.OSes + [darwin];
Index: packages/xforms/fpmake.pp
===================================================================
--- packages/xforms/fpmake.pp	(revision 29091)
+++ packages/xforms/fpmake.pp	(working copy)
@@ -18,7 +18,7 @@
 {$endif ALLPACKAGES}
     P.Version:='2.7.1';
     P.SourcePath.Add('src');
-    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,aix];
+    P.OSes := [beos,haiku,freebsd,solaris,netbsd,openbsd,linux,aix,dragonfly];
     // Do not build x11 on iPhone (=arm-darwin)
     if Defaults.CPU<>arm then
       P.OSes := P.OSes + [darwin];
