summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorrumko <rumko@pkgsrc.org>2011-02-19 16:06:31 +0000
committerrumko <rumko@pkgsrc.org>2011-02-19 16:06:31 +0000
commitae1e81816c9150c69ebd50580a7c9973ca5e709d (patch)
treec9b7aba291da77fc84dfd1383a27a0d89c38e829 /lang
parentcd17272343a66f74c97b19786899ec14d71b7e1b (diff)
downloadpkgsrc-ae1e81816c9150c69ebd50580a7c9973ca5e709d.tar.gz
lang/g95: bring in DragonFly support
ok@ wiz
Diffstat (limited to 'lang')
-rw-r--r--lang/g95/distinfo10
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config.gcc43
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h124
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly.h94
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h152
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h52
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly12
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread9
-rw-r--r--lang/g95/patches/patch-.._gcc-4.0.3_gcc_ginclude_stddef.h52
9 files changed, 547 insertions, 1 deletions
diff --git a/lang/g95/distinfo b/lang/g95/distinfo
index 23f68d522cb..c1015436ef3 100644
--- a/lang/g95/distinfo
+++ b/lang/g95/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2011/01/23 09:42:10 markd Exp $
+$NetBSD: distinfo,v 1.8 2011/02/19 16:06:31 rumko Exp $
SHA1 (g95-0.92/g95_source.tgz) = e6320fc80d8e388aad1fdbde53b2414353692b76
RMD160 (g95-0.92/g95_source.tgz) = ac00c4cdd6dc0b90ef865040ff338b7f2d9296d1
@@ -6,5 +6,13 @@ Size (g95-0.92/g95_source.tgz) = 1352877 bytes
SHA1 (g95-0.92/gcc-core-4.0.3.tar.gz) = 2694281fa05ae0e39cd871fcc52745e35a2dfefc
RMD160 (g95-0.92/gcc-core-4.0.3.tar.gz) = fd960201a888537ad84e71b72b6b1170ad94eaa0
Size (g95-0.92/gcc-core-4.0.3.tar.gz) = 20137297 bytes
+SHA1 (patch-.._gcc-4.0.3_gcc_config.gcc) = f93cca19dbb3544a1259960a3ab092fd72038125
+SHA1 (patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h) = 2fac90d3b4b2113e4713497fbcf3a3999dde2045
+SHA1 (patch-.._gcc-4.0.3_gcc_config_dragonfly.h) = 12707232e61b664f3b1a9943cbb3a49e61e94fa9
+SHA1 (patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h) = 96fa1faed692f8d4aeade98dd42d25b85ba051d7
+SHA1 (patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h) = b228dbcdf7b5cf22d41d6ff04a37c569ca514c50
+SHA1 (patch-.._gcc-4.0.3_gcc_config_t-dragonfly) = 9636163ffd359b2a0dbb0a7fec2ca1cf98032c3d
+SHA1 (patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread) = a7181b3061e32d3edd38c09eed34232a75de83cf
+SHA1 (patch-.._gcc-4.0.3_gcc_ginclude_stddef.h) = 5e18b132d36ca02dcfed0569297e7ad6b1eada26
SHA1 (patch-ab) = 98cf305aa29487539160736e057dc19313f34a76
SHA1 (patch-ac) = b5567c0d6969f84d2518a581c6517691aa4f5e67
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config.gcc b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config.gcc
new file mode 100644
index 00000000000..09f909b20e3
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config.gcc
@@ -0,0 +1,43 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config.gcc,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- ../gcc-4.0.3/gcc/config.gcc.orig 2011-02-01 19:11:53 +0100
++++ ../gcc-4.0.3/gcc/config.gcc 2011-02-01 21:15:59 +0100
+@@ -440,6 +440,23 @@
+ esac
+ fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h"
+ ;;
++*-*-dragonfly*)
++ gas=yes
++ gnu_ld=yes
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++ tmake_file="t-slibgcc-elf-ver t-dragonfly"
++ case ${enable_threads} in
++ "" | yes | posix)
++ thread_file='posix'
++ tmake_file="${tmake_file} t-dragonfly-thread"
++ ;;
++ *)
++ echo 'Unknown thread configuration for FreeBSD'
++ exit 1
++ ;;
++ esac
++ dfly_tm_file="${dfly_tm_file} dragonfly-spec.h dragonfly.h"
++ ;;
+ *-*-linux*libc1* | *-*-linux*aout*)
+ # Avoid the generic linux case.
+ ;;
+@@ -969,6 +986,12 @@
+ x86_64-*-freebsd*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+ ;;
++i[34567]86-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfly_tm_file} i386/dragonfly.h"
++ ;;
++x86_64-*-dragonfly*)
++ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfly_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h"
++ ;;
+ i[34567]86-*-netbsdelf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ ;;
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h
new file mode 100644
index 00000000000..df503d4f490
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h
@@ -0,0 +1,124 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_dragonfly-spec.h,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-01 20:59:25 +0100
++++ ../gcc-4.0.3/gcc/config/dragonfly-spec.h 2011-02-01 19:58:33 +0100
+@@ -0,0 +1,117 @@
++/* Base configuration file for all DragonFly targets.
++ Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++/* Common DragonFly configuration.
++ All DragonFly architectures should include this file, which will specify
++ their commonalities.
++ Adapted from gcc/config/freebsd.h by
++ David O'Brien <obrien@FreeBSD.org>
++ Loren J. Rittle <ljrittle@acm.org>. */
++
++
++/* In case we need to know. */
++#define USING_CONFIG_DRAGONFLY_SPEC 1
++
++/* This defines which switch letters take arguments. On DragonFly, most of
++ the normal cases (defined in gcc.c) apply, and we also have -h* and
++ -z* options (for the linker) (coming from SVR4).
++ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
++
++#define DFLY_SWITCH_TAKES_ARG(CHAR) \
++ (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
++ || (CHAR) == 'h' \
++ || (CHAR) == 'z' /* ignored by ld */ \
++ || (CHAR) == 'R')
++
++/* This defines which multi-letter switches take arguments. */
++
++#define DFLY_WORD_SWITCH_TAKES_ARG(STR) \
++ (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
++ || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \
++ || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \
++ || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
++
++#define DFLY_TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ builtin_define ("__DragonFly__"); \
++ builtin_define_std ("unix"); \
++ builtin_define ("__KPRINTF_ATTRIBUTE__"); \
++ builtin_assert ("system=unix"); \
++ builtin_assert ("system=bsd"); \
++ builtin_assert ("system=DragonFly"); \
++ DFLY_TARGET_CPU_CPP_BUILTINS(); \
++ } \
++ while (0)
++
++/* Define the default DragonFly-specific per-CPU hook code. */
++#define DFLY_TARGET_CPU_CPP_BUILTINS() do {} while (0)
++
++/* Provide a CPP_SPEC appropriate for DragonFly. We just deal with the GCC
++ option `-posix', and PIC issues. */
++
++#define DFLY_CPP_SPEC " \
++ %(cpp_cpu) \
++ %(cpp_arch) \
++ %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \
++ %{posix:-D_POSIX_SOURCE}"
++
++/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add
++ the magical crtbegin.o file (see crtstuff.c) which provides part
++ of the support for getting C++ file-scope static object constructed
++ before entering `main'. */
++
++#define DFLY_STARTFILE_SPEC \
++ "%{!shared: \
++ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
++ %{!p:%{profile:gcrt1.o%s} \
++ %{!profile:crt1.o%s}}}} \
++ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++
++/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on
++ the magical crtend.o file (see crtstuff.c) which provides part of
++ the support for getting C++ file-scope static object constructed
++ before entering `main', followed by a normal "finalizer" file,
++ `crtn.o'. */
++
++#define DFLY_ENDFILE_SPEC \
++ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++
++/* Provide a LIB_SPEC appropriate for DragonFly. Just select the appropriate
++ libc, depending on whether we're doing profiling or need threads support.
++ (similar to the default, except no -lg, and no -p). */
++
++#ifdef DFLY_NO_THREADS
++#define DFLY_LIB_SPEC " \
++ %{pthread: %eThe -pthread option is only supported on DragonFly when gcc \
++is built with the --enable-threads configure-time option.} \
++ %{!shared: \
++ %{!pg: -lc} \
++ %{pg: -lc_p} \
++ }"
++#else
++#define DFLY_LIB_SPEC " \
++ %{!shared: \
++ %{!pg: %{pthread:-lpthread} -lc} \
++ %{pg: %{pthread:-lpthread_p} -lc_p} \
++ }"
++#endif
++
++#define DFLY_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly.h b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly.h
new file mode 100644
index 00000000000..3359af2b651
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_dragonfly.h
@@ -0,0 +1,94 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_dragonfly.h,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-01 20:59:25 +0100
++++ ../gcc-4.0.3/gcc/config/dragonfly.h 2011-02-01 19:19:27 +0100
+@@ -0,0 +1,87 @@
++/* Base configuration file for all DragonFly targets.
++ Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++/* Common DragonFly configuration.
++ All DragonFly architectures should include this file, which will specify
++ their commonalities.
++ Adapted from gcc/config/i386/freebsd-elf.h by
++ David O'Brien <obrien@FreeBSD.org>.
++ Further work by David O'Brien <obrien@FreeBSD.org> and
++ Loren J. Rittle <ljrittle@acm.org>. */
++
++
++/* In case we need to know. */
++#define USING_CONFIG_DRAGONFLY 1
++
++/* This defines which switch letters take arguments. On DragonFly, most of
++ the normal cases (defined in gcc.c) apply, and we also have -h* and
++ -z* options (for the linker) (coming from SVR4).
++ We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
++
++#undef SWITCH_TAKES_ARG
++#define SWITCH_TAKES_ARG(CHAR) (DFLY_SWITCH_TAKES_ARG(CHAR))
++
++#undef WORD_SWITCH_TAKES_ARG
++#define WORD_SWITCH_TAKES_ARG(STR) (DFLY_WORD_SWITCH_TAKES_ARG(STR))
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() DFLY_TARGET_OS_CPP_BUILTINS()
++
++#undef CPP_SPEC
++#define CPP_SPEC DFLY_CPP_SPEC
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC DFLY_STARTFILE_SPEC
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC DFLY_ENDFILE_SPEC
++
++#undef LIB_SPEC
++#define LIB_SPEC DFLY_LIB_SPEC
++
++
++/************************[ Target stuff ]***********************************/
++
++/* All DragonFly Architectures support the ELF object file format. */
++#undef OBJECT_FORMAT_ELF
++#define OBJECT_FORMAT_ELF
++
++/* Don't assume anything about the header files. */
++#undef NO_IMPLICIT_EXTERN_C
++#define NO_IMPLICIT_EXTERN_C 1
++
++/* Make gcc agree with DragonFly's standard headers (<stddef.h>, etc...) */
++
++#undef WCHAR_TYPE
++#define WCHAR_TYPE "int"
++
++#define MATH_LIBRARY_PROFILE "-lm_p"
++
++/* Code generation parameters. */
++
++/* Use periods rather than dollar signs in special g++ assembler names.
++ This ensures the configuration knows our system correctly so we can link
++ with libraries compiled with the native cc. */
++#undef NO_DOLLAR_IN_LABEL
++
++/* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
++ This enables the test coverage code to use file locking when exiting a
++ program, which avoids race conditions if the program has forked. */
++#define TARGET_HAS_F_SETLKW
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h
new file mode 100644
index 00000000000..24353c801f4
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h
@@ -0,0 +1,152 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_i386_dragonfly.h,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-01 20:59:25 +0100
++++ ../gcc-4.0.3/gcc/config/i386/dragonfly.h 2011-02-01 19:38:39 +0100
+@@ -0,0 +1,145 @@
++/* Definitions for Intel 386 running DragonFly with ELF format
++ Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
++ Contributed by Eric Youngdale.
++ Modified for stabs-in-ELF by H.J. Lu.
++ Adapted from GNU/Linux version by John Polstra.
++ Continued development by David O'Brien <obrien@freebsd.org>
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++
++#define TARGET_VERSION fprintf (stderr, " (i386 DragonFly/ELF)");
++
++/* Override the default comment-starter of "/". */
++#undef ASM_COMMENT_START
++#define ASM_COMMENT_START "#"
++
++#undef ASM_APP_ON
++#define ASM_APP_ON "#APP\n"
++
++#undef ASM_APP_OFF
++#define ASM_APP_OFF "#NO_APP\n"
++
++#undef DBX_REGISTER_NUMBER
++#define DBX_REGISTER_NUMBER(n) \
++ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
++
++#undef NO_PROFILE_COUNTERS
++#define NO_PROFILE_COUNTERS 1
++
++/* Tell final.c that we don't need a label passed to mcount. */
++
++#undef MCOUNT_NAME
++#define MCOUNT_NAME ".mcount"
++
++/* Make gcc agree with <machine/ansi.h>. */
++
++#if 0
++#undef SIZE_TYPE
++#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
++
++#undef PTRDIFF_TYPE
++#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
++
++#undef WCHAR_TYPE_SIZE
++#define WCHAR_TYPE_SIZE (TARGET_64BIT ? 32 : BITS_PER_WORD)
++#endif
++
++#undef SUBTARGET_EXTRA_SPECS /* i386.h bogusly defines it. */
++#define SUBTARGET_EXTRA_SPECS \
++ { "dfly_dynamic_linker", DFLY_DYNAMIC_LINKER }
++
++/* Provide a STARTFILE_SPEC appropriate for DragonFly. Here we add
++ the magical crtbegin.o file (see crtstuff.c) which provides part
++ of the support for getting C++ file-scope static object constructed
++ before entering `main'. */
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ "%{!shared: \
++ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
++ %{!p:%{profile:gcrt1.o%s} \
++ %{!profile:crt1.o%s}}}} \
++ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
++
++/* Provide a ENDFILE_SPEC appropriate for DragonFly. Here we tack on
++ the magical crtend.o file (see crtstuff.c) which provides part of
++ the support for getting C++ file-scope static object constructed
++ before entering `main', followed by a normal "finalizer" file,
++ `crtn.o'. */
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
++
++/* Provide a LINK_SPEC appropriate for DragonFly.
++ Here we provide support for the special GCC options -static and
++ -shared, which allow us to link things in one of these three modes
++ by applying the appropriate combinations of options at link-time.
++ We like to support here for as many of the other GNU linker
++ options as possible. But I don't have the time to search for
++ those flags. I am sure how to add support for -soname
++ shared_object_name. H.J.
++
++ I took out %{v:%{!V:-V}}. It is too much :-(. They can use
++ -Wl,-V.
++
++ When the -shared link option is used a final link is not being
++ done. */
++
++#undef LINK_SPEC
++#define LINK_SPEC "\
++ %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
++ %{Wl,*:%*} \
++ %{v:-V} \
++ %{assert*} %{R*} %{rpath*} %{defsym*} \
++ %{shared:-Bshareable %{h*} %{soname*}} \
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker %(dfly_dynamic_linker) }} \
++ %{static:-Bstatic}} \
++ %{symbolic:-Bsymbolic}"
++
++/* A C statement to output to the stdio stream FILE an assembler
++ command to advance the location counter to a multiple of 1<<LOG
++ bytes if it is within MAX_SKIP bytes.
++
++ This is used to align code labels according to Intel recommendations. */
++
++#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
++#undef ASM_OUTPUT_MAX_SKIP_ALIGN
++#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
++ if ((LOG) != 0) { \
++ if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
++ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
++ }
++#endif
++
++/* Don't default to pcc-struct-return, we want to retain compatibility with
++ older gcc versions AND pcc-struct-return is nonreentrant.
++ (even though the SVR4 ABI for the i386 says that records and unions are
++ returned in memory). */
++
++#undef DEFAULT_PCC_STRUCT_RETURN
++#define DEFAULT_PCC_STRUCT_RETURN 0
++
++/* DragonFly sets the rounding precision of the FPU to 53 bits. Let the
++ compiler get the contents of <float.h> and std::numeric_limits correct. */
++#undef TARGET_96_ROUND_53_LONG_DOUBLE
++#define TARGET_96_ROUND_53_LONG_DOUBLE (!TARGET_64BIT)
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h
new file mode 100644
index 00000000000..f43032221e4
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h
@@ -0,0 +1,52 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_i386_dragonfly64.h,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-01 20:59:25 +0100
++++ ../gcc-4.0.3/gcc/config/i386/dragonfly64.h 2011-02-01 19:38:50 +0100
+@@ -0,0 +1,45 @@
++/* Definitions for AMD x86-64 running DragonFly with ELF format
++ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
++ Contributed by David O'Brien <obrien@FreeBSD.org>
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++
++#undef TARGET_VERSION
++#define TARGET_VERSION fprintf (stderr, " (DragonFly/x86-64 ELF)");
++
++#define SUBTARGET_EXTRA_SPECS \
++ { "dfly_dynamic_linker", DFLY_DYNAMIC_LINKER }
++
++/* Provide a LINK_SPEC appropriate for the DragonFly/x86-64 ELF target.
++ This is a copy of LINK_SPEC from <i386/freebsd.h> tweaked for
++ the x86-64 target. */
++
++#undef LINK_SPEC
++#define LINK_SPEC "\
++ %{m32:-m elf_i386_fbsd} \
++ %{Wl,*:%*} \
++ %{v:-V} \
++ %{assert*} %{R*} %{rpath*} %{defsym*} \
++ %{shared:-Bshareable %{h*} %{soname*}} \
++ %{!shared: \
++ %{!static: \
++ %{rdynamic:-export-dynamic} \
++ %{!dynamic-linker:-dynamic-linker %(dfly_dynamic_linker) }} \
++ %{static:-Bstatic}} \
++ %{symbolic:-Bsymbolic}"
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly
new file mode 100644
index 00000000000..a3c7120d821
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly
@@ -0,0 +1,12 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_t-dragonfly,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-07 10:19:08 +0100
++++ ../gcc-4.0.3/gcc/config/t-dragonfly 2011-02-07 10:22:59 +0100
+@@ -0,0 +1,5 @@
++# Compile crtbeginS.o and crtendS.o with pic.
++CRTSTUFF_T_CFLAGS_S = -fPIC
++
++# Compile libgcc.a with pic.
++TARGET_LIBGCC2_CFLAGS += -fPIC
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread
new file mode 100644
index 00000000000..6f4a44c33f9
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread
@@ -0,0 +1,9 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_config_t-dragonfly-thread,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support.
+
+--- /dev/null 2011-02-07 10:19:08 +0100
++++ ../gcc-4.0.3/gcc/config/t-dragonfly-thread 2011-02-07 10:23:04 +0100
+@@ -0,0 +1,2 @@
++# This is currently needed to compile libgcc2 for threads support
++TARGET_LIBGCC2_CFLAGS += -pthread
diff --git a/lang/g95/patches/patch-.._gcc-4.0.3_gcc_ginclude_stddef.h b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_ginclude_stddef.h
new file mode 100644
index 00000000000..d84545c39c2
--- /dev/null
+++ b/lang/g95/patches/patch-.._gcc-4.0.3_gcc_ginclude_stddef.h
@@ -0,0 +1,52 @@
+$NetBSD: patch-.._gcc-4.0.3_gcc_ginclude_stddef.h,v 1.1 2011/02/19 16:06:31 rumko Exp $
+
+DragonFly BSD support (_PTRDIFF_T_DECLARED is also needed on dfly).
+
+--- ../gcc-4.0.3/gcc/ginclude/stddef.h.orig 2011-02-06 21:30:12 +0100
++++ ../gcc-4.0.3/gcc/ginclude/stddef.h 2011-02-06 21:31:14 +0100
+@@ -62,6 +62,10 @@
+ #include <sys/_types.h>
+ #endif
+
++#if defined(__DragonFly__)
++#include <sys/types.h>
++#endif
++
+ /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
+ defined if the corresponding type is *not* defined.
+ FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
+@@ -131,6 +135,7 @@
+ or if we want this type in particular. */
+ #if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
+ #ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
++#ifndef _PTRDIFF_T_DECLARED
+ #ifndef _T_PTRDIFF_
+ #ifndef _T_PTRDIFF
+ #ifndef __PTRDIFF_T
+@@ -139,6 +144,7 @@
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
+ #define _PTRDIFF_T
++#define _PTRDIFF_T_DECLARED
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+ #define __PTRDIFF_T
+@@ -157,6 +163,7 @@
+ #endif /* __PTRDIFF_T */
+ #endif /* _T_PTRDIFF */
+ #endif /* _T_PTRDIFF_ */
++#endif /* _PTRDIFF_T_DECLARED */
+ #endif /* _PTRDIFF_T */
+
+ /* If this symbol has done its job, get rid of it. */
+@@ -202,8 +209,8 @@
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
+-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+-/* __size_t is a typedef on FreeBSD 5!, must not trash it. */
++#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) || defined(__DragonFly__)
++/* __size_t is a typedef on FreeBSD 5 and on DragonFly BSD!, must not trash it. */
+ #else
+ #define __size_t
+ #endif