Sat Jun 23 22:13:02 2012 UTC ()
lang/gcc47: Add support for DragonFly

GCC47 was marked NOT-FOR-DRAGONFLY, so support has been added.

* DragonFly-specific files added via patch mechanism
* Some existing patches modified to add DragonFly configuration items
* dl_iterate_phdr error handling support added (FreeBSD support was altered,
  NetBSD and OpenBSD support is commented out)
* The java language is taken off as a default option

On the i386 platform, the compiler will build from a full bootstrap, but
one of the later stages fails on x86_64.  It fails to find libstdc++.so.6
even though the previous stage library was built and -B, -L flags point
to it.  The cause of the platform-specific build failure isn't clear --
The workaround is to disable the bootstrap on DragonFly so that the compiler
is built in one stage instead of three.  This workaround could have been
limited to the x86_64-DragonFly platform only, but currently is applied to
i386-DragonFly too.


(marino)
diff -r1.2 -r1.3 pkgsrc/lang/gcc47/Makefile
diff -r1.6 -r1.7 pkgsrc/lang/gcc47/distinfo
diff -r1.6 -r1.7 pkgsrc/lang/gcc47/options.mk
diff -r1.1 -r1.2 pkgsrc/lang/gcc47/patches/patch-configure
diff -r1.2 -r1.3 pkgsrc/lang/gcc47/patches/patch-gcc_config.gcc
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-gcc_config_dragonfly-stdint.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-gcc_config_dragonfly.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-gcc_config_dragonfly.opt
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-gcc_config_i386_dragonfly.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-gcc_configure
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-include_libiberty.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libgcc_config.host
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libgcc_config_i386_dragonfly-unwind.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libgcc_crtstuff.c
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libgcc_unwind-dw2-fde-dip.c
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_locale_dragonfly_c__locale.cc
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_locale_dragonfly_ctype__members.cc
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__base.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__configure__char.cc
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__inline.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_config_os_bsd_dragonfly_os__defines.h
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_configure
diff -r0 -r1.1 pkgsrc/lang/gcc47/patches/patch-libstdc++-v3_configure.host
diff -r1.1.1.1 -r1.2 pkgsrc/lang/gcc47/patches/patch-gcc_ginclude_stddef.h

cvs diff -r1.2 -r1.3 pkgsrc/lang/gcc47/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/Attic/Makefile 2012/06/08 15:42:29 1.2
+++ pkgsrc/lang/gcc47/Attic/Makefile 2012/06/23 22:13:02 1.3
@@ -1,34 +1,34 @@ @@ -1,34 +1,34 @@
1# $NetBSD: Makefile,v 1.2 2012/06/08 15:42:29 joerg Exp $ 1# $NetBSD: Makefile,v 1.3 2012/06/23 22:13:02 marino Exp $
2 2
3GCC_PKGNAME= gcc47 3GCC_PKGNAME= gcc47
4.include "version.mk" 4.include "version.mk"
5 5
6DISTNAME= gcc-${GCC_DIST_VERSION} 6DISTNAME= gcc-${GCC_DIST_VERSION}
7PKGNAME= ${GCC_PKGNAME}-${GCC_DIST_VERSION} 7PKGNAME= ${GCC_PKGNAME}-${GCC_DIST_VERSION}
8PKGREVISION= 1 8PKGREVISION= 2
9CATEGORIES= lang 9CATEGORIES= lang
10MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_DIST_VERSION}/} 10MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_DIST_VERSION}/}
11EXTRACT_SUFX= .tar.bz2 11EXTRACT_SUFX= .tar.bz2
12 12
13MAINTAINER= sbd@NetBSD.org 13MAINTAINER= sbd@NetBSD.org
14HOMEPAGE= http://gcc.gnu.org/ 14HOMEPAGE= http://gcc.gnu.org/
15COMMENT= The GNU Compiler Collection (GCC) - 4.7 Release Series 15COMMENT= The GNU Compiler Collection (GCC) - 4.7 Release Series
16LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3 16LICENSE= gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
17 17
18DISTFILES= ${DEFAULT_DISTFILES} 18DISTFILES= ${DEFAULT_DISTFILES}
19EXTRACT_ONLY= ${DEFAULT_DISTFILES} 19EXTRACT_ONLY= ${DEFAULT_DISTFILES}
20 20
21NOT_FOR_PLATFORM= Interix-*-* DragonFly-*-* 21NOT_FOR_PLATFORM= Interix-*-*
22 22
23USE_TOOLS+= gmake makeinfo sed:run 23USE_TOOLS+= gmake makeinfo sed:run
24 24
25PKG_DESTDIR_SUPPORT= user-destdir 25PKG_DESTDIR_SUPPORT= user-destdir
26 26
27GNU_CONFIGURE= yes 27GNU_CONFIGURE= yes
28## Build outside ${WRKSRC} 28## Build outside ${WRKSRC}
29OBJDIR= ../build 29OBJDIR= ../build
30CONFIGURE_DIRS= ${OBJDIR} 30CONFIGURE_DIRS= ${OBJDIR}
31CONFIGURE_SCRIPT= ../${DISTNAME}/configure 31CONFIGURE_SCRIPT= ../${DISTNAME}/configure
32GCC_SUBPREFIX= ${GCC_PKGNAME} 32GCC_SUBPREFIX= ${GCC_PKGNAME}
33GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX} 33GCC_PREFIX= ${PREFIX}/${GCC_SUBPREFIX}
34GNU_CONFIGURE_PREFIX= ${GCC_PREFIX} 34GNU_CONFIGURE_PREFIX= ${GCC_PREFIX}
@@ -54,26 +54,29 @@ CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LD @@ -54,26 +54,29 @@ CONFIGURE_ENV+= LDFLAGS_FOR_TARGET=${LD
54 54
55CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} 55CONFIGURE_ARGS+= --enable-languages=${LANGS:Q}
56CONFIGURE_ARGS+= --enable-shared 56CONFIGURE_ARGS+= --enable-shared
57CONFIGURE_ARGS+= --enable-long-long 57CONFIGURE_ARGS+= --enable-long-long
58CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} 58CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q}
59CONFIGURE_ARGS+= --enable-libssp 59CONFIGURE_ARGS+= --enable-libssp
60CONFIGURE_ARGS+= --enable-threads=posix 60CONFIGURE_ARGS+= --enable-threads=posix
61CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q} 61CONFIGURE_ARGS+= --with-boot-ldflags=${BOOT_LDFLAGS:Q}
62.if ${OPSYS} == "NetBSD" 62.if ${OPSYS} == "NetBSD"
63CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld 63CONFIGURE_ARGS+= --with-gnu-ld --with-ld=/usr/bin/ld
64CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as 64CONFIGURE_ARGS+= --with-gnu-as --with-as=/usr/bin/as
65MAKE_ENV+= ac_cv_func_clock_gettime=yes 65MAKE_ENV+= ac_cv_func_clock_gettime=yes
66.endif 66.endif
 67.if ${OPSYS} == "DragonFly"
 68CONFIGURE_ARGS+= --disable-bootstrap
 69.endif
67 70
68.include "options.mk" 71.include "options.mk"
69 72
70# ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into 73# ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into
71# a binary so we need to make sure we give it the installed sed and not 74# a binary so we need to make sure we give it the installed sed and not
72# the tool wrapped one. 75# the tool wrapped one.
73MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED} 76MAKE_ENV+= ac_cv_path_SED=${TOOLS_SED}
74MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED} 77MAKE_ENV+= lt_cv_path_SED=${TOOLS_SED}
75 78
76# Determine whether to use binutils 79# Determine whether to use binutils
77.if ${OPSYS} == "SunOS" 80.if ${OPSYS} == "SunOS"
78CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump 81CONFIGURE_ENV+= OBJDUMP=/usr/sfw/bin/gobjdump
79CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld 82CONFIGURE_ARGS+= --without-gnu-ld --with-ld=/usr/ccs/bin/ld

cvs diff -r1.6 -r1.7 pkgsrc/lang/gcc47/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/Attic/distinfo 2012/06/22 03:52:26 1.6
+++ pkgsrc/lang/gcc47/Attic/distinfo 2012/06/23 22:13:02 1.7
@@ -1,21 +1,40 @@ @@ -1,21 +1,40 @@
1$NetBSD: distinfo,v 1.6 2012/06/22 03:52:26 marino Exp $ 1$NetBSD: distinfo,v 1.7 2012/06/23 22:13:02 marino Exp $
2 2
3SHA1 (ecj-4.5.jar) = 58c1d79c64c8cd718550f32a932ccfde8d1e6449 3SHA1 (ecj-4.5.jar) = 58c1d79c64c8cd718550f32a932ccfde8d1e6449
4RMD160 (ecj-4.5.jar) = d3f4da657f086b6423f74e93f001132f4855368a 4RMD160 (ecj-4.5.jar) = d3f4da657f086b6423f74e93f001132f4855368a
5Size (ecj-4.5.jar) = 1470676 bytes 5Size (ecj-4.5.jar) = 1470676 bytes
6SHA1 (gcc-4.7.0.tar.bz2) = 03b8241477a9f8a34f6efe7273d92b9b6dd9fe82 6SHA1 (gcc-4.7.0.tar.bz2) = 03b8241477a9f8a34f6efe7273d92b9b6dd9fe82
7RMD160 (gcc-4.7.0.tar.bz2) = 4ed660b281cdb9bcf98f5c2cf2da105c71db5be4 7RMD160 (gcc-4.7.0.tar.bz2) = 4ed660b281cdb9bcf98f5c2cf2da105c71db5be4
8Size (gcc-4.7.0.tar.bz2) = 82518546 bytes 8Size (gcc-4.7.0.tar.bz2) = 82518546 bytes
9SHA1 (patch-configure) = 3482c45096a3c100c68c1b56947a12197b141292 9SHA1 (patch-configure) = 51c0978c60baddd90ef7e512445fdef913c04e6c
10SHA1 (patch-gcc_Makefile.in) = 2372899a37259c89281e6bd1223e39df9b53a7e3 10SHA1 (patch-gcc_Makefile.in) = 2372899a37259c89281e6bd1223e39df9b53a7e3
11SHA1 (patch-gcc_config.gcc) = 0fd91e83b97886589280d94457a71c0c551e93a3 11SHA1 (patch-gcc_config.gcc) = efa4ecabd71bdec14d5dd1f8bb836116c7a9d6e9
 12SHA1 (patch-gcc_config_dragonfly-stdint.h) = 740dc819b446d5f1476506322c4b280ffdb5a6c0
 13SHA1 (patch-gcc_config_dragonfly.h) = 82f549cdc7543b4bf413a44d481ef42b10f59c82
 14SHA1 (patch-gcc_config_dragonfly.opt) = 92f615c73c2e94664bae5b5935ab8b09bca15f73
 15SHA1 (patch-gcc_config_i386_dragonfly.h) = f2c46d1b6b51316aa774c2453a69ff2571778dbd
12SHA1 (patch-gcc_config_netbsd-stdint.h) = 025fc883101a187e84ed4c0772406720d645d550 16SHA1 (patch-gcc_config_netbsd-stdint.h) = 025fc883101a187e84ed4c0772406720d645d550
 17SHA1 (patch-gcc_configure) = a4b670d0c54c410d38715b7a2a572a7048e3ec5e
13SHA1 (patch-gcc_fortran_f95-lang.c) = 06470dbee79f8c762675d3060a870b7dd9ba38f8 18SHA1 (patch-gcc_fortran_f95-lang.c) = 06470dbee79f8c762675d3060a870b7dd9ba38f8
14SHA1 (patch-gcc_gcc.c) = f23ddf1ad4decd086dd41a70046b4a870a39516f 19SHA1 (patch-gcc_gcc.c) = f23ddf1ad4decd086dd41a70046b4a870a39516f
15SHA1 (patch-gcc_ginclude_stddef.h) = 635e3e7579e9395fa017ac38e8b768d98937a80e 20SHA1 (patch-gcc_ginclude_stddef.h) = 87d7c2ff4400ad0719b2351d2f4c4b05bd257db3
 21SHA1 (patch-include_libiberty.h) = ad2c64e9a14405c89b02ff68811b1c889405d0a1
 22SHA1 (patch-libgcc_config.host) = 6b54e18c6348c4aeb3fda3093fbe990b59456af7
 23SHA1 (patch-libgcc_config_i386_dragonfly-unwind.h) = 9d77252dd982495e90f95b82706bab29e581df9f
 24SHA1 (patch-libgcc_crtstuff.c) = 88500ea895cd683608f8f2b7177149f11947e3b4
 25SHA1 (patch-libgcc_unwind-dw2-fde-dip.c) = 2a0b8c6d2f86d985506578b4e74947d3fb1766a5
16SHA1 (patch-libgfortran_configure) = b3bbc7d9201073a1bed0b7e10141465bab52c8be 26SHA1 (patch-libgfortran_configure) = b3bbc7d9201073a1bed0b7e10141465bab52c8be
17SHA1 (patch-libgo_Makefile.in) = c06e3f0deb9f906d2c158262cffdc3fb7af95602 27SHA1 (patch-libgo_Makefile.in) = c06e3f0deb9f906d2c158262cffdc3fb7af95602
18SHA1 (patch-libjava_boehm.cc) = b18bc9d410a62543583c77e011f50b86f41ca18a 28SHA1 (patch-libjava_boehm.cc) = b18bc9d410a62543583c77e011f50b86f41ca18a
19SHA1 (patch-libjava_configure) = 48ea2baffe87e09dda8133d286bd9b1bfe4c3f8a 29SHA1 (patch-libjava_configure) = 48ea2baffe87e09dda8133d286bd9b1bfe4c3f8a
20SHA1 (patch-libjava_contrib_rebuild-gcj-db.in) = bb01d738fc7db05046ae37e8ade32574de1d8297 30SHA1 (patch-libjava_contrib_rebuild-gcj-db.in) = bb01d738fc7db05046ae37e8ade32574de1d8297
 31SHA1 (patch-libstdc++-v3_config_locale_dragonfly_c__locale.cc) = 5c0ccc6b90e3508b03ed399e8e9e300a6aa9cbb7
 32SHA1 (patch-libstdc++-v3_config_locale_dragonfly_ctype__members.cc) = 876a754c7fcb1c4a362ca7b2655da6cdbb784ccc
 33SHA1 (patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__base.h) = 1c8ee3ea80bd8869222dcb7beb050bf33ff4d3b6
 34SHA1 (patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__configure__char.cc) = d5649f42b61ff3c27d60e813cc844b820525aee4
 35SHA1 (patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__inline.h) = fecd20146d8e0bdebb073c8d64886e36293416fd
 36SHA1 (patch-libstdc++-v3_config_os_bsd_dragonfly_os__defines.h) = 9a45ecb4309c50ca90008b2fc7d3b44d002698b4
 37SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = 94879703659b960c7b61122b4b4173e01cec1afc
 38SHA1 (patch-libstdc++-v3_configure) = 4846c93afac42e4fdd20141234d601517cab7175
 39SHA1 (patch-libstdc++-v3_configure.host) = 7426ea4a9735e5f886f4a3ffb4a9ba62734178c4
21SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = 94879703659b960c7b61122b4b4173e01cec1afc 40SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h) = 94879703659b960c7b61122b4b4173e01cec1afc

cvs diff -r1.6 -r1.7 pkgsrc/lang/gcc47/Attic/options.mk (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/Attic/options.mk 2012/04/30 04:17:39 1.6
+++ pkgsrc/lang/gcc47/Attic/options.mk 2012/06/23 22:13:02 1.7
@@ -1,22 +1,24 @@ @@ -1,22 +1,24 @@
1# $NetBSD: options.mk,v 1.6 2012/04/30 04:17:39 sbd Exp $ 1# $NetBSD: options.mk,v 1.7 2012/06/23 22:13:02 marino Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.${GCC_PKGNAME} 3PKG_OPTIONS_VAR= PKG_OPTIONS.${GCC_PKGNAME}
4PKG_SUPPORTED_OPTIONS= nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java \ 4PKG_SUPPORTED_OPTIONS= nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java \
5 gcc-go gcc-objc gcc-objc++ 5 gcc-go gcc-objc gcc-objc++
6PKG_SUGGESTED_OPTIONS= gcc-c++ gcc-fortran gcc-objc gcc-objc++ 6PKG_SUGGESTED_OPTIONS= gcc-c++ gcc-fortran gcc-objc gcc-objc++
7 7
8.if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux" 8.if ${OPSYS} == "NetBSD" || ${OPSYS} == "Linux"
9PKG_SUGGESTED_OPTIONS+= nls gcc-java 9PKG_SUGGESTED_OPTIONS+= nls gcc-java
 10.elif ${OPSYS} == "DragonFly"
 11PKG_SUGGESTED_OPTIONS+= nls
10.elif ${OPSYS} == "SunOS" 12.elif ${OPSYS} == "SunOS"
11PKG_SUGGESTED_OPTIONS+= gcc-inplace-math 13PKG_SUGGESTED_OPTIONS+= gcc-inplace-math
12.else 14.else
13PKG_SUGGESTED_OPTIONS+= gcc-java 15PKG_SUGGESTED_OPTIONS+= gcc-java
14.endif 16.endif
15 17
16### 18###
17### Determine if multilib is avalible. 19### Determine if multilib is avalible.
18### 20###
19MULTILIB_SUPPORTED?= unknown 21MULTILIB_SUPPORTED?= unknown
20.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) 22.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
21. if exists(/usr/include/gnu/stubs-64.h) && \ 23. if exists(/usr/include/gnu/stubs-64.h) && \
22 !exists(/usr/include/gnu/stubs-32.h) 24 !exists(/usr/include/gnu/stubs-32.h)

cvs diff -r1.1 -r1.2 pkgsrc/lang/gcc47/patches/Attic/patch-configure (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/patches/Attic/patch-configure 2012/05/03 12:20:19 1.1
+++ pkgsrc/lang/gcc47/patches/Attic/patch-configure 2012/06/23 22:13:02 1.2
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: patch-configure,v 1.1 2012/05/03 12:20:19 hans Exp $ 1$NetBSD: patch-configure,v 1.2 2012/06/23 22:13:02 marino Exp $
2 2
3--- configure.orig 2011-03-16 18:27:36.000000000 +0000 3--- configure.orig 2012-02-02 10:20:32.000000000 +0000
4+++ configure 4+++ configure
5@@ -5279,9 +5279,11 @@ if test "x$with_mpfr_lib" != x; then 5@@ -5191,9 +5191,11 @@ if test "x$with_mpfr_lib" != x; then
6 gmplibs="-L$with_mpfr_lib $gmplibs" 6 gmplibs="-L$with_mpfr_lib $gmplibs"
7 fi 7 fi
8 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then 8 if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
9- gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs" 9- gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
10- gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc" 10- gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
11- extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir" 11- extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
12+ sdir= 12+ sdir=
13+ test -d "${srcdir}/mpfr/src" && sdir=/src 13+ test -d "${srcdir}/mpfr/src" && sdir=/src
14+ gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir $gmplibs" 14+ gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir $gmplibs"
15+ gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr'"$sdir "'-I$$s/mpfr'"$sdir $gmpinc" 15+ gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr'"$sdir "'-I$$s/mpfr'"$sdir $gmpinc"
16+ extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr'"$sdir "'--with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir" 16+ extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr'"$sdir "'--with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir"
17 # Do not test the mpfr version. Assume that it is sufficient, since 17 # Do not test the mpfr version. Assume that it is sufficient, since
18 # it is in the source tree, and the library has not been built yet 18 # it is in the source tree, and the library has not been built yet

cvs diff -r1.2 -r1.3 pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config.gcc (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config.gcc 2012/04/17 04:11:12 1.2
+++ pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config.gcc 2012/06/23 22:13:02 1.3
@@ -1,33 +1,85 @@ @@ -1,33 +1,85 @@
1$NetBSD: patch-gcc_config.gcc,v 1.2 2012/04/17 04:11:12 sbd Exp $ 1$NetBSD: patch-gcc_config.gcc,v 1.3 2012/06/23 22:13:02 marino Exp $
2 2
3* Add t-crtstuff to tmake_file on NetBSD. 3* Add t-crtstuff to tmake_file on NetBSD.
4* Add netbsd-stdint.h to tm_file on NetBSD. 4* Add netbsd-stdint.h to tm_file on NetBSD.
5* wrap the system stdint.h on NetBSD. 5* wrap the system stdint.h on NetBSD.
 6* Add DragonFly support.
6 7
7--- gcc/config.gcc.orig 2012-03-05 10:43:22.000000000 +0000 8--- gcc/config.gcc.orig 2012-03-05 10:43:22.000000000 +0000
8+++ gcc/config.gcc 9+++ gcc/config.gcc
9@@ -644,6 +644,7 @@ case ${target} in 10@@ -589,6 +589,26 @@ case ${target} in
 11 # need_64bit_hwint=yes # system compiler has this for all arch!
 12 use_gcc_stdint=wrap
 13 ;;
 14+*-*-dragonfly*)
 15+ gas=yes
 16+ gnu_ld=yes
 17+ tmake_file="t-slibgcc"
 18+ case ${enable_threads} in
 19+ "" | yes | posix)
 20+ thread_file='posix'
 21+ ;;
 22+ no | gnat | single)
 23+ # Let these non-posix thread selections fall through if requested
 24+ ;;
 25+ *)
 26+ echo 'Unknown thread configuration for DragonFly BSD'
 27+ exit 1
 28+ ;;
 29+ esac
 30+ extra_options="$extra_options rpath.opt dragonfly.opt"
 31+ default_use_cxa_atexit=yes
 32+ use_gcc_stdint=wrap
 33+ ;;
 34 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
 35 extra_options="$extra_options gnu-user.opt"
 36 gas=yes
 37@@ -644,6 +664,7 @@ case ${target} in
10 esac 38 esac
11 ;; 39 ;;
12 *-*-netbsd*) 40 *-*-netbsd*)
13+ use_gcc_stdint=wrap 41+ use_gcc_stdint=wrap
14 tmake_file="t-slibgcc" 42 tmake_file="t-slibgcc"
15 gas=yes 43 gas=yes
16 gnu_ld=yes 44 gnu_ld=yes
17@@ -1203,12 +1204,14 @@ x86_64-*-freebsd*) 45@@ -1196,6 +1217,14 @@ i[34567]86-*-elf*)
 46 x86_64-*-elf*)
 47 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
 48 ;;
 49+i[34567]86-*-dragonfly*)
 50+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
 51+ tmake_file="${tmake_file} i386/t-crtstuff"
 52+ ;;
 53+x86_64-*-dragonfly*)
 54+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
 55+ tmake_file="${tmake_file} i386/t-crtstuff"
 56+ ;;
 57 i[34567]86-*-freebsd*)
 58 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
 59 ;;
 60@@ -1203,12 +1232,14 @@ x86_64-*-freebsd*)
18 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" 61 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"
19 ;; 62 ;;
20 i[34567]86-*-netbsdelf*) 63 i[34567]86-*-netbsdelf*)
21- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" 64- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
22+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h" 65+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h netbsd-stdint.h"
23 extra_options="${extra_options} netbsd.opt netbsd-elf.opt" 66 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
24+ tmake_file="${tmake_file} i386/t-crtstuff" 67+ tmake_file="${tmake_file} i386/t-crtstuff"
25 ;; 68 ;;
26 x86_64-*-netbsd*) 69 x86_64-*-netbsd*)
27- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" 70- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
28+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h netbsd-stdint.h" 71+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h netbsd-stdint.h"
29 extra_options="${extra_options} netbsd.opt netbsd-elf.opt" 72 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
30+ tmake_file="${tmake_file} i386/t-crtstuff" 73+ tmake_file="${tmake_file} i386/t-crtstuff"
31 ;; 74 ;;
32 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) 75 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
33 tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h" 76 tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
 77@@ -3518,6 +3549,8 @@ case ${target} in
 78 ;;
 79 i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
 80 ;;
 81+ i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
 82+ ;;
 83 i[34567]86-*-freebsd* | x86_64-*-freebsd*)
 84 ;;
 85 ia64*-*-linux*)

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config_dragonfly-stdint.h
$NetBSD: patch-gcc_config_dragonfly-stdint.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- gcc/config/dragonfly-stdint.h.orig	2012-06-22 10:35:29.000000000 +0000
+++ gcc/config/dragonfly-stdint.h
@@ -0,0 +1,56 @@
+/* Definitions for <stdint.h> types for DragonFly systems.
+   Copyright (C) 2009 Free Software Foundation, Inc.
+   Contributed by Gerald Pfeifer <gerald@pfeifer.com>.
+
+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 3, 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+#define SIG_ATOMIC_TYPE   "int"
+
+#define INT8_TYPE         "signed char"
+#define INT16_TYPE        "short int"
+#define INT32_TYPE        "int"
+#define INT64_TYPE        (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
+#define UINT8_TYPE        "unsigned char"
+#define UINT16_TYPE       "short unsigned int"
+#define UINT32_TYPE       "unsigned int"
+#define UINT64_TYPE       (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
+
+#define INT_LEAST8_TYPE   INT8_TYPE
+#define INT_LEAST16_TYPE  INT16_TYPE
+#define INT_LEAST32_TYPE  INT32_TYPE
+#define INT_LEAST64_TYPE  INT64_TYPE
+#define UINT_LEAST8_TYPE  UINT8_TYPE
+#define UINT_LEAST16_TYPE UINT16_TYPE
+#define UINT_LEAST32_TYPE UINT32_TYPE
+#define UINT_LEAST64_TYPE UINT64_TYPE
+
+#define INT_FAST8_TYPE    INT32_TYPE
+#define INT_FAST16_TYPE   INT32_TYPE
+#define INT_FAST32_TYPE   INT32_TYPE
+#define INT_FAST64_TYPE   INT64_TYPE
+#define UINT_FAST8_TYPE   UINT32_TYPE
+#define UINT_FAST16_TYPE  UINT32_TYPE
+#define UINT_FAST32_TYPE  UINT32_TYPE
+#define UINT_FAST64_TYPE  UINT64_TYPE
+
+#define INTPTR_TYPE       (LONG_TYPE_SIZE == 64 ?  INT64_TYPE :  INT32_TYPE)
+#define UINTPTR_TYPE      (LONG_TYPE_SIZE == 64 ? UINT64_TYPE : UINT32_TYPE)

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config_dragonfly.h
$NetBSD: patch-gcc_config_dragonfly.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- gcc/config/dragonfly.h.orig	2012-06-22 10:35:29.000000000 +0000
+++ gcc/config/dragonfly.h
@@ -0,0 +1,135 @@
+/* Base configuration file for all DragonFly targets.
+   Copyright (C) 1999, 2000, 2001, 2007, 2008 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 3, 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 COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+/* 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>.  */
+
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()            \
+  do                                        \
+    {                                       \
+       builtin_define_std ("unix");         \
+       builtin_define ("__DragonFly__");    \
+       builtin_assert ("system=unix");      \
+       builtin_assert ("system=bsd");       \
+       builtin_assert ("system=DragonFly"); \
+    }                                       \
+  while (0)
+
+#undef  CPP_SPEC
+#define CPP_SPEC \
+ "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC	\
+  "%{!shared: \
+     %{pg:gcrt1.o%s} \
+     %{!pg: \
+       %{p:gcrt1.o%s} \
+       %{!p: \
+         %{profile: gcrt1.o%s} \
+         %{!profile: \
+           %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
+   crti.o%s \
+   %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+#undef  LIB_SPEC
+#define LIB_SPEC \
+  "%{pthread:-lpthread} -lc"
+
+#if defined(HAVE_LD_EH_FRAME_HDR)
+#define LINK_EH_SPEC "--eh-frame-hdr"
+#endif
+
+/* 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.
+
+   When the -shared link option is used a final link is not being
+   done.  */
+
+#define DFBSD_LINK_SPEC \
+ "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
+  %{v:-V} \
+  %{assert*} %{R*} %{rpath*} %{defsym*} \
+  %{shared:-Bshareable %{h*} %{soname*}} \
+  %{!shared: \
+   %{!static: \
+    %{rdynamic:-export-dynamic} \
+    -dynamic-linker %(dfbsd_dynamic_linker) \
+   } \
+  %{static:-Bstatic}} \
+  %{!static:--hash-style=both} \
+  %{symbolic:-Bsymbolic}"
+
+#undef  LINK_SPEC
+#define LINK_SPEC DFBSD_LINK_SPEC
+
+#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
+
+
+/* Use --as-needed -lgcc_s for eh support.  */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
+/************************[  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
+
+/* Follow DragonFly's standard headers (<machine/stdint.h>, etc...).  */
+
+#undef  WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef  WINT_TYPE
+#define WINT_TYPE "int"
+
+/* 
+ * Profile libraries are found at /usr/lib/profile with standard names
+ * #define MATH_LIBRARY_PROFILE    "m_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_POSIX_IO

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config_dragonfly.opt
$NetBSD: patch-gcc_config_dragonfly.opt,v 1.1 2012/06/23 22:13:02 marino Exp $

--- gcc/config/dragonfly.opt.orig	2012-06-22 10:35:29.000000000 +0000
+++ gcc/config/dragonfly.opt
@@ -0,0 +1,65 @@
+; DragonFlyBSD options.
+
+; Copyright (C) 2010, 2011
+; 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 3, 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 COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+assert
+Driver Separate
+
+assert=
+Driver JoinedOrMissing
+
+defsym
+Driver Separate
+
+defsym=
+Driver JoinedOrMissing
+
+posix
+Driver
+
+profile
+Driver
+
+pthread
+Driver
+
+rdynamic
+Driver
+
+rpath-link
+Driver Separate
+
+rpath-link=
+Driver JoinedOrMissing
+
+rpath=
+Driver JoinedOrMissing
+
+soname
+Driver Separate
+
+soname=
+Driver JoinedOrMissing
+
+; This comment is to ensure we retain the blank line above.

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-gcc_config_i386_dragonfly.h
$NetBSD: patch-gcc_config_i386_dragonfly.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- gcc/config/i386/dragonfly.h.orig	2012-06-22 10:35:29.000000000 +0000
+++ gcc/config/i386/dragonfly.h
@@ -0,0 +1,101 @@
+/* Definitions for Intel 386 running DragonFly with ELF format
+   Copyright (C) 1996, 2000, 2002, 2004, 2007 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 3, 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 COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+
+/* 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>.  */
+
+#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)
+
+#undef  SUBTARGET_EXTRA_SPECS	/* i386.h bogusly defines it.  */
+#define SUBTARGET_EXTRA_SPECS \
+  { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
+
+
+/* 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, but GNAT
+   resets it to full precision.  */
+#undef TARGET_96_ROUND_53_LONG_DOUBLE
+#define TARGET_96_ROUND_53_LONG_DOUBLE 0
+
+/* Put all *tf routines in libgcc.  */
+#undef LIBGCC2_HAS_TF_MODE
+#define LIBGCC2_HAS_TF_MODE 1
+#define LIBGCC2_TF_CEXT q
+#define TF_SIZE 113
+
+/* Static stack checking is supported by means of probes.  */
+#define STACK_CHECK_STATIC_BUILTIN 1
+
+/* Support for i386 has been removed from DragonFly for several releases  */
+#define SUBTARGET32_DEFAULT_CPU "i486"

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-gcc_configure
$NetBSD: patch-gcc_configure,v 1.1 2012/06/23 22:13:02 marino Exp $

Add dl_iterate_phdr detection for FreeBSD and DragonFly.
Detection for NetBSD and OpenBSD is added but commented out in case this
error handling mechanism is activated for these platforms later.

--- gcc/configure.orig	2012-03-08 13:54:54.000000000 +0000
+++ gcc/configure
@@ -26802,6 +26802,20 @@ case "$target" in
       gcc_cv_target_dl_iterate_phdr=no
     fi
     ;;
+  *-*-dragonfly* | *-*-freebsd*)
+  if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then
+      gcc_cv_target_dl_iterate_phdr=yes
+    else
+      gcc_cv_target_dl_iterate_phdr=no
+    fi
+  ;;
+# *-*-netbsd* | *-*-openbsd*)
+# if grep dl_iterate_phdr $target_header_dir/link_elf.h > /dev/null 2>&1; then
+#     gcc_cv_target_dl_iterate_phdr=yes
+#   else
+#     gcc_cv_target_dl_iterate_phdr=no
+#   fi
+# ;;
 esac
 
 if test x$gcc_cv_target_dl_iterate_phdr = xyes; then

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-include_libiberty.h
$NetBSD: patch-include_libiberty.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- include/libiberty.h.orig	2011-09-28 19:04:30.000000000 +0000
+++ include/libiberty.h
@@ -106,7 +106,16 @@ extern int countargv (char**);
    to find the declaration so provide a fully prototyped one.  If it
    is 1, we found it so don't provide any declaration at all.  */
 #if !HAVE_DECL_BASENAME
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
+#if defined (__GNU_LIBRARY__ ) \
+ || defined (__linux__) \
+ || defined (__DragonFly__) \
+ || defined (__FreeBSD__) \
+ || defined (__OpenBSD__) \
+ || defined (__NetBSD__) \
+ || defined (__CYGWIN__) \
+ || defined (__CYGWIN32__) \
+ || defined (__MINGW32__) \
+ || defined (HAVE_DECL_BASENAME)
 extern char *basename (const char *);
 #else
 /* Do not allow basename to be used if there is no prototype seen.  We

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libgcc_config.host
$NetBSD: patch-libgcc_config.host,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libgcc/config.host.orig	2012-02-20 21:19:55.000000000 +0000
+++ libgcc/config.host
@@ -174,6 +174,11 @@ case ${host} in
   tmake_file="$tmake_file t-darwin ${cpu_type}/t-darwin t-libgcc-pic t-slibgcc-darwin"
   extra_parts="crt3.o crttms.o crttme.o"
   ;;
+*-*-dragonfly*)
+  tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
+  tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+  ;;
 *-*-freebsd*)
   # This is the generic ELF configuration of FreeBSD.  Later
   # machine-specific sections may refine and add to this
@@ -267,6 +272,7 @@ esac
 
 case ${host} in
 *-*-darwin* | *-*-freebsd* | *-*-netbsd* | *-*-openbsd* | *-*-solaris2* | \
+  *-*-dragonfly* | \
   alpha*-dec-osf5.1*)
   enable_execute_stack=enable-execute-stack-mprotect.c
   ;;
@@ -523,6 +529,14 @@ i[34567]86-*-elf*)
 x86_64-*-elf*)
 	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
 	;;
+i[34567]86-*-dragonfly*)
+	tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff"
+	md_unwind_header=i386/dragonfly-unwind.h
+	;;
+x86_64-*-dragonfly*)
+	tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff"
+	md_unwind_header=i386/dragonfly-unwind.h
+	;;
 i[34567]86-*-freebsd*)
 	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
 	;;
@@ -1156,6 +1170,7 @@ i[34567]86-*-darwin* | x86_64-*-darwin*
   i[34567]86-*-gnu* | \
   i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \
   i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \
+  i[34567]86-*-dragonfly* | x86_64-*-dragonfly* | \
   i[34567]86-*-freebsd* | x86_64-*-freebsd*)
   	tmake_file="${tmake_file} t-softfp-tf"
 	if test "${host_address}" = 32; then

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libgcc_config_i386_dragonfly-unwind.h
$NetBSD: patch-libgcc_config_i386_dragonfly-unwind.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libgcc/config/i386/dragonfly-unwind.h.orig	2012-06-22 10:35:29.000000000 +0000
+++ libgcc/config/i386/dragonfly-unwind.h
@@ -0,0 +1,158 @@
+/* DWARF2 EH unwinding support for DragonFly BSD: AMD x86-64 and x86.
+   Copyright (C) 2010 John Marino <draco@marino.st> */
+
+/* Do code reading to identify a signal frame, and set the frame
+   state data appropriately.  See unwind-dw2.c for the structs. */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+#include <machine/sigframe.h>
+
+
+#define REG_NAME(reg)	sf_uc.uc_mcontext.mc_## reg
+
+#ifdef __x86_64__
+#define MD_FALLBACK_FRAME_STATE_FOR x86_64_dragonfly_fallback_frame_state
+
+
+static void
+x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
+{
+  unsigned long ps_strings;
+  int mib[2];
+  size_t len;
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PS_STRINGS;
+  len = sizeof (ps_strings);
+  sysctl (mib, 2, &ps_strings, &len, NULL, 0);
+
+  *start = (unsigned char *)ps_strings - 32;
+  *end   = (unsigned char *)ps_strings;
+}
+
+
+static _Unwind_Reason_Code
+x86_64_dragonfly_fallback_frame_state
+(struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+  unsigned char *pc = context->ra;
+  unsigned char *sigtramp_start, *sigtramp_end;
+  struct sigframe *sf;
+  long new_cfa;
+
+  x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
+  if (pc >= sigtramp_end || pc < sigtramp_start)
+    return _URC_END_OF_STACK;
+
+  sf = (struct sigframe *) context->cfa;
+  new_cfa = sf->REG_NAME(rsp);
+  fs->regs.cfa_how = CFA_REG_OFFSET;
+  /* Register 7 is rsp  */
+  fs->regs.cfa_reg = 7;
+  fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+
+  /* The SVR4 register numbering macros aren't usable in libgcc.  */
+  fs->regs.reg[0].how = REG_SAVED_OFFSET;
+  fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(rax) - new_cfa;
+  fs->regs.reg[1].how = REG_SAVED_OFFSET;
+  fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(rdx) - new_cfa;
+  fs->regs.reg[2].how = REG_SAVED_OFFSET;
+  fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(rcx) - new_cfa;
+  fs->regs.reg[3].how = REG_SAVED_OFFSET;
+  fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(rbx) - new_cfa;
+  fs->regs.reg[4].how = REG_SAVED_OFFSET;
+  fs->regs.reg[4].loc.offset = (long)&sf->REG_NAME(rsi) - new_cfa;
+  fs->regs.reg[5].how = REG_SAVED_OFFSET;
+  fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(rdi) - new_cfa;
+  fs->regs.reg[6].how = REG_SAVED_OFFSET;
+  fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(rbp) - new_cfa;
+  fs->regs.reg[8].how = REG_SAVED_OFFSET;
+  fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(r8) - new_cfa;
+  fs->regs.reg[9].how = REG_SAVED_OFFSET;
+  fs->regs.reg[9].loc.offset = (long)&sf->REG_NAME(r9) - new_cfa;
+  fs->regs.reg[10].how = REG_SAVED_OFFSET;
+  fs->regs.reg[10].loc.offset = (long)&sf->REG_NAME(r10) - new_cfa;
+  fs->regs.reg[11].how = REG_SAVED_OFFSET;
+  fs->regs.reg[11].loc.offset = (long)&sf->REG_NAME(r11) - new_cfa;
+  fs->regs.reg[12].how = REG_SAVED_OFFSET;
+  fs->regs.reg[12].loc.offset = (long)&sf->REG_NAME(r12) - new_cfa;
+  fs->regs.reg[13].how = REG_SAVED_OFFSET;
+  fs->regs.reg[13].loc.offset = (long)&sf->REG_NAME(r13) - new_cfa;
+  fs->regs.reg[14].how = REG_SAVED_OFFSET;
+  fs->regs.reg[14].loc.offset = (long)&sf->REG_NAME(r14) - new_cfa;
+  fs->regs.reg[15].how = REG_SAVED_OFFSET;
+  fs->regs.reg[15].loc.offset = (long)&sf->REG_NAME(r15) - new_cfa;
+  fs->regs.reg[16].how = REG_SAVED_OFFSET;
+  fs->regs.reg[16].loc.offset = (long)&sf->REG_NAME(rip) - new_cfa;
+  fs->retaddr_column = 16;
+  fs->signal_frame = 1;
+  return _URC_NO_REASON;
+}
+
+#else /* Next section is for i386  */
+
+#define MD_FALLBACK_FRAME_STATE_FOR x86_dragonfly_fallback_frame_state
+
+
+static void
+x86_sigtramp_range (unsigned char **start, unsigned char **end)
+{
+  unsigned long ps_strings;
+  int mib[2];
+  size_t len;
+
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PS_STRINGS;
+  len = sizeof (ps_strings);
+  sysctl (mib, 2, &ps_strings, &len, NULL, 0);
+
+  *start = (unsigned char *)ps_strings - 128;
+  *end   = (unsigned char *)ps_strings;
+}
+
+
+static _Unwind_Reason_Code
+x86_dragonfly_fallback_frame_state
+(struct _Unwind_Context *context, _Unwind_FrameState *fs)
+{
+  unsigned char *pc = context->ra;
+  unsigned char *sigtramp_start, *sigtramp_end;
+  struct sigframe *sf;
+  long new_cfa;
+
+  x86_sigtramp_range(&sigtramp_start, &sigtramp_end);
+
+  if (pc >= sigtramp_end || pc < sigtramp_start)
+    return _URC_END_OF_STACK;
+
+  sf = (struct sigframe *) context->cfa;
+  new_cfa = sf->REG_NAME(esp);
+  fs->regs.cfa_how = CFA_REG_OFFSET;
+  fs->regs.cfa_reg = 4;
+  fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+
+  /* The SVR4 register numbering macros aren't usable in libgcc.  */
+  fs->regs.reg[0].how = REG_SAVED_OFFSET;
+  fs->regs.reg[0].loc.offset = (long)&sf->REG_NAME(eax) - new_cfa;
+  fs->regs.reg[3].how = REG_SAVED_OFFSET;
+  fs->regs.reg[3].loc.offset = (long)&sf->REG_NAME(ebx) - new_cfa;
+  fs->regs.reg[1].how = REG_SAVED_OFFSET;
+  fs->regs.reg[1].loc.offset = (long)&sf->REG_NAME(ecx) - new_cfa;
+  fs->regs.reg[2].how = REG_SAVED_OFFSET;
+  fs->regs.reg[2].loc.offset = (long)&sf->REG_NAME(edx) - new_cfa;
+  fs->regs.reg[6].how = REG_SAVED_OFFSET;
+  fs->regs.reg[6].loc.offset = (long)&sf->REG_NAME(esi) - new_cfa;
+  fs->regs.reg[7].how = REG_SAVED_OFFSET;
+  fs->regs.reg[7].loc.offset = (long)&sf->REG_NAME(edi) - new_cfa;
+  fs->regs.reg[5].how = REG_SAVED_OFFSET;
+  fs->regs.reg[5].loc.offset = (long)&sf->REG_NAME(ebp) - new_cfa;
+  fs->regs.reg[8].how = REG_SAVED_OFFSET;
+  fs->regs.reg[8].loc.offset = (long)&sf->REG_NAME(eip) - new_cfa;
+  fs->retaddr_column = 8;
+  fs->signal_frame = 1;
+  return _URC_NO_REASON;
+}
+#endif /* ifdef __x86_64__  */

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libgcc_crtstuff.c
$NetBSD: patch-libgcc_crtstuff.c,v 1.1 2012/06/23 22:13:02 marino Exp $

Currently dl_iterate_phdr error handling is hardcoded for FreeBSD 7+
Expand code to handle all BSDs even though detection is only active for
FreeBSD and DragonFly currently.

--- libgcc/crtstuff.c.orig	2011-12-06 21:35:41.000000000 +0000
+++ libgcc/crtstuff.c
@@ -81,11 +81,19 @@ call_ ## FUNC (void)					\
 }
 #endif
 
+#if defined(TARGET_DL_ITERATE_PHDR) && \
+   ( defined(__FreeBSD__)              \
+  || defined(__OpenBSD__)              \
+  || defined(__NetBSD__)               \
+  || defined(__DragonFly__))
+#define BSD_DL_ITERATE_PHDR_AVAILABLE
+#endif
+
 #if defined(OBJECT_FORMAT_ELF) \
     && !defined(OBJECT_FORMAT_FLAT) \
     && defined(HAVE_LD_EH_FRAME_HDR) \
     && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
-    && defined(__FreeBSD__) && __FreeBSD__ >= 7
+    && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
 #include <link.h>
 # define USE_PT_GNU_EH_FRAME
 #endif

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libgcc_unwind-dw2-fde-dip.c
$NetBSD: patch-libgcc_unwind-dw2-fde-dip.c,v 1.1 2012/06/23 22:13:02 marino Exp $

Add dl_iterate_phdr error handling support for all BSDs.  The NetBSD and
OpenBSD code will not run until dl_iterate_phdr detection in the configure
script is uncommented.

--- libgcc/unwind-dw2-fde-dip.c.orig	2011-11-02 15:26:35.000000000 +0000
+++ libgcc/unwind-dw2-fde-dip.c
@@ -54,11 +54,19 @@
 #endif
 
 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-    && defined(__FreeBSD__) && __FreeBSD__ >= 7
+    && defined(TARGET_DL_ITERATE_PHDR) \
+    && (defined(__FreeBSD__) || defined(__DragonFly__))
 # define ElfW __ElfN
 # define USE_PT_GNU_EH_FRAME
 #endif
 
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+    && defined(TARGET_DL_ITERATE_PHDR) \
+    && (defined(__OpenBSD__) || defined(__NetBSD__))
+# define ElfW(n) Elf_##n
+# define USE_PT_GNU_EH_FRAME
+#endif
+
 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
     && defined(TARGET_DL_ITERATE_PHDR) \
     && defined(__sun__) && defined(__svr4__)

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_locale_dragonfly_c__locale.cc
$NetBSD: patch-libstdc++-v3_config_locale_dragonfly_c__locale.cc,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/locale/dragonfly/c_locale.cc.orig	2012-06-22 10:35:30.000000000 +0000
+++ libstdc++-v3/config/locale/dragonfly/c_locale.cc
@@ -0,0 +1,300 @@
+// Wrapper for underlying C-language localization -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.8  Standard locale categories.
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#include <cerrno>  // For errno
+#include <cmath>  // For isinf, finite, finitef, fabs
+#include <cstdlib>  // For strof, strtold
+#include <cstring>
+#include <cstdio>
+#include <locale>
+#include <limits>
+
+#ifdef _GLIBCXX_HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  template<>
+    void
+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+		   const __c_locale&) throw()
+    {
+      // Assumes __s formatted for "C" locale.
+      char* __old = setlocale(LC_ALL, 0);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
+      setlocale(LC_ALL, "C");
+      char* __sanity;
+      bool __overflow = false;
+
+#if !__FLT_HAS_INFINITY__
+      errno = 0;
+#endif
+
+#ifdef _GLIBCXX_HAVE_STRTOF
+      __v = strtof(__s, &__sanity);
+#else
+      double __d = strtod(__s, &__sanity);
+      __v = static_cast<float>(__d);
+#ifdef _GLIBCXX_HAVE_FINITEF
+      if (!finitef (__v))
+	__overflow = true;
+#elif defined (_GLIBCXX_HAVE_FINITE)
+      if (!finite (static_cast<double> (__v)))
+	__overflow = true;
+#elif defined (_GLIBCXX_HAVE_ISINF)
+      if (isinf (static_cast<double> (__v)))
+	__overflow = true;
+#else
+      if (fabs(__d) > numeric_limits<float>::max())
+	__overflow = true;
+#endif
+#endif // _GLIBCXX_HAVE_STRTOF
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 23. Num_get overflow result.
+      if (__sanity == __s || *__sanity != '\0')
+	{
+	  __v = 0.0f;
+	  __err = ios_base::failbit;
+	}
+      else if (__overflow
+#if __FLT_HAS_INFINITY__
+	       || __v == numeric_limits<float>::infinity()
+	       || __v == -numeric_limits<float>::infinity()
+#else
+	       || ((__v > 1.0f || __v < -1.0f) && errno == ERANGE)
+#endif
+	      )
+	{
+	  if (__v > 0.0f)
+	    __v = numeric_limits<float>::max();
+	  else
+	    __v = -numeric_limits<float>::max();
+	  __err = ios_base::failbit;
+	}
+
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
+    }
+
+  template<>
+    void
+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+		   const __c_locale&) throw()
+    {
+      // Assumes __s formatted for "C" locale.
+      char* __old = setlocale(LC_ALL, 0);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
+      setlocale(LC_ALL, "C");
+      char* __sanity;
+
+#if !__DBL_HAS_INFINITY__
+      errno = 0;
+#endif
+
+      __v = strtod(__s, &__sanity);
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 23. Num_get overflow result.
+      if (__sanity == __s || *__sanity != '\0')
+	{
+	  __v = 0.0;
+	  __err = ios_base::failbit;
+	}
+      else if (
+#if __DBL_HAS_INFINITY__
+	       __v == numeric_limits<double>::infinity()
+	       || __v == -numeric_limits<double>::infinity())
+#else
+	       (__v > 1.0 || __v < -1.0) && errno == ERANGE)
+#endif
+	{
+	  if (__v > 0.0)
+	    __v = numeric_limits<double>::max();
+	  else
+	    __v = -numeric_limits<double>::max();
+	  __err = ios_base::failbit;
+	}
+
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
+    }
+
+  template<>
+    void
+    __convert_to_v(const char* __s, long double& __v,
+		   ios_base::iostate& __err, const __c_locale&) throw()
+    {
+      // Assumes __s formatted for "C" locale.
+      char* __old = setlocale(LC_ALL, 0);
+      const size_t __len = strlen(__old) + 1;
+      char* __sav = new char[__len];
+      memcpy(__sav, __old, __len);
+      setlocale(LC_ALL, "C");
+
+#if !__LDBL_HAS_INFINITY__
+      errno = 0;
+#endif
+
+#if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
+      char* __sanity;
+      __v = strtold(__s, &__sanity);
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 23. Num_get overflow result.
+      if (__sanity == __s || *__sanity != '\0')
+#else
+      typedef char_traits<char>::int_type int_type;
+      int __p = sscanf(__s, "%Lf", &__v);
+
+      if (!__p || static_cast<int_type>(__p) == char_traits<char>::eof())
+#endif
+	{
+	  __v = 0.0l;
+	  __err = ios_base::failbit;
+	}
+       else if (
+#if __LDBL_HAS_INFINITY__
+		__v == numeric_limits<long double>::infinity()
+		|| __v == -numeric_limits<long double>::infinity())
+#else
+		(__v > 1.0l || __v < -1.0l) && errno == ERANGE)
+#endif
+	{
+	  if (__v > 0.0l)
+	    __v = numeric_limits<long double>::max();
+	  else
+	    __v = -numeric_limits<long double>::max();
+	  __err = ios_base::failbit;
+	}
+
+      setlocale(LC_ALL, __sav);
+      delete [] __sav;
+    }
+
+
+  /*  DragonFly's implementation of setlocale won't accept something like
+      "de_DE".  According to nls manpage, the expected format is:
+      language[_territory][.codeset][@modifier], but it seems that both
+      the _territory and .codeset components are required.
+      
+      As an attempt to correct for this, we'll tack on ".UTF-8" if 
+      a period is not detected in the locale string.  
+
+      There are no locales with modifiers on DragonFly so if found, they
+      will just be stripped off silently.  e.g "de_DE@euro" will be reduced
+      to "de_DE".  The UTF-8 default would be added after that.
+  */
+
+  void
+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
+				    __c_locale)
+  {
+    const size_t size__s = (__s == NULL) ? 1 : strlen (__s);
+    const char UTF8[] = ".UTF-8";
+    char localspec[size__s + 6 + 1];
+    
+    if (__s == NULL) {
+       localspec[0] = NULL;
+    } else {
+       strcpy (localspec, __s);
+       char * pch = strchr (localspec, '@');
+       if (pch != NULL)
+          *pch = 0;
+
+       if (  (strchr (__s, '.') == NULL)
+          && (strcmp (__s, "C") != 0)
+          && (strcmp (__s, "POSIX") != 0))
+          strncat (localspec, UTF8, 6);
+    }
+
+    const char * result = std::setlocale(LC_ALL, localspec);
+    
+    if ((strcmp(result, "C") != 0) && (strcmp (result, localspec) != 0))
+      __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
+			    "name not valid"));
+    __cloc = 0;
+  }
+
+  void
+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+  { __cloc = 0; }
+
+  __c_locale
+  locale::facet::_S_clone_c_locale(__c_locale&) throw()
+  { return __c_locale(); }
+
+  __c_locale
+  locale::facet::_S_lc_ctype_c_locale(__c_locale, const char*)
+  { return __c_locale(); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+    {
+      "LC_CTYPE",
+      "LC_NUMERIC",
+      "LC_TIME",
+      "LC_COLLATE",
+      "LC_MONETARY",
+      "LC_MESSAGES"
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+// XXX GLIBCXX_ABI Deprecated
+#ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+#define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+  extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
+_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
+#endif // _GLIBCXX_LONG_DOUBLE_COMPAT

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_locale_dragonfly_ctype__members.cc
$NetBSD: patch-libstdc++-v3_config_locale_dragonfly_ctype__members.cc,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/locale/dragonfly/ctype_members.cc.orig	2012-06-22 11:15:15.000000000 +0000
+++ libstdc++-v3/config/locale/dragonfly/ctype_members.cc
@@ -0,0 +1,174 @@
+// std::ctype implementation details, GNU version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
+//
+
+// Written by Benjamin Kosnik <bkoz@redhat.com>
+
+#include <locale>
+#include <bits/c++locale_internal.h>
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+  // NB: The other ctype<char> specializations are in src/locale.cc and
+  // various /config/os/* files.
+
+  ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+  : ctype<char>(0, false, __refs) 
+  { 		
+    if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
+      {
+	this->_S_destroy_c_locale(this->_M_c_locale_ctype);
+	this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
+      }
+  }
+
+  ctype_byname<char>::~ctype_byname()
+  { }
+
+#ifdef _GLIBCXX_USE_WCHAR_T  
+  ctype<wchar_t>::__wmask_type
+  ctype<wchar_t>::_M_convert_to_wmask(
+    const mask __attribute__((__unused__)) __m) const throw()
+  {
+    // DragonFly uses the same codes for 'char' as 'wchar_t', so this routine
+    // never gets called.
+    return __wmask_type();
+  };
+  
+  wchar_t
+  ctype<wchar_t>::do_toupper(wchar_t __c) const
+  { return towupper(__c); }
+
+  const wchar_t*
+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
+  {
+    while (__lo < __hi)
+      {
+        *__lo = towupper(*__lo);
+        ++__lo;
+      }
+    return __hi;
+  }
+  
+  wchar_t
+  ctype<wchar_t>::do_tolower(wchar_t __c) const
+  { return towlower(__c); }
+  
+  const wchar_t*
+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
+  {
+    while (__lo < __hi)
+      {
+        *__lo = towlower(*__lo);
+        ++__lo;
+      }
+    return __hi;
+  }
+
+  wchar_t
+  ctype<wchar_t>::
+  do_widen(char __c) const
+  { return _M_widen[static_cast<unsigned char>(__c)]; }
+
+  const char* 
+  ctype<wchar_t>::
+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
+  {
+    while (__lo < __hi)
+      {
+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
+	++__lo;
+	++__dest;
+      }
+    return __hi;
+  }
+
+  char
+  ctype<wchar_t>::
+  do_narrow(wchar_t __wc, char __dfault) const
+  { 
+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
+      return _M_narrow[__wc];
+    const int __c = wctob(__wc);
+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
+  }
+
+  const wchar_t*
+  ctype<wchar_t>::
+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
+	    char* __dest) const
+  {
+    if (_M_narrow_ok)
+      while (__lo < __hi)
+	{
+	  if (*__lo >= 0 && *__lo < 128)
+	    *__dest = _M_narrow[*__lo];
+	  else
+	    {
+	      const int __c = wctob(*__lo);
+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+	    }
+	  ++__lo;
+	  ++__dest;
+	}
+    else
+      while (__lo < __hi)
+	{
+	  const int __c = wctob(*__lo);
+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+	  ++__lo;
+	  ++__dest;
+	}
+    return __hi;
+  }
+
+  void
+  ctype<wchar_t>::_M_initialize_ctype() throw()
+  {
+    wint_t __i;
+    for (__i = 0; __i < 128; ++__i)
+      {
+	const int __c = wctob(__i);
+	if (__c == EOF)
+	  break;
+	else
+	  _M_narrow[__i] = static_cast<char>(__c);
+      }
+    if (__i == 128)
+      _M_narrow_ok = true;
+    else
+      _M_narrow_ok = false;
+    for (size_t __i = 0;
+	 __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
+      _M_widen[__i] = btowc(__i);
+  }
+#endif //  _GLIBCXX_USE_WCHAR_T
+}

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__base.h
$NetBSD: patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__base.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h.orig	2012-06-22 10:35:30.000000000 +0000
+++ libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h
@@ -0,0 +1,60 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h on DragonFly.
+// Full details can be found from git repo at:
+// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  /// @brief  Base class for ctype.
+  struct ctype_base
+  {
+    // Non-standard typedefs.
+    typedef const unsigned char*	__to_type;
+
+    // NB: Offsets into ctype<char>::_M_table force a particular size
+    // on the mask type. Because of this, we don't use an enum.
+    typedef uint16_t		mask;
+    static const mask upper	= _CTYPEMASK_U;
+    static const mask lower	= _CTYPEMASK_L;
+    static const mask alpha	= _CTYPEMASK_A;
+    static const mask digit	= _CTYPEMASK_D;
+    static const mask xdigit	= _CTYPEMASK_X;
+    static const mask space	= _CTYPEMASK_S;
+    static const mask print	= _CTYPEMASK_R;
+    static const mask graph	= _CTYPEMASK_G;
+    static const mask cntrl	= _CTYPEMASK_C;
+    static const mask punct	= _CTYPEMASK_P;
+    static const mask alnum	= _CTYPEMASK_A | _CTYPEMASK_D;
+  };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__configure__char.cc
$NetBSD: patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__configure__char.cc,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/os/bsd/dragonfly/ctype_configure_char.cc.orig	2012-06-22 10:35:30.000000000 +0000
+++ libstdc++-v3/config/os/bsd/dragonfly/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__inline.h
$NetBSD: patch-libstdc++-v3_config_os_bsd_dragonfly_ctype__inline.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h.orig	2012-06-22 10:35:30.000000000 +0000
+++ libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h
@@ -0,0 +1,127 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000, 2003, 2004, 2005, 2009, 2010
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/ctype_inline.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{locale}
+ */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  bool
+  ctype<char>::
+  is(mask __m, char __c) const
+  { return _M_table[(unsigned char)(__c)] & __m; }
+
+  const char*
+  ctype<char>::
+  is(const char* __low, const char* __high, mask* __vec) const
+  {
+    while (__low < __high)
+      *__vec++ = _M_table[*__low++];
+    return __high;
+  }
+
+  const char*
+  ctype<char>::
+  scan_is(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high && !this->is(__m, *__low))
+      ++__low;
+    return __low;
+  }
+
+  const char*
+  ctype<char>::
+  scan_not(mask __m, const char* __low, const char* __high) const
+  {
+    while (__low < __high && this->is(__m, *__low) != 0)
+      ++__low;
+    return __low;
+  }
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+  inline bool
+  ctype<wchar_t>::
+  do_is(mask __m, wchar_t __c) const
+  {
+    return __libc_ctype_ [__c + 1] & __m;
+  }
+
+  inline const wchar_t*
+  ctype<wchar_t>::
+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
+  {
+    for (; __lo < __hi; ++__vec, ++__lo)
+    {
+      mask __m = 0;
+      if (isupper (*__lo)) __m |= _CTYPEMASK_U;
+      if (islower (*__lo)) __m |= _CTYPEMASK_L;
+      if (isdigit (*__lo)) __m |= _CTYPEMASK_D;
+      if (isspace (*__lo)) __m |= _CTYPEMASK_S;
+      if (ispunct (*__lo)) __m |= _CTYPEMASK_P;
+      if (isblank (*__lo)) __m |= _CTYPEMASK_B;
+      if (iscntrl (*__lo)) __m |= _CTYPEMASK_C;
+      if (isalpha (*__lo)) __m |= _CTYPEMASK_A;
+      if (isgraph (*__lo)) __m |= _CTYPEMASK_G;
+      if (isprint (*__lo)) __m |= _CTYPEMASK_R;
+      if (isxdigit(*__lo)) __m |= _CTYPEMASK_X;
+      /* alnum already covered = alpha | digit */
+
+      *__vec = __m;
+    }
+    return __hi;
+  }
+
+  inline const wchar_t*
+  ctype<wchar_t>::
+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
+  {
+    while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m))
+      ++__lo;
+    return __lo;
+  }
+
+  inline const wchar_t*
+  ctype<wchar_t>::
+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
+  {
+    while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m))
+      ++__lo;
+    return __lo;
+  }
+#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_config_os_bsd_dragonfly_os__defines.h
$NetBSD: patch-libstdc++-v3_config_os_bsd_dragonfly_os__defines.h,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/config/os/bsd/dragonfly/os_defines.h.orig	2012-06-22 10:35:30.000000000 +0000
+++ libstdc++-v3/config/os/bsd/dragonfly/os_defines.h
@@ -0,0 +1,41 @@
+// Specific definitions for BSD  -*- C++ -*-
+
+// Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library 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 3, or (at your option)
+// any later version.
+
+// This library 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.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+
+#ifndef _GLIBCXX_OS_DEFINES
+#define _GLIBCXX_OS_DEFINES 1
+
+// System-specific #define, typedefs, corrections, etc, go here.  This
+// file will come before all others.
+
+/*  FreeBSD approach, likely a mistake for DragonFly.
+#define _GLIBCXX_USE_C99_CHECK 1
+#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
+#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
+#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
+#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
+#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
+*/
+
+#endif

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_configure
$NetBSD: patch-libstdc++-v3_configure,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/configure.orig	2012-03-02 07:13:55.000000000 +0000
+++ libstdc++-v3/configure
@@ -15704,7 +15704,7 @@ $as_echo "stdio" >&6; }
 if test "${enable_clocale+set}" = set; then :
   enableval=$enable_clocale;
       case "$enableval" in
-       generic|gnu|ieee_1003.1-2001|newlib|yes|no|auto) ;;
+       generic|gnu|ieee_1003.1-2001|newlib|darwin|dragonfly|yes|no|auto) ;;
        *) as_fn_error "Unknown argument to enable/disable clocale" "$LINENO" 5 ;;
 	  	        esac
 
@@ -15742,6 +15742,9 @@ fi
       darwin* | freebsd*)
 	enable_clocale_flag=darwin
 	;;
+      dragonfly*)
+	enable_clocale_flag=dragonfly
+	;;
       *)
 	if test x"$with_newlib" = x"yes"; then
 	  enable_clocale_flag=newlib
@@ -15883,6 +15886,23 @@ $as_echo "darwin or freebsd" >&6; }
       CTIME_CC=config/locale/generic/time_members.cc
       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
       ;;
+    dragonfly)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: dragonfly" >&5
+$as_echo "dragonfly" >&6; }
+
+      CLOCALE_H=config/locale/generic/c_locale.h
+      CLOCALE_CC=config/locale/dragonfly/c_locale.cc
+      CCODECVT_CC=config/locale/generic/codecvt_members.cc
+      CCOLLATE_CC=config/locale/generic/collate_members.cc
+      CCTYPE_CC=config/locale/dragonfly/ctype_members.cc
+      CMESSAGES_H=config/locale/generic/messages_members.h
+      CMESSAGES_CC=config/locale/generic/messages_members.cc
+      CMONEY_CC=config/locale/generic/monetary_members.cc
+      CNUMERIC_CC=config/locale/generic/numeric_members.cc
+      CTIME_H=config/locale/generic/time_members.h
+      CTIME_CC=config/locale/generic/time_members.cc
+      CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+      ;;
 
     gnu)
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: gnu" >&5

File Added: pkgsrc/lang/gcc47/patches/Attic/patch-libstdc++-v3_configure.host
$NetBSD: patch-libstdc++-v3_configure.host,v 1.1 2012/06/23 22:13:02 marino Exp $

--- libstdc++-v3/configure.host.orig	2012-02-10 18:10:12.000000000 +0000
+++ libstdc++-v3/configure.host
@@ -239,6 +239,9 @@ case "${host_os}" in
     os_include_dir="os/djgpp"
     error_constants_dir="os/djgpp"
     ;;
+  dragonfly*)
+    os_include_dir="os/bsd/dragonfly"
+    ;;
   freebsd*)
     os_include_dir="os/bsd/freebsd"
     ;;

cvs diff -r1.1.1.1 -r1.2 pkgsrc/lang/gcc47/patches/Attic/patch-gcc_ginclude_stddef.h (expand / switch to unified diff)

--- pkgsrc/lang/gcc47/patches/Attic/patch-gcc_ginclude_stddef.h 2012/04/16 04:27:18 1.1.1.1
+++ pkgsrc/lang/gcc47/patches/Attic/patch-gcc_ginclude_stddef.h 2012/06/23 22:13:02 1.2
@@ -1,19 +1,68 @@ @@ -1,19 +1,68 @@
1$NetBSD: patch-gcc_ginclude_stddef.h,v 1.1.1.1 2012/04/16 04:27:18 sbd Exp $ 1$NetBSD: patch-gcc_ginclude_stddef.h,v 1.2 2012/06/23 22:13:02 marino Exp $
2 2
3Fix build on NetBSD i386/amd64 after the ansi.h header include protection 3Fix build on NetBSD i386/amd64 after the ansi.h header include protection
4name change. 4name change.
 5Add DragonFly support.
5 6
6--- gcc/ginclude/stddef.h.orig 2012-02-12 01:06:04.000000000 +0000 7--- gcc/ginclude/stddef.h.orig 2012-02-12 01:06:04.000000000 +0000
7+++ gcc/ginclude/stddef.h 8+++ gcc/ginclude/stddef.h
8@@ -53,6 +53,11 @@ see the files COPYING3 and COPYING.RUNTI 9@@ -53,12 +53,21 @@ see the files COPYING3 and COPYING.RUNTI
9 one less case to deal with in the following. */ 10 one less case to deal with in the following. */
10 #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) 11 #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
11 #include <machine/ansi.h> 12 #include <machine/ansi.h>
12+#if !defined(_MACHINE_ANSI_H_) 13+#if !defined(_MACHINE_ANSI_H_)
13+#if defined(_I386_ANSI_H_) || defined(_X86_64_ANSI_H_) 14+#if defined(_I386_ANSI_H_) || defined(_X86_64_ANSI_H_)
14+#define _MACHINE_ANSI_H_ 15+#define _MACHINE_ANSI_H_
15+#endif 16+#endif
16+#endif 17+#endif
17 #endif 18 #endif
18 /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ 19 /* On FreeBSD 5, machine/ansi.h does not exist anymore... */
19 #if defined (__FreeBSD__) && (__FreeBSD__ >= 5) 20 #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
 21 #include <sys/_types.h>
 22 #endif
 23
 24+#if defined(__DragonFly__)
 25+#include <sys/types.h>
 26+#endif
 27+
 28 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
 29 defined if the corresponding type is *not* defined.
 30 FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
 31@@ -136,6 +145,7 @@ _TYPE_wchar_t;
 32 #ifndef _BSD_PTRDIFF_T_
 33 #ifndef ___int_ptrdiff_t_h
 34 #ifndef _GCC_PTRDIFF_T
 35+#ifndef _PTRDIFF_T_DECLARED /* DragonFly */
 36 #define _PTRDIFF_T
 37 #define _T_PTRDIFF_
 38 #define _T_PTRDIFF
 39@@ -144,10 +154,12 @@ _TYPE_wchar_t;
 40 #define _BSD_PTRDIFF_T_
 41 #define ___int_ptrdiff_t_h
 42 #define _GCC_PTRDIFF_T
 43+#define _PTRDIFF_T_DECLARED
 44 #ifndef __PTRDIFF_TYPE__
 45 #define __PTRDIFF_TYPE__ long int
 46 #endif
 47 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 48+#endif /* _PTRDIFF_T_DECLARED */
 49 #endif /* _GCC_PTRDIFF_T */
 50 #endif /* ___int_ptrdiff_t_h */
 51 #endif /* _BSD_PTRDIFF_T_ */
 52@@ -201,6 +213,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 53 #define _GCC_SIZE_T
 54 #define _SIZET_
 55 #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
 56+ || defined(__DragonFly__) \
 57 || defined(__FreeBSD_kernel__)
 58 /* __size_t is a typedef on FreeBSD 5, must not trash it. */
 59 #else
 60@@ -307,7 +320,7 @@ typedef _BSD_RUNE_T_ rune_t;
 61 /* FreeBSD 5 can't be handled well using "traditional" logic above
 62 since it no longer defines _BSD_RUNE_T_ yet still desires to export
 63 rune_t in some cases... */
 64-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
 65+#if defined (__DragonFly__) || (defined (__FreeBSD__) && (__FreeBSD__ >= 5))
 66 #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
 67 #if __BSD_VISIBLE
 68 #ifndef _RUNE_T_DECLARED