Index: compiler/Makefile.fpc
===================================================================
--- compiler/Makefile.fpc	(revision 29091)
+++ compiler/Makefile.fpc	(working copy)
@@ -300,7 +300,7 @@
 OPTWPOPERFORM=-Owdevirtcalls,optvmts -Fw$(BASEDIR)/pp1.wpo
 # symbol liveness WPO requires nm, smart linking and no stripping (the latter
 # is forced by the Makefile when necessary)
-ifneq ($(findstring $(OS_TARGET),darwin linux freebsd solaris),)
+ifneq ($(findstring $(OS_TARGET),darwin linux dragonfly freebsd solaris),)
 ifdef LINKSMART
 ifdef CREATESMART
 OPTWPOCOLLECT+=-OWsymbolliveness -Xs-
Index: compiler/aggas.pas
===================================================================
--- compiler/aggas.pas	(revision 29091)
+++ compiler/aggas.pas	(working copy)
@@ -1718,7 +1718,7 @@
 
       { "no executable stack" marker }
       { TODO: used by OpenBSD/NetBSD as well? }
-      if (target_info.system in (systems_linux + systems_android + systems_freebsd)) and
+      if (target_info.system in (systems_linux + systems_android + systems_freebsd + systems_dragonfly)) and
          not(cs_executable_stack in current_settings.moduleswitches) then
         begin
           AsmWriteLn('.section .note.GNU-stack,"",%progbits');
Index: compiler/cfileutl.pas
===================================================================
--- compiler/cfileutl.pas	(revision 29091)
+++ compiler/cfileutl.pas	(working copy)
@@ -23,7 +23,9 @@
 
 {$i fpcdefs.inc}
 
+{$ifndef DragonFly}
 {$define usedircache}
+{$endif DragonFly}
 
 interface
 
Index: compiler/expunix.pas
===================================================================
--- compiler/expunix.pas	(revision 29091)
+++ compiler/expunix.pas	(working copy)
@@ -154,7 +154,7 @@
            current_asmdata.asmlists[al_procedures].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
            if (cs_create_pic in current_settings.moduleswitches) and
              { other targets need to be checked how it works }
-             (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris,system_i386_android]) then
+             (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris,system_i386_android,system_x86_64_dragonfly]) then
              begin
 {$ifdef x86}
                sym:=current_asmdata.RefAsmSymbol(pd.mangledname);
Index: compiler/ogelf.pas
===================================================================
--- compiler/ogelf.pas	(revision 29091)
+++ compiler/ogelf.pas	(working copy)
@@ -1216,7 +1216,7 @@
            shstrtabsect:=TElfObjSection.create_ext(data,'.shstrtab',SHT_STRTAB,0,1,0);
            { "no executable stack" marker }
            { TODO: used by OpenBSD/NetBSD as well? }
-           if (target_info.system in (systems_linux + systems_android + systems_freebsd)) and
+           if (target_info.system in (systems_linux + systems_android + systems_freebsd + systems_dragonfly)) and
               not(cs_executable_stack in current_settings.moduleswitches) then
              TElfObjSection.create_ext(data,'.note.GNU-stack',SHT_PROGBITS,0,1,0);
            { symbol for filename }
@@ -1260,7 +1260,9 @@
            if target_info.system in systems_openbsd then
              header.e_ident[EI_OSABI]:=ELFOSABI_OPENBSD
            else if target_info.system in systems_freebsd then
-             header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD;
+             header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD
+           else if target_info.system in systems_dragonfly then
+             header.e_ident[EI_OSABI]:=ELFOSABI_NONE;
            header.e_type:=ET_REL;
            header.e_machine:=ElfTarget.machine_code;
            header.e_version:=1;
@@ -2025,7 +2027,9 @@
         if target_info.system in systems_openbsd then
           header.e_ident[EI_OSABI]:=ELFOSABI_OPENBSD
         else if target_info.system in systems_freebsd then
-          header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD;
+          header.e_ident[EI_OSABI]:=ELFOSABI_FREEBSD
+        else if target_info.system in systems_dragonfly then
+          header.e_ident[EI_OSABI]:=ELFOSABI_NONE;
         if IsSharedLibrary then
           header.e_type:=ET_DYN
         else
Index: compiler/symdef.pas
===================================================================
--- compiler/symdef.pas	(revision 29091)
+++ compiler/symdef.pas	(working copy)
@@ -2795,10 +2795,12 @@
            s32real : savesize:=4;
            s80real : savesize:=10;
            sc80real:
-             if target_info.system in [system_i386_darwin,system_i386_iphonesim,system_x86_64_darwin,
+             if target_info.system in [system_i386_darwin,
+                  system_i386_iphonesim,system_x86_64_darwin,
                   system_x86_64_linux,system_x86_64_freebsd,
                   system_x86_64_openbsd,system_x86_64_netbsd,
-                  system_x86_64_solaris,system_x86_64_embedded] then
+                  system_x86_64_solaris,system_x86_64_embedded,
+                  system_x86_64_dragonfly] then
                savesize:=16
              else
                savesize:=12;
Index: compiler/systems/i_bsd.pas
===================================================================
--- compiler/systems/i_bsd.pas	(revision 29091)
+++ compiler/systems/i_bsd.pas	(working copy)
@@ -188,6 +188,72 @@
           );
 
 
+       system_x86_64_dragonfly_info : tsysteminfo =
+          (
+            system       : system_x86_64_dragonfly;
+            name         : 'DragonFly for x86-64';
+            shortname    : 'DragonFly';
+            flags        : [tf_needs_symbol_size,tf_needs_dwarf_cfi,tf_library_needs_pic,tf_needs_symbol_type,
+                            tf_files_case_sensitive,tf_smartlink_library,
+                            tf_dwarf_only_local_labels,
+                            {tf_pic_uses_got,}tf_smartlink_sections,tf_has_winlike_resources];
+            cpu          : cpu_x86_64;
+            unit_env     : 'BSDUNITS';
+            extradefines : 'UNIX;HASUNIX;BSD';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            importlibprefix : 'libimp';
+            importlibext : '.a';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            assem        : as_x86_64_elf64;
+            assemextern  : as_gas;
+            link         : ld_none;
+            linkextern   : ld_bsd;
+            ar           : ar_gnu_ar;
+            res          : res_elf;
+            dbg          : dbg_dwarf2;            //dbg_stabs;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 8;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 8;
+                varalignmin     : 0;
+                varalignmax     : 16;
+                localalignmin   : 4;
+                localalignmax   : 16;
+                recordalignmin  : 0;
+                recordalignmax  : 16;
+                maxCrecordalign : 16
+              );
+            first_parm_offset : 16;
+            stacksize    : 256*1024;
+            stackalign   : 16;
+            abi          : abi_default;
+          );
+
+
        system_i386_netbsd_info : tsysteminfo =
           (
             system       : system_i386_NetBSD;
@@ -969,6 +1035,9 @@
    {$ifdef FreeBSD}
      set_source_info(system_x86_64_FreeBSD_info);
    {$endif}
+   {$ifdef DragonFly}
+     set_source_info(system_x86_64_DragonFly_info);
+   {$endif}
    {$ifdef OpenBSD}
      set_source_info(system_x86_64_OpenBSD_info);
    {$endif}
Index: compiler/systems/t_bsd.pas
===================================================================
--- compiler/systems/t_bsd.pas	(revision 29091)
+++ compiler/systems/t_bsd.pas	(working copy)
@@ -917,6 +917,9 @@
 initialization
   RegisterLinker(ld_bsd,TLinkerBSD);
 {$ifdef x86_64}
+  RegisterImport(system_x86_64_dragonfly,timportlibbsd);
+  RegisterExport(system_x86_64_dragonfly,texportlibbsd);
+  RegisterTarget(system_x86_64_dragonfly_info);
   RegisterImport(system_x86_64_freebsd,timportlibbsd);
   RegisterExport(system_x86_64_freebsd,texportlibbsd);
   RegisterTarget(system_x86_64_freebsd_info);
Index: compiler/systems.inc
===================================================================
--- compiler/systems.inc	(revision 29091)
+++ compiler/systems.inc	(working copy)
@@ -164,7 +164,8 @@
              system_mipseb_embedded,    { 81 }
              system_mipsel_embedded,    { 82 }
              system_i386_aros,          { 83 }
-             system_x86_64_aros         { 84 }
+             system_x86_64_aros,        { 84 }
+             system_x86_64_dragonfly    { 85 }
        );
 
      type
Index: compiler/systems.pas
===================================================================
--- compiler/systems.pas	(revision 29091)
+++ compiler/systems.pas	(working copy)
@@ -217,6 +217,7 @@
        systems_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,system_powerpc64_linux,
                        system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
                        system_x86_6432_linux,system_mipseb_linux,system_mipsel_linux];
+       systems_dragonfly = [system_x86_64_dragonfly];
        systems_freebsd = [system_i386_freebsd,
                           system_x86_64_freebsd];
        systems_netbsd  = [system_i386_netbsd,
@@ -227,7 +228,7 @@
                           system_m68k_openbsd,
                           system_x86_64_openbsd];
 
-       systems_bsd = systems_freebsd + systems_netbsd + systems_openbsd;
+       systems_bsd = systems_freebsd + systems_netbsd + systems_openbsd + systems_dragonfly;
 
        systems_aix = [system_powerpc_aix,system_powerpc64_aix];
 
@@ -770,6 +771,10 @@
     default_target(system_x86_64_linux);
     {$define default_target_set}
    {$endif}
+   {$ifdef dragonfly}
+    default_target(system_x86_64_dragonfly);
+    {$define default_target_set}
+   {$endif}
    {$ifdef freebsd}
     default_target(system_x86_64_freebsd);
     {$define default_target_set}
Index: compiler/utils/ppuutils/ppudump.pp
===================================================================
--- compiler/utils/ppuutils/ppudump.pp	(revision 29091)
+++ compiler/utils/ppuutils/ppudump.pp	(working copy)
@@ -166,7 +166,8 @@
   { 81 }  'Embedded-mipseb',
   { 82 }  'Embedded-mipsel',
   { 83 }  'AROS-i386',
-  { 84 }  'AROS-x86-64'
+  { 84 }  'AROS-x86-64',
+  { 85 }  'DragonFly-x86-64'
   );
 
 const
Index: compiler/x86/agx86att.pas
===================================================================
--- compiler/x86/agx86att.pas	(revision 29091)
+++ compiler/x86/agx86att.pas	(working copy)
@@ -469,7 +469,8 @@
             asmcmd : '--64 -o $OBJ $EXTRAOPT $ASM';
             supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
                                  system_x86_64_win64,system_x86_64_embedded,
-                                 system_x86_64_openbsd,system_x86_64_netbsd];
+                                 system_x86_64_openbsd,system_x86_64_netbsd,
+                                 system_x86_64_dragonfly];
             flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
             labelprefix : '.L';
             comment : '# ';
Index: compiler/x86_64/cpuelf.pas
===================================================================
--- compiler/x86_64/cpuelf.pas	(revision 29091)
+++ compiler/x86_64/cpuelf.pas	(working copy)
@@ -674,7 +674,8 @@
         asmbin : '';
         asmcmd : '';
         supported_targets : [system_x86_64_linux,system_x86_64_freebsd,
-                             system_x86_64_openbsd,system_x86_64_netbsd];
+                             system_x86_64_openbsd,system_x86_64_netbsd,
+                             system_x86_64_dragonfly];
         flags : [af_outputbinary,af_smartlink_sections,af_supports_dwarf];
         labelprefix : '.L';
         comment : '';
Index: rtl/Makefile.fpc
===================================================================
--- rtl/Makefile.fpc	(revision 29091)
+++ rtl/Makefile.fpc	(working copy)
@@ -16,6 +16,7 @@
 dirs_os2=os2
 dirs_emx=emx
 dirs_freebsd=freebsd
+dirs_dragonfly=dragonfly
 dirs_darwin=darwin
 dirs_iphonesim=darwin
 dirs_beos=beos
Index: rtl/bsd/ostypes.inc
===================================================================
--- rtl/bsd/ostypes.inc	(revision 29091)
+++ rtl/bsd/ostypes.inc	(working copy)
@@ -63,6 +63,30 @@
 
   { file characteristics services }
    stat    = record { the types are real}
+{$ifdef dragonfly}
+        st_ino        : ino_t;             // inode's number
+        st_nlink      : nlink_t;           // number of hard links
+        st_dev        : dev_t;             // inode's device
+        st_mode       : mode_t;            // inode protection mode
+        st_padd1      : cuint16;
+        st_uid        : uid_t;             // user ID of the file's owner
+        st_gid        : gid_t;             // group ID of the file's group
+        st_rdev       : dev_t;             // device type
+        st_atime      : time_t;            // time of last access (half timespec)
+        st_atimensec  : clong;             // nsec of last access (half timespec)
+        st_mtime      : time_t;            // time of last data modification
+        st_mtimensec  : clong;             // nsec of last data modification
+        st_ctime      : time_t;            // time of last file status change
+        st_ctimensec  : clong;             // nsec of last file status change
+        st_size       : off_t;             // file size, in bytes
+        st_blocks     : cint64;            // blocks allocated for file
+        st_blksize    : cuint32;           // optimal blocksize for I/O
+        st_flags      : cuint32;           // user defined flags for file
+        st_gen        : cuint32;           // file generation number
+        st_lspare     : cint32;
+        st_qspare1    : cint64;            // was recursive change detect
+        st_qspare2    : cint64;
+{$else dragonfly}
 {$ifdef openbsd}
         st_mode       : mode_t;            // inode protection mode
 {$endif}
@@ -116,6 +140,7 @@
         st_birthtimensec : clong;          // nsec of file creation time
 {$endif}
         st_qspare     : array[0..1] Of cint64;
+{$endif dragonfly}
    end;
    TStat = stat;
    pStat = ^stat;
@@ -239,7 +264,7 @@
     O_APPEND    =     8;        { Writes append to the file.        }
     O_NONBLOCK  =     4;        { Non-blocking I/O.                 }
 
-{$ifdef freebsd}
+{$if defined(freebsd) or defined(dragonfly)}
     { Other }
     O_SHLOCK    =   $10;        { Open with shared file lock }
     O_EXLOCK    =   $20;        { Open with exclusive file lock }
@@ -287,6 +312,13 @@
   F_SetLkW         = 13;          { F_SETLK; wait if blocked }
   F_SetLkRemote    = 14;          { debugging support for remote locks }
 {$endif}
+{$ifdef dragonfly}
+  F_GetLk          = 7;           { get record locking information}
+  F_SetLk          = 8;           { set record locking information }
+  F_SetLkW         = 9;           { F_SETLK; wait if blocked }
+  F_Dup2Fd         = 10;          { duplicate file descriptor to arg }
+  F_DupFd_CloExec  = 17;	  { close on exec duplicated fd }
+{$endif}
 {$ifdef netbsd}
   F_GetLk          = 7;           { get record locking information}
   F_SetLk          = 8;           { set record locking information }
@@ -376,19 +408,18 @@
 // #define      ru_last         ru_nivcsw
 // #define      ru_first        ru_ixrss
 
-{ auto generated by a c prog, statmacr.c}
 
 Const
-  S_IFMT  = 61440;
-  S_IFIFO = 4096;
-  S_IFCHR = 8192;
-  S_IFDIR = 16384;
-  S_IFBLK = 24576;
-  S_IFREG = 32768;
-  S_IFLNK = 40960;
-  S_IFSOCK= 49152;
-  S_IFWHT = 57344;
-  S_ISVTX = 512;
+  S_IFMT  = &170000;
+  S_IFIFO =  &10000;
+  S_IFCHR =  &20000;
+  S_IFDIR =  &40000;
+  S_IFBLK =  &60000;
+  S_IFREG = &100000;
+  S_IFLNK = &120000;
+  S_IFSOCK= &140000;
+  S_IFWHT = &160000;
+  S_ISVTX =   &1000;
 
 {
  * Resource limits from FreeBSD5. To be checked for the others.
@@ -402,7 +433,7 @@
   RLIMIT_MEMLOCK  = 6;              { locked-in-memory address space }
   RLIMIT_NPROC    = 7;              { number of processes }
   RLIMIT_NOFILE   = 8;              { number of open files }
-{$IFDEF FreeBSD}
+{$if defined(freebsd) or defined(dragonfly)}
   RLIMIT_SBSIZE   = 9;              { maximum size of all socket buffers }
   RLIMIT_VMEM     =10;              { virtual process size (inclusive of mmap) }
   RLIMIT_AS       = RLIMIT_VMEM;
@@ -413,6 +444,9 @@
   {$ifdef FreeBSD}
   RLIM_NLIMITS    =11;              { number of resource limits }
   {$endif}
+  {$ifdef dragonfly}
+  RLIM_NLIMITS    =12;              { number of resource limits }
+  {$endif}
 
   {$ifdef Darwin}   // OS X 10.3
   RLIM_NLIMITS    =9;              { number of resource limits }
Index: rtl/bsd/sysctl.pp
===================================================================
--- rtl/bsd/sysctl.pp	(revision 29091)
+++ rtl/bsd/sysctl.pp	(working copy)
@@ -97,7 +97,7 @@
 {$ENDIF}
 
 {$ifndef FPC_USE_LIBC}
-{$ifdef FreeBSD}
+{$if defined(FreeBSD) or defined(DragonFly)}
 CONST  syscall_nr___sysctl                    = 202;
 {$endif}
 
Index: rtl/bsd/sysos.inc
===================================================================
--- rtl/bsd/sysos.inc	(revision 29091)
+++ rtl/bsd/sysos.inc	(working copy)
@@ -22,7 +22,7 @@
 type libcint=longint;
      plibcint=^libcint;
 
-{$ifdef FreeBSD} // tested on x86
+{$if defined(FreeBSD) or defined(DragonFly)} // tested on x86
 function geterrnolocation: Plibcint; cdecl;external clib name '__error';
 {$else}
 {$ifdef NetBSD} // from a sparc dump.
Index: rtl/fpmake.inc
===================================================================
--- rtl/fpmake.inc	(revision 29091)
+++ rtl/fpmake.inc	(working copy)
@@ -2,7 +2,7 @@
 Const
   GraphDir = 'inc/graph/';
   SysUtilsDir = 'objpas/sysutils/';
-  Unixes = [darwin,freebsd,linux,netbsd,openbsd];
+  Unixes = [darwin,dragonfly,freebsd,linux,netbsd,openbsd];
 
 
 Function CurrentOS : String;
Index: rtl/inc/exeinfo.pp
===================================================================
--- rtl/inc/exeinfo.pp	(revision 29091)
+++ rtl/inc/exeinfo.pp	(working copy)
@@ -109,7 +109,7 @@
                              Executable Loaders
 ****************************************************************************}
 
-{$if defined(freebsd) or defined(netbsd) or defined (openbsd) or defined(linux) or defined(sunos) or defined(android)}
+{$if defined(freebsd) or defined(netbsd) or defined (openbsd) or defined(linux) or defined(sunos) or defined(android) or defined(dragonfly)}
   {$ifdef cpu64}
     {$define ELF64}
   {$else}
Index: rtl/unix/cwstring.pp
===================================================================
--- rtl/unix/cwstring.pp	(revision 29091)
+++ rtl/unix/cwstring.pp	(working copy)
@@ -141,6 +141,12 @@
 {$elseif defined(aix)}
   CODESET = 49;
   LC_ALL = -1;
+{$elseif defined(dragonfly)}
+  CODESET = 0;
+  LC_ALL = 0;
+  __LC_CTYPE = 0;
+  _NL_CTYPE_CLASS = (__LC_CTYPE shl 16);
+  _NL_CTYPE_CODESET_NAME = (_NL_CTYPE_CLASS)+14;
 {$else not aix}
 {$error lookup the value of CODESET in /usr/include/langinfo.h, and the value of LC_ALL in /usr/include/locale.h for your OS }
 // and while doing it, check if iconv is in libc, and if the symbols are prefixed with iconv_ or libiconv_
Index: rtl/unix/dl.pp
===================================================================
--- rtl/unix/dl.pp	(revision 29091)
+++ rtl/unix/dl.pp	(working copy)
@@ -27,7 +27,7 @@
   {$endif}
 {$endif}
 
-{$if defined(linux) or defined(freebsd) or defined(openbsd)}
+{$if defined(linux) or defined(freebsd) or defined(openbsd) or defined(dragonfly)}
   {$define ELF} // ELF symbol versioning.
 {$endif}
 
Index: rtl/unix/initc.pp
===================================================================
--- rtl/unix/initc.pp	(revision 29091)
+++ rtl/unix/initc.pp	(working copy)
@@ -59,7 +59,7 @@
 function geterrnolocation: pcint; cdecl;external clib name '__errno';
 {$endif}
 
-{$ifdef FreeBSD} // tested on x86
+{$if defined(FreeBSD) or defined(DragonFly)} // tested on x86
 function geterrnolocation: pcint; cdecl;external clib name '__error';
 {$endif}
 
Index: utils/fpcm/fpcmake.ini
===================================================================
--- utils/fpcm/fpcmake.ini	(revision 29091)
+++ utils/fpcm/fpcmake.ini	(working copy)
@@ -8,7 +8,7 @@
 #####################################################################
 
 # OS categories
-BSDs = freebsd netbsd openbsd darwin
+BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos
 OSNeedsComspecToRunBatch = go32v2 watcom
@@ -917,6 +917,14 @@
 SHORTSUFFIX=lnx
 endif
 
+# DragonFly BSD
+ifeq ($(OS_TARGET),dragonfly)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=df
+endif
+
 # FreeBSD
 ifeq ($(OS_TARGET),freebsd)
 BATCHEXT=.sh
@@ -1396,7 +1404,7 @@
 endif
 
 # create always pic'ed code on x86_64
-ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),)
+ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),)
 ifeq ($(CPU_TARGET),x86_64)
 override FPCOPT+=-Cg
 endif
Index: utils/fpcm/fpcmmain.pp
===================================================================
--- utils/fpcm/fpcmmain.pp	(revision 29091)
+++ utils/fpcm/fpcmmain.pp	(working copy)
@@ -75,7 +75,7 @@
         o_amiga,o_atari, o_solaris, o_qnx, o_netware, o_openbsd,o_wdosx,
         o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
         o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,o_iphonesim,
-        o_wii,o_aix,o_java,o_android,o_msdos,o_aros
+        o_wii,o_aix,o_java,o_android,o_msdos,o_aros,o_dragonfly
       );
 
       TTargetSet=array[tcpu,tos] of boolean;
@@ -98,7 +98,8 @@
         'amiga','atari','solaris', 'qnx', 'netware','openbsd','wdosx',
         'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
         'win64','wince','gba','nds','embedded','symbian','nativent',
-        'iphonesim', 'wii', 'aix', 'java', 'android', 'msdos', 'aros'
+        'iphonesim', 'wii', 'aix', 'java', 'android', 'msdos', 'aros',
+        'dragonfly'
       );
 
       OSSuffix : array[TOS] of string=(
@@ -106,7 +107,8 @@
         '_amiga','_atari','_solaris', '_qnx', '_netware','_openbsd','_wdosx',
         '_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
         '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',
-        '_iphonesim','_wii','_aix','_java','_android','_msdos','_aros'
+        '_iphonesim','_wii','_aix','_java','_android','_msdos','_aros',
+        '_dragonfly'
       );
 
       { This table is kept OS,Cpu because it is easier to maintain (PFV) }
@@ -147,7 +149,8 @@
         { java }    ( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   true,  false),
         { android } ( true,  false, false, false, false, true,  false, false, false, false, false, true,  false, false,   true,  false),
         { msdos }   ( false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, true),
-        { aros }    ( true,  false, false, false, false, false, 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,   false, false),
+        {dragonfly} ( false, false, false, false, true,  false, false, false, false, false, false, false, false, false,   false, false)
       );
 
     type
