pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Import gcc45-4.5.3nb8 as wip/gcc45.



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Dec 22 15:00:27 2016 +0100
Changeset:	39d28f7ddbc640c08c8bac28091ae60a2f6823f4

Added Files:
	gcc45/DESCR
	gcc45/Makefile
	gcc45/buildlink3.mk
	gcc45/distinfo
	gcc45/files/dragonfly-spec.h
	gcc45/files/dragonfly.h
	gcc45/files/hello.f
	gcc45/files/hello.m
	gcc45/files/i386-dragonfly.h
	gcc45/files/i386-dragonfly64.h
	gcc45/options.mk
	gcc45/patches/patch-aa
	gcc45/patches/patch-ab
	gcc45/patches/patch-ac
	gcc45/patches/patch-ad
	gcc45/patches/patch-af
	gcc45/patches/patch-ag
	gcc45/patches/patch-ah
	gcc45/patches/patch-aj
	gcc45/patches/patch-ak
	gcc45/patches/patch-gcc_config_netbsd.h
	gcc45/patches/patch-gcc_doc_cppopts.texi
	gcc45/patches/patch-gcc_doc_generic.texi
	gcc45/patches/patch-gcc_doc_invoke.texi
	gcc45/patches/patch-include_libiberty.h
	gcc45/patches/patch-libgcc_config_t-slibgcc-darwin
	gcc45/patches/patch-libiberty___doprnt.c
	gcc45/patches/patch-libiberty_asprintf.c
	gcc45/patches/patch-libiberty_concat.c
	gcc45/patches/patch-libiberty_snprintf.c
	gcc45/patches/patch-libiberty_vasprintf.c
	gcc45/patches/patch-libiberty_vsnprintf.c
	gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h
	gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h

Log Message:
Import gcc45-4.5.3nb8 as wip/gcc45.

This is the gcc 4.5 compiler suite.

This package has a test target. For testing (only), this
package requires devel/dejagnu and devel/autogen.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=39d28f7ddbc640c08c8bac28091ae60a2f6823f4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gcc45/DESCR                                        |   4 +
 gcc45/Makefile                                     | 163 ++++++++++++++++
 gcc45/buildlink3.mk                                |  71 +++++++
 gcc45/distinfo                                     |  29 +++
 gcc45/files/dragonfly-spec.h                       | 215 +++++++++++++++++++++
 gcc45/files/dragonfly.h                            |  97 ++++++++++
 gcc45/files/hello.f                                |   5 +
 gcc45/files/hello.m                                |   6 +
 gcc45/files/i386-dragonfly.h                       | 148 ++++++++++++++
 gcc45/files/i386-dragonfly64.h                     |  54 ++++++
 gcc45/options.mk                                   | 113 +++++++++++
 gcc45/patches/patch-aa                             |  86 +++++++++
 gcc45/patches/patch-ab                             |  24 +++
 gcc45/patches/patch-ac                             |  17 ++
 gcc45/patches/patch-ad                             |  28 +++
 gcc45/patches/patch-af                             |  16 ++
 gcc45/patches/patch-ag                             |  29 +++
 gcc45/patches/patch-ah                             |  22 +++
 gcc45/patches/patch-aj                             |  46 +++++
 gcc45/patches/patch-ak                             |  16 ++
 gcc45/patches/patch-gcc_config_netbsd.h            |  22 +++
 gcc45/patches/patch-gcc_doc_cppopts.texi           |  15 ++
 gcc45/patches/patch-gcc_doc_generic.texi           |  22 +++
 gcc45/patches/patch-gcc_doc_invoke.texi            |  61 ++++++
 gcc45/patches/patch-include_libiberty.h            |  24 +++
 gcc45/patches/patch-libgcc_config_t-slibgcc-darwin |  26 +++
 gcc45/patches/patch-libiberty___doprnt.c           |  25 +++
 gcc45/patches/patch-libiberty_asprintf.c           |  24 +++
 gcc45/patches/patch-libiberty_concat.c             | 108 +++++++++++
 gcc45/patches/patch-libiberty_snprintf.c           |  25 +++
 gcc45/patches/patch-libiberty_vasprintf.c          |  24 +++
 gcc45/patches/patch-libiberty_vsnprintf.c          |  26 +++
 ...bstdc++-v3_config_os_bsd_netbsd_ctype__inline.h |  13 ++
 ...dc++-v3_config_os_bsd_netbsd_ctype__noninline.h |  57 ++++++
 34 files changed, 1661 insertions(+)

diffs:
diff --git a/gcc45/DESCR b/gcc45/DESCR
new file mode 100644
index 0000000..8cd67ea
--- /dev/null
+++ b/gcc45/DESCR
@@ -0,0 +1,4 @@
+This is the gcc 4.5 compiler suite.
+
+This package has a test target. For testing (only), this
+package requires devel/dejagnu and devel/autogen.
diff --git a/gcc45/Makefile b/gcc45/Makefile
new file mode 100644
index 0000000..fd4882e
--- /dev/null
+++ b/gcc45/Makefile
@@ -0,0 +1,163 @@
+# $NetBSD: Makefile,v 1.22 2016/07/09 06:38:24 wiz Exp $
+
+DISTNAME=		gcc-${GCC_VERSION}
+PKGNAME=		gcc45-${GCC_VERSION}
+PKGREVISION=		8
+CATEGORIES=		lang
+MASTER_SITES=		${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/}
+EXTRACT_SUFX=		.tar.bz2
+
+MAINTAINER=		sbd%NetBSD.org@localhost
+HOMEPAGE=		http://gcc.gnu.org/
+COMMENT=		GNU Compiler Collection 4.5
+LICENSE=		gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
+
+USE_TOOLS+=		awk:run bash:run chmod gmake:run makeinfo sed:run
+GCC_REQD+=		4.4
+
+GCC_VERSION=		4.5.3
+
+GCC_SUBPREFIX=		gcc45
+GCC_PREFIX=		${PREFIX}/${GCC_SUBPREFIX}
+FILES_SUBST+=		PKGNAME=${PKGNAME}
+MESSAGE_SUBST+=		GCC_PREFIX=${GCC_PREFIX}
+
+
+# To avoid GNU surprises
+CONFIG_SHELL=		${TOOLS_PATH.bash}
+
+NOT_FOR_PLATFORM=	Interix-*-* DragonFly-*-*
+UNLIMIT_RESOURCES+=	datasize
+UNLIMIT_RESOURCES+=	stacksize
+
+.include "../../mk/bsd.prefs.mk"
+.include "options.mk"
+
+# Determine whether to use binutils
+.if ${OPSYS} == "SunOS"
+CONFIGURE_ENV+=		OBJDUMP=/usr/sfw/bin/gobjdump
+CONFIGURE_ARGS+=	--without-gnu-ld --with-ld=/usr/ccs/bin/ld
+. if !exists(/usr/sfw/bin/gas)
+CONFIGURE_ARGS+=	--without-gnu-as --with-as=/usr/ccs/bin/as
+. else
+CONFIGURE_ARGS+=	--with-gnu-as --with-as=/usr/sfw/bin/gas
+. endif
+.endif
+
+# REPLACE_AWK+=	gcc/testsuite/gcc.test-framework/test-framework.awk	\
+# 		gcc/mkmap-symver.awk					\
+# 		gcc/optc-gen.awk					\
+# 		gcc/mkmap-flat.awk					\
+# 		gcc/opt-gather.awk					\
+# 		gcc/opth-gen.awk					\
+# 		gcc/opt-functions.awk
+
+REPLACE_BASH+= contrib/dg-cmp-results.sh
+REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-patchlist
+REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update
+REPLACE_BASH+= contrib/reghunt/bin/gcc-svn-update-fix
+REPLACE_BASH+= contrib/reghunt/bin/reg-hunt
+REPLACE_BASH+= contrib/reghunt/bin/reg-test
+REPLACE_BASH+= contrib/reghunt/date_based/reg_periodic
+REPLACE_BASH+= contrib/reghunt/date_based/reg_search
+REPLACE_BASH+= gcc/dbgcnt.def
+REPLACE_BASH+= gcc/testsuite/gcc.test-framework/gen_directive_tests
+REPLACE_BASH+= libstdc++-v3/scripts/run_doxygen
+
+
+CONFIGURE_ARGS+=	--prefix=${GCC_PREFIX:Q}
+CONFIGURE_ARGS+=	--enable-languages=${LANGS:Q}
+CONFIGURE_ARGS+=	--enable-shared
+CONFIGURE_ARGS+=	--enable-long-long
+CONFIGURE_ARGS+=	--with-local-prefix=${GCC_PREFIX:Q}
+CONFIGURE_ARGS+=	--enable-libssp
+CONFIGURE_ARGS+=	--enable-threads=posix
+.if ${OPSYS} == "NetBSD"
+.include "../../devel/binutils/buildlink3.mk"
+.include "../../devel/libelf/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-ld=${PREFIX}/gnu/bin/ld
+CONFIGURE_ARGS+=	--with-libelf=${PREFIX}
+MAKE_ENV+=		ac_cv_func_clock_gettime=yes
+.endif
+
+CONFIGURE_ARGS.Linux+=	--disable-libquadmath --disable-libquadmath-support
+
+# See ${WRKSRC}/libgcc/config/t-slibgcc-darwin: It uses strip(1) to
+# create a stub library, not just to remove symbols, so we must not
+# let strip(1) be a no-op regardless of ${INSTALL_UNSTRIPPED} or the
+# build fails for missing files.
+CONFIGURE_ARGS.Darwin+=	STRIP_FOR_TARGET=${TOOLS_PLATFORM.strip}
+
+.if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
+CONFIGURE_ARGS+=	--with-dwarf2
+.endif
+
+.if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-powerpc) \
+ || (!empty(MACHINE_PLATFORM:MLinux-*-x86_64) && \
+      exists(/usr/include/gnu/stubs-64.h) && \
+     !exists(/usr/include/gnu/stubs-32.h))
+CONFIGURE_ARGS+=	--disable-multilib
+.endif
+
+CONFIGURE_ENV+=		CONFIG_SHELL=${CONFIG_SHELL}
+
+MAKE_ENV+=		SHELL=${CONFIG_SHELL}
+MAKE_ENV+=		ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD}
+
+# ${WRKSRC}/fixincludes/ looks for sed and compiles the path to sed into
+# a binary so we need to make sure we give it the installed sed and not
+# the tool wrapped one.
+MAKE_ENV+=		ac_cv_path_SED=${TOOLS_SED}
+MAKE_ENV+=		lt_cv_path_SED=${TOOLS_SED}
+
+CPPFLAGS+=		-I${BUILDLINK_DIR}/include
+CFLAGS+=		-I${BUILDLINK_DIR}/include
+
+
+# Somone should fix this so it will match the NetBSD system compiler
+#.if ${OPSYS} == "NetBSD"
+#GCC_PLATFORM=	${MACHINE_ARCH}--${LOWER_OPSYS}${APPEND_ELF}
+#CONFIGURE_ARGS+=	--host=${GCC_PLATFORM:Q}
+#MAKE_ENV+=		AR=/usr/bin/ar
+#.endif # NetBSD
+
+pre-configure:
+.if ${OPSYS} == "DragonFly"
+	${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h
+	${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h
+	${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h
+	${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h
+.endif
+
+.if ${OPSYS} == "NetBSD"
+	${CP} ${WRKSRC}/gcc/config/freebsd-stdint.h ${WRKSRC}/gcc/config/netbsd-stdint.h
+.endif
+
+do-configure:
+	${MKDIR} ${WRKDIR}/obj
+	cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS}
+
+do-build:
+	(${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q} )
+
+do-test:
+#.if (${MACHINE_GNU_ARCH} == "x86_64")
+#	(cd ${FILESDIR} && ${CP} netbsd64macro.dfs ${WRKSRC}/gcc/testsuite/ada/acats/support/macro.dfs)
+#.endif
+	(cd ${WRKDIR}/obj && ${GMAKE} -k check)
+
+do-install:
+	(cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} install DESTDIR=${DESTDIR} \
+	 && ${TEST} -f ${DESTDIR}${GCC_PREFIX}/bin/cc || ${LN} -f ${DESTDIR}${GCC_PREFIX}/bin/gcc ${DESTDIR}${GCC_PREFIX}/bin/cc)
+
+.if ${OPSYS} == "SunOS" && ${OS_VERSION} != "5.11" && !empty(MACHINE_ARCH:M*86*)
+post-install:
+	-${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m32
+	-${SH} files/values.c ${DESTDIR}${GCC_PREFIX}/bin/gcc -m64
+.endif
+
+GENERATE_PLIST+=                                                        \
+	cd ${DESTDIR}${PREFIX} && ${FIND} ${GCC_SUBPREFIX} \( -type f -o -type l \) -print \
+	| ${SORT} ;
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/gcc45/buildlink3.mk b/gcc45/buildlink3.mk
new file mode 100644
index 0000000..f7480a8
--- /dev/null
+++ b/gcc45/buildlink3.mk
@@ -0,0 +1,71 @@
+# $NetBSD: buildlink3.mk,v 1.8 2015/11/25 12:51:16 jperkin Exp $
+
+BUILDLINK_TREE+=	gcc45
+
+.if !defined(GCC45_BUILDLINK3_MK)
+GCC45_BUILDLINK3_MK:=
+
+_GCC45_SUBDIR=	gcc45
+_GCC45_PREFIX=	${BUILDLINK_PREFIX.gcc45}/${_GCC45_SUBDIR}
+
+BUILDLINK_API_DEPENDS.gcc45+=	gcc45>=4.5
+BUILDLINK_ABI_DEPENDS.gcc45+=	gcc45>=4.5.0
+BUILDLINK_PKGSRCDIR.gcc45?=	../../lang/gcc45
+
+.if exists(${_GCC45_PREFIX}/bin/gcc)
+
+# logic for detecting the ADA compiler (not yet supported)
+#gcc45_GNAT1!=${_GCC45_PREFIX}/bin/gcc -print-prog-name=gnat1
+#.  if exists(${gcc45_GNAT1})
+#CONFIGURE_ENV+=	ADAC=${_GCC45_PREFIX}/bin/gcc
+#MAKE_ENV+=	ADAC=${_GCC45_PREFIX}/bin/gcc
+#.  endif
+
+# add libraries
+BUILDLINK_LIBDIRS.gcc45+=	${_GCC45_SUBDIR}/lib
+
+# find the gcc architecture
+gcc45_GCC_ARCHDIR!=	${DIRNAME} `${_GCC45_PREFIX}/bin/gcc --print-libgcc-file-name`
+
+# add the architecture dep libraries
+.  if empty(gcc45_GCC_ARCHDIR:M*not_found*)
+BUILDLINK_LIBDIRS.gcc45+=	${gcc45_GCC_ARCHDIR:S/^${BUILDLINK_PREFIX.gcc45}\///}/
+
+# add the ada libraries (not yet supported)
+#.    if exists(${gcc45_GNAT1})
+#BUILDLINK_LIBDIRS.gcc45+=	${gcc45_GCC_ARCHDIR:S/^${BUILDLINK_PREFIX.gcc45}\///}/adalib
+#.    endif
+
+# add the header files
+BUILDLINK_INCDIRS.gcc45+=	${_GCC45_SUBDIR}/include ${gcc45_GCC_ARCHDIR:S/^${BUILDLINK_PREFIX.gcc45}\///}/include
+.  endif
+.endif
+
+BUILDLINK_FILES_CMD.gcc45=	\
+	(cd  ${BUILDLINK_PREFIX.gcc45} &&	\
+	${FIND} ${_GCC45_SUBDIR}/bin ${_GCC45_SUBDIR}/include ${_GCC45_SUBDIR}/libexec ${_GCC45_SUBDIR}/lib \( -type f -o -type l \) -print)
+
+# When not using the GNU linker, gcc will always link shared libraries
+# against the shared version of libgcc. Always enable _USE_GCC_SHILB on
+# platforms that don't use the GNU linker, such as SunOS.
+.include "../../mk/bsd.fast.prefs.mk"
+.if ${OPSYS} == "SunOS"
+_USE_GCC_SHLIB= yes
+.endif
+
+# Packages that link against shared libraries need a full dependency.
+.if defined(_USE_GCC_SHLIB)
+BUILDLINK_DEPMETHOD.gcc45+=	full
+.else
+BUILDLINK_DEPMETHOD.gcc45?=	build
+.endif
+
+.include "../../mk/pthread.buildlink3.mk"
+pkgbase := gcc45
+.include "../../mk/pkg-build-options.mk"
+.if !empty(PKG_BUILD_OPTIONS.gcc45:Mnls)
+.include "../../devel/gettext-lib/buildlink3.mk"
+.endif
+.endif # GCC45_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-gcc45
diff --git a/gcc45/distinfo b/gcc45/distinfo
new file mode 100644
index 0000000..12dfed1
--- /dev/null
+++ b/gcc45/distinfo
@@ -0,0 +1,29 @@
+$NetBSD: distinfo,v 1.13 2016/09/10 13:59:31 maya Exp $
+
+SHA1 (gcc-4.5.3.tar.bz2) = 73c45dfda5eef6b124be53e56828b5925198cc1b
+RMD160 (gcc-4.5.3.tar.bz2) = d07aa90f2186b4e082dfd5ad5d5188c097fb6247
+SHA512 (gcc-4.5.3.tar.bz2) = 42c03aa0d16a52e95d1857d859ddd0a4923c232b90481ee52b02bc9a3976bc6e5e502e94af3fc76ac054572a420303c47e409c72f816416aeffd74c4bcd443d3
+Size (gcc-4.5.3.tar.bz2) = 66374586 bytes
+SHA1 (patch-aa) = b20d2e95229bddba42819780725ab159e14f06f0
+SHA1 (patch-ab) = 61bc2ebf150c6e471917e145d74e7795dc162194
+SHA1 (patch-ac) = 7da8c27d521164c1a7801dda8ca62d1057ac8d32
+SHA1 (patch-ad) = b72c93d8477a567363616717e20eef1b33e7d307
+SHA1 (patch-af) = 54fb9fb3438eb7c646b9d51b6b0cf3ded27d4989
+SHA1 (patch-ag) = b58f8b82fcf17c60eb2700bc54d6625ca45e542b
+SHA1 (patch-ah) = a963394b0434b82494b7510d4b2705f77acfb668
+SHA1 (patch-aj) = 1927ff77d1c51fe9e8927dba582c7d399545ae7b
+SHA1 (patch-ak) = 3d8a859ba436a4b204bb99f59cd5331d695aa811
+SHA1 (patch-gcc_config_netbsd.h) = 086b593cf9f05e654df9e1a527485ca727ec44cc
+SHA1 (patch-gcc_doc_cppopts.texi) = fba9b651bdef12f9034e75cb43533b50c2c94540
+SHA1 (patch-gcc_doc_generic.texi) = b255fb30f889a415318a29c50ac0510ccece0bc4
+SHA1 (patch-gcc_doc_invoke.texi) = 7418eddc7e4d39fab3da1922ff86965240661fb4
+SHA1 (patch-include_libiberty.h) = 101c12fad8092c7eb7ba41a75ca84f9a8017589b
+SHA1 (patch-libgcc_config_t-slibgcc-darwin) = 2ddda2dd979f27c623e47db70c5abb3befdb68c9
+SHA1 (patch-libiberty___doprnt.c) = 20f839e98ca235d5a34adcad6b7ea4a77f06a9e8
+SHA1 (patch-libiberty_asprintf.c) = 39d8ca4c95aa035c4d8e9faba2e5919c13f4444c
+SHA1 (patch-libiberty_concat.c) = 07fe2982d57151579736361ca15f3edd8b0bce69
+SHA1 (patch-libiberty_snprintf.c) = 25e131f8ea4e6f8b567088f653f6a02153aec202
+SHA1 (patch-libiberty_vasprintf.c) = a8c0ec0c3e9dbfcd675a0bb02a89e8c51a885605
+SHA1 (patch-libiberty_vsnprintf.c) = 362ea0ce3f86df6548388878006db4f951aa1f09
+SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h) = e328bc56bbb9c3e0a76c8d98a7c0a7b8b8eda22e
+SHA1 (patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h) = 38dd700202d741de1eeee01c44eee6e2e363b9c5
diff --git a/gcc45/files/dragonfly-spec.h b/gcc45/files/dragonfly-spec.h
new file mode 100644
index 0000000..ace9e19
--- /dev/null
+++ b/gcc45/files/dragonfly-spec.h
@@ -0,0 +1,215 @@
+/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/dragonfly-spec.h,v 1.5 2008/07/24 21:45:10 corecode Exp $ */
+
+/* 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/freebsd-spec.h by
+   Joerg Sonnenberger <joerg%bec.de@localhost>
+
+   Adapted from gcc/config/freebsd.h by 
+   David O'Brien <obrien%FreeBSD.org@localhost>
+   Loren J. Rittle <ljrittle%acm.org@localhost>.  */
+
+
+/* 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 DFBSD_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 DFBSD_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 DFBSD_TARGET_OS_CPP_BUILTINS()					\
+  do									\
+    {									\
+	if (DFBSD_MAJOR == 3)	       				\
+	  builtin_define ("__DragonFly__=3");			       	\
+	else if (DFBSD_MAJOR == 2)	       				\
+	  builtin_define ("__DragonFly__=2");			       	\
+	else if (DFBSD_MAJOR == 1)	       				\
+	  builtin_define ("__DragonFly__=1");			       	\
+	else								\
+	  builtin_define ("__DragonFly__");			       	\
+	builtin_define ("__DragonFly_cc_version=100001");		\
+	builtin_define_std ("unix");					\
+	builtin_define ("__KPRINTF_ATTRIBUTE__");		       	\
+	builtin_assert ("system=unix");					\
+	builtin_assert ("system=bsd");					\
+	builtin_assert ("system=DragonFly");				\
+	DFBSD_TARGET_CPU_CPP_BUILTINS();					\
+    }									\
+  while (0)
+
+/* Define the default DragonFly-specific per-CPU hook code. */
+#define DFBSD_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 DFBSD_CPP_SPEC "							\
+  %(cpp_cpu)								\
+  %{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 DFBSD_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 DFBSD_ENDFILE_SPEC \
+  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+/* Provide a LIB_SPEC appropriate for DragonFly as configured and as
+   required by the user-land thread model.  Select the appropriate libc,
+   depending on whether we're doing profiling or need threads support.
+   Make it a hard error if -pthread is provided on the command line and gcc
+   was configured with --disable-threads (this will help avoid bug
+   reports from users complaining about threading when they
+   misconfigured the gcc bootstrap but are later consulting DragonFly
+   manual pages that refer to the mythical -pthread option).  */
+
+/* Provide a LIB_SPEC appropriate for DragonFly.  Just select the appropriate
+   libc, depending on whether we're doing profiling or need threads support.
+   (simular to the default, except no -lg, and no -p).  */
+
+#ifdef DFBSD_NO_THREADS
+#define DFBSD_LIB_SPEC "						\
+  %{pthread: %eThe -pthread option is only supported on DragonFly when gcc \
+is built with the --enable-threads configure-time option.}		\
+  %{!nostdlib{!nostartfiles{!nolibc: -lc}}}				\
+  }"
+#else
+#define DFBSD_LIB_SPEC "						\
+  %{pthread:-lpthread}							\
+  %{!nostdlib: %{!nostartfiles: %{!nolibc: -lc}}}			\
+  "
+#endif
+
+#define	DFBSD_DYNAMIC_LINKER		"/usr/libexec/ld-elf.so.2"
+
+#if 0
+#define LINK_LIBGCC_SPEC ""
+#define LIBGCC_SPEC "%{shared: -lgcc_pic} %{!shared: -lgcc}"
+
+#define PRE_LIB_SPEC "							\
+  %{pg: -L"PREFIX2"/lib/gcc41/profiling 				\
+    %{!static: -rpath /usr/lib/gcc41/profiling 				\
+      -rpath-link "PREFIX2"/lib/gcc41/profiling}}			\
+  %{g: -L"PREFIX2"/lib/gcc41/debug 					\
+    %{!static: -rpath /usr/lib/gcc41/debug				\
+      -rpath-link "PREFIX2"/lib/gcc41/debug}}				\
+  -L"PREFIX2"/lib/gcc41							\
+  %{!static: -rpath /usr/lib/gcc41  -rpath-link "PREFIX2"/lib/gcc41} 	\
+  %{pg: -L"PREFIX2"/lib/profiling 					\
+    %{!static: -rpath /usr/lib/profiling				\
+      -rpath-link "PREFIX2"/lib/profiling}} 				\
+  %{g: -L"PREFIX2"/lib/debug 						\
+    %{!static: -rpath /usr/lib/debug -rpath-link "PREFIX2"/lib/debug}} 	\
+  %{!static: -rpath /usr/lib -rpath-link "PREFIX2"/lib} 		\
+  "
+
+#define DFBSD_LINK_COMMAND_SPEC "\
+%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+    %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
+    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
+    %{static:} %{L*} %(link_libgcc) %o \
+    %{fprofile-arcs|fprofile-generate: -lgcov}\
+    %{!nostdlib:%{!nodefaultlibs:%(pre_lib)}}\
+    %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\
+    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
+
+#ifndef PREFIX2
+#define	PREFIX2		"/usr"
+#endif
+
+#ifndef STANDARD_STARTFILE_PREFIX_1
+#define	STANDARD_STARTFILE_PREFIX_1	PREFIX2"/lib/gcc41/"
+#endif
+#ifndef STANDARD_EXEC_PREFIX
+#define	STANDARD_EXEC_PREFIX		PREFIX2"/libexec/gcc41/"
+#endif
+#ifndef STANDARD_STARTFILE_PREFIX
+#define	STANDARD_STARTFILE_PREFIX	PREFIX2"/lib/"
+#endif
+#ifndef TOOLDIR_BASE_PREFIX
+#define TOOLDIR_BASE_PREFIX		PREFIX2"/libexec/gcc41"
+#endif
+#ifndef STANDARD_BINDIR_PREFIX
+#define STANDARD_BINDIR_PREFIX		PREFIX2"/libexec/gcc41"
+#endif
+#ifndef STANDARD_LIBEXEC_PREFIX
+#define STANDARD_LIBEXEC_PREFIX		PREFIX2"/libexec/gcc41"
+#endif
+
+#ifndef GPLUSPLUS_INCLUDE_DIR
+#define GPLUSPLUS_INCLUDE_DIR		PREFIX2"/include/c++"
+#endif
+#ifndef GPLUSPLUS_TOOL_INCLUDE_DIR
+#define GPLUSPLUS_TOOL_INCLUDE_DIR	PREFIX2"/include/c++/4.1"
+#endif
+#ifndef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+#define	GPLUSPLUS_BACKWARD_INCLUDE_DIR	PREFIX2"/include/c++/4.1/backward"
+#endif
+#ifndef GCC_LOCAL_INCLUDE_DIR
+#define	GCC_LOCAL_INCLUDE_DIR		PREFIX2"/libdata/gcc41"
+#endif
+#ifndef GCC_INCLUDE_DIR
+#define	GCC_INCLUDE_DIR			PREFIX2"/include"
+#endif
+
+#undef INCLUDE_DEFAULTS
+#define INCLUDE_DEFAULTS				\
+  {							\
+    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },		\
+    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 },	\
+    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0 },	\
+    { GCC_INCLUDE_DIR, "GCC", 0, 0 },			\
+    { GCC_LOCAL_INCLUDE_DIR, "GCC", 0, 0 },		\
+    { NULL, NULL, 0, 0 }				\
+  }
+#endif
diff --git a/gcc45/files/dragonfly.h b/gcc45/files/dragonfly.h
new file mode 100644
index 0000000..6274620
--- /dev/null
+++ b/gcc45/files/dragonfly.h
@@ -0,0 +1,97 @@
+/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/dragonfly.h,v 1.2 2008/05/19 10:46:39 corecode Exp $ */
+
+/* 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/freebsd.h by
+   Joerg Sonnenberger <joerg%bec.de@localhost>
+
+   Adapted from gcc/config/i386/freebsd-elf.h by 
+   David O'Brien <obrien%FreeBSD.org@localhost>.  
+   Further work by David O'Brien <obrien%FreeBSD.org@localhost> and
+   Loren J. Rittle <ljrittle%acm.org@localhost>.  */
+
+
+/* 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) (DFBSD_SWITCH_TAKES_ARG(CHAR))
+
+#undef  WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR) (DFBSD_WORD_SWITCH_TAKES_ARG(STR))
+
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() DFBSD_TARGET_OS_CPP_BUILTINS()
+
+#undef  CPP_SPEC
+#define CPP_SPEC DFBSD_CPP_SPEC
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC DFBSD_STARTFILE_SPEC
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC DFBSD_ENDFILE_SPEC
+
+#undef  LIB_SPEC
+#define LIB_SPEC DFBSD_LIB_SPEC
+
+#if 0
+#undef	LINK_COMMAND_SPEC
+#define LINK_COMMAND_SPEC DFBSD_LINK_COMMAND_SPEC 
+#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
+
+/* Make gcc agree with DragonFly's standard headers (<machine/stdint.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
+
+/* Define this so we can compile MS code for use with WINE.  */
+#define HANDLE_PRAGMA_PACK_PUSH_POP
+
+/* 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
diff --git a/gcc45/files/hello.f b/gcc45/files/hello.f
new file mode 100644
index 0000000..4b34eed
--- /dev/null
+++ b/gcc45/files/hello.f
@@ -0,0 +1,5 @@
+
+      PROGRAM hello
+      print*, 'Hello, World!'
+      END
+
diff --git a/gcc45/files/hello.m b/gcc45/files/hello.m
new file mode 100644
index 0000000..c25ba5a
--- /dev/null
+++ b/gcc45/files/hello.m
@@ -0,0 +1,6 @@
+#import <stdio.h>
+
+int main( int argc, const char *argv[] ) {
+    printf( "hello world\n" );
+    return 0;
+}
diff --git a/gcc45/files/i386-dragonfly.h b/gcc45/files/i386-dragonfly.h
new file mode 100644
index 0000000..78b7e0c
--- /dev/null
+++ b/gcc45/files/i386-dragonfly.h
@@ -0,0 +1,148 @@
+/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/i386/dragonfly.h,v 1.1 2006/09/27 12:10:34 corecode Exp $ */
+
+/* Definitions for Intel 386 running DragonFly with ELF format
+   
+   Copyright (C) 1996, 2000, 2002 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@localhost>
+   Adapted from the FreeBSD version.
+
+   Changes:
+   - remove support for changing the dynamic linker
+
+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>.  */
+
+#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 }
+    
+/* 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)} \
+  %{v:-V} \
+  %{assert*} %{R*} %{rpath*} %{defsym*} \
+  %{shared:-Bshareable %{h*} %{soname*}} \
+    %{!shared: \
+      %{!static: \
+        %{rdynamic:-export-dynamic} \
+        %{!dynamic-linker:-dynamic-linker %(dfbsd_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/gcc45/files/i386-dragonfly64.h b/gcc45/files/i386-dragonfly64.h
new file mode 100644
index 0000000..f423653
--- /dev/null
+++ b/gcc45/files/i386-dragonfly64.h
@@ -0,0 +1,54 @@
+/* $DragonFly: src/gnu/usr.bin/cc41/cc_prep/config/i386/dragonfly64.h,v 1.1 2007/01/15 17:53:16 corecode Exp $ */
+
+/* Definitions for AMD x86-64 running DragonFly with ELF format
+   Copyright (C) 2002 Free Software Foundation, Inc.
+   Contributed by David O'Brien <obrien%FreeBSD.org@localhost>
+   Adapted from the FreeBSD version.
+
+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.  */
+
+/* $FreeBSD: src/contrib/gcc/config/i386/freebsd64.h,v 1.9 2004/07/28 04:44:23 kan Exp $ */
+
+
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (x86-64 DragonFly/ELF)");
+
+/* Tell final.c that we don't need a label passed to mcount.  */
+
+#define SUBTARGET_EXTRA_SPECS \
+  { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }
+
+#undef  MCOUNT_NAME
+#define MCOUNT_NAME ".mcount"
+
+/* Provide a LINK_SPEC appropriate for the DragonFly/x86-64 ELF target.
+   This is a copy of LINK_SPEC from <i386/dragonfly.h> tweaked for
+   the x86-64 target.
+   XXX We don't support two arch userland yet  */
+
+#undef	LINK_SPEC
+#define LINK_SPEC "\
+  %{v:-V} \
+  %{assert*} %{R*} %{rpath*} %{defsym*} \
+  %{shared:-Bshareable %{h*} %{soname*}} \
+    %{!shared: \
+      %{!static: \
+        %{rdynamic:-export-dynamic} \
+	%{!dynamic-linker:-dynamic-linker %(dfbsd_dynamic_linker) }} \
+    %{static:-Bstatic}} \
+  %{symbolic:-Bsymbolic}"
diff --git a/gcc45/options.mk b/gcc45/options.mk
new file mode 100644
index 0000000..e56c375
--- /dev/null
+++ b/gcc45/options.mk
@@ -0,0 +1,113 @@
+# $NetBSD: options.mk,v 1.4 2016/02/25 14:42:55 jperkin Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.gcc45
+PKG_SUPPORTED_OPTIONS=	nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc gcc-objc++ #gcc-ada
+PKG_SUGGESTED_OPTIONS=	gcc-c++ gcc-fortran gcc-objc gcc-objc++
+
+PKG_SUGGESTED_OPTIONS.NetBSD+=	nls
+PKG_SUGGESTED_OPTIONS.SunOS+=	gcc-inplace-math
+
+PKG_OPTIONS_LEGACY_VARS+=	BUILD_CXX:gcc-c++
+PKG_OPTIONS_LEGACY_VARS+=	BUILD_FORTRAN:gcc-fortran
+PKG_OPTIONS_LEGACY_VARS+=	BUILD_JAVA:gcc-java
+PKG_OPTIONS_LEGACY_VARS+=	BUILD_OBJC:gcc-objc
+
+.include "../../mk/bsd.options.mk"
+
+###
+### Build math libraries in place
+###
+.if !empty(PKG_OPTIONS:Mgcc-inplace-math)
+.include "../../devel/gmp/inplace.mk"
+.include "../../math/mpcomplex/inplace.mk"
+.include "../../math/mpfr/inplace.mk"
+.else
+CONFIGURE_ARGS+=	--with-gmp=${BUILDLINK_PREFIX.gmp}
+CONFIGURE_ARGS+=	--with-mpc=${BUILDLINK_PREFIX.mpcomplex}
+CONFIGURE_ARGS+=	--with-mpfr=${BUILDLINK_PREFIX.mpfr}
+LIBS.SunOS+=		-lgmp
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../math/mpcomplex/buildlink3.mk"
+.include "../../math/mpfr/buildlink3.mk"
+.endif
+
+###
+### Native Language Support
+###
+.if !empty(PKG_OPTIONS:Mnls)
+USE_TOOLS+=		msgfmt
+CONFIGURE_ARGS+=	--enable-nls
+CONFIGURE_ARGS+=	--with-libiconv-prefix=${BUILDLINK_PREFIX.libiconv}
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+MAKE_ENV+=		ICONVPREFIX=${BUILDLINK_PREFIX.iconv}
+.else
+CONFIGURE_ARGS+=	--disable-nls
+.endif
+
+###
+### Optional languages
+### Ada could be added although there is a bootstrapping issue.  See
+### ../gcc34-ada for guidance
+###
+
+LANGS=			c
+
+.if !empty(PKG_OPTIONS:Mgcc-java)
+.  if empty(PKG_OPTIONS:Mgcc-c++)
+PKG_OPTIONS+=		gcc-c++
+.  endif
+
+LANGS+=			java
+REPLACE_PYTHON=		libjava/contrib/aot-compile.in
+
+USE_TOOLS+=		unzip zip:run
+CONFIGURE_ARGS+=	--with-system-zlib
+
+# ${WRKSRC}/gcc-4.6.1/libjava/contrib/aotcompile.py.in stores the path to
+# a 'make' program so we need to make sure we give it the installed # 'make' and not
+# the tool wrapped one.
+CONFIGURE_ENV+=		PKGSRC_MAKE=${TOOLS_PATH.gmake}
+MAKE_ENV+=		PKGSRC_MAKE=${TOOLS_PATH.gmake}
+
+# fastjar-0.93 from pkgsrc/archivers/fastjar seems to trigger a build
+# failure (seen on NetBSD-5.0/i386) when building java.  So in case
+# the fastjar package is installed, make sure the configure script
+# doesn't pick it up.
+CONFIGURE_ENV+=		JAR=no
+MAKE_ENV+=		JAR=no
+MAKE_ENV+=		ac_cv_prog_JAR=no
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mgcc-objc++)
+.  if empty(PKG_OPTIONS:Mgcc-objc)
+PKG_OPTIONS+=		gcc-objc
+.  endif
+.  if empty(PKG_OPTIONS:Mgcc-c++)
+PKG_OPTIONS+=		gcc-c++
+.  endif
+
+LANGS+=			obj-c++
+.endif
+
+.if !empty(PKG_OPTIONS:Mgcc-c++)
+LANGS+=			c++
+USE_TOOLS+=		perl
+CONFIGURE_ARGS+=	--enable-__cxa_atexit
+CONFIGURE_ARGS+=	--with-gxx-include-dir=${GCC_PREFIX}/include/c++/
+.endif
+
+.if !empty(PKG_OPTIONS:Mgcc-fortran)
+LANGS+=			fortran
+.endif
+
+.if !empty(PKG_OPTIONS:Mgcc-objc)
+LANGS+=			objc
+.endif
+
+#.if !empty(PKG_OPTIONS:Mgcc-ada)
+#LANGS+=		ada
+#.endif
diff --git a/gcc45/patches/patch-aa b/gcc45/patches/patch-aa
new file mode 100644
index 0000000..d6a60e5
--- /dev/null
+++ b/gcc45/patches/patch-aa
@@ -0,0 +1,86 @@
+$NetBSD: patch-aa,v 1.2 2014/12/06 18:47:01 dholland Exp $
+
+- add dfly support
+- stdint fixes for netbsd x86
+- add svr4.h for netbsd ppc, per PR 49453 from Frank Wille
+
+--- gcc/config.gcc.orig	2011-02-27 01:06:15.000000000 +0000
++++ gcc/config.gcc
+@@ -499,6 +499,33 @@ case ${target} in
+   # need_64bit_hwint=yes # system compiler has this for all arch!
+   use_gcc_stdint=wrap
+   ;;
++*-*-dragonfly*)
++  gas=yes
++  gnu_ld=yes
++  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
++  case ${target} in
++    *-*-dragonfly1 | *-*-dragonfly[1].*)
++      tm_defines="${tm_defines} DFBSD_MAJOR=1" ;;
++    *-*-dragonfly2 | *-*-dragonfly[2].*)
++      tm_defines="${tm_defines} DFBSD_MAJOR=2" ;;
++    *-*-dragonfly3 | *-*-dragonfly[3].*)
++      tm_defines="${tm_defines} DFBSD_MAJOR=3" ;;
++    *-*-dragonfly4 | *-*-dragonfly[4].*)
++      tm_defines="${tm_defines} DFBSD_MAJOR=4" ;;
++    *)
++      echo 'Please update *-*-dragonfly* in gcc/config.gcc'
++      exit 1
++      ;;
++  esac
++  tmake_file="t-slibgcc-elf-ver t-dragonfly"
++  case ${enable_threads} in
++    "" | yes | posix)
++      thread_file='posix'
++      tmake_file="${tmake_file} t-dragonfly-thread"
++      ;;
++  esac
++  dfbsd_tm_file="${dfbsd_tm_file} dragonfly-spec.h dragonfly.h"
++  ;;
+ *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+   gas=yes
+@@ -572,6 +599,7 @@ case ${target} in
+       default_use_cxa_atexit=yes
+       ;;
+   esac
++  use_gcc_stdint=wrap
+   ;;
+ *-*-openbsd*)
+   tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
+@@ -1118,17 +1146,23 @@ 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"
+ 	tmake_file="${tmake_file} i386/t-crtstuff"
+ 	;;
++x86_64-*-dragonfly*)
++	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/x86-64.h i386/dragonfly.h i386/dragonfly64.h"
++	;;
++i[34567]86-*-dragonfly*)
++	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.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"
++	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"
+ 	;;
+ i[34567]86-*-netbsd*)
+-	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h"
++	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h netbsd-stdint.h"
+ 	tmake_file="${tmake_file} t-netbsd"
+ 	extra_parts=""
+ 	use_collect2=yes
+ 	;;
+ x86_64-*-netbsd*)
+-	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"
++	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"
+ 	tmake_file="${tmake_file} i386/t-crtstuff"
+ 	;;
+ i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
+@@ -1950,7 +1984,7 @@ powerpc*-*-freebsd*)
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	;;
+ powerpc-*-netbsd*)
+-	tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
++	tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+ 	tmake_file="${tmake_file} rs6000/t-netbsd"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	;;
diff --git a/gcc45/patches/patch-ab b/gcc45/patches/patch-ab
new file mode 100644
index 0000000..a1a46c9
--- /dev/null
+++ b/gcc45/patches/patch-ab
@@ -0,0 +1,24 @@
+$NetBSD: patch-ab,v 1.1.1.1 2011/05/14 20:19:47 wiz Exp $
+
+--- libgcc/config.host.orig	2010-04-01 23:02:18.000000000 -0400
++++ libgcc/config.host
+@@ -156,6 +156,8 @@ case ${host} in
+   # machine-specific sections may refine and add to this
+   # configuration.
+   ;;
++*-*-dragonfly*)
++  ;;
+ *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu*)
+   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+   ;;
+@@ -282,6 +284,10 @@ i[34567]86-*-freebsd*)
+ 	;;
+ x86_64-*-freebsd*)
+ 	;;
++i[34567]86-*-dragonfly*)
++	;;
++x86_64-*-dragonfly*)
++	;;
+ i[34567]86-*-netbsdelf*)
+ 	;;
+ i[34567]86-*-netbsd*)
diff --git a/gcc45/patches/patch-ac b/gcc45/patches/patch-ac
new file mode 100644
index 0000000..053e81d
--- /dev/null
+++ b/gcc45/patches/patch-ac
@@ -0,0 +1,17 @@
+$NetBSD: patch-ac,v 1.2 2014/05/08 02:03:58 pho Exp $
+
+Add gcc libdir to a programs rpath so that _this gcc's_ support
+libraries are found. Note that there must not be a whitespace between
+$(LINKER_RPATH_FLAG) and the path. Otherwise the flag may be
+misinterpreted by linker (e.g. Apple's ld).
+
+--- gcc/Makefile.in.orig	2004-06-17 15:56:58.000000000 -0600
++++ gcc/Makefile.in
+@@ -1944,6 +1944,7 @@ c-omp.o : c-omp.c $(CONFIG_H) $(SYSTEM_H
+ # Language-independent files.
+ 
+ DRIVER_DEFINES = \
++  -DLINK_LIBGCC_SPEC="\"%D $(LINKER_RPATH_FLAG)$(exec_prefix)/lib\"" \
+   -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
+   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+   -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
diff --git a/gcc45/patches/patch-ad b/gcc45/patches/patch-ad
new file mode 100644
index 0000000..a35c0bd
--- /dev/null
+++ b/gcc45/patches/patch-ad
@@ -0,0 +1,28 @@
+$NetBSD: patch-ad,v 1.3 2012/05/03 12:20:19 hans Exp $
+
+--- configure.orig	2010-04-02 13:35:47.000000000 -0400
++++ configure
+@@ -5395,7 +5395,7 @@ fi
+ 
+ 
+ if test "x$with_mpfr" != x; then
+-  gmplibs="-L$with_mpfr/lib $gmplibs"
++  gmplibs="-L$with_mpfr/lib ${COMPILER_RPATH_FLAG}$with_mpfr/lib $gmplibs"
+   gmpinc="-I$with_mpfr/include $gmpinc"
+ fi
+ if test "x$with_mpfr_include" != x; then
+@@ -5279,9 +5279,11 @@ if test "x$with_mpfr_lib" != x; then
+   gmplibs="-L$with_mpfr_lib $gmplibs"
+ fi
+ if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
+-  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir $gmplibs"
+-  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
+-  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr --with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr/'"$lt_cv_objdir"
++  sdir=
++  test -d "${srcdir}/mpfr/src" && sdir=/src
++  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir $gmplibs"
++  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr'"$sdir "'-I$$s/mpfr'"$sdir $gmpinc"
++  extra_mpc_mpfr_configure_flags='--with-mpfr-include=$$s/mpfr'"$sdir "'--with-mpfr-lib=$$r/$(HOST_SUBDIR)/mpfr'"$sdir/$lt_cv_objdir"
+   # Do not test the mpfr version.  Assume that it is sufficient, since
+   # it is in the source tree, and the library has not been built yet
+   # but it would be included on the link line in the version check below
diff --git a/gcc45/patches/patch-af b/gcc45/patches/patch-af
new file mode 100644
index 0000000..e3e4f0b
--- /dev/null
+++ b/gcc45/patches/patch-af
@@ -0,0 +1,16 @@
+$NetBSD: patch-af,v 1.1.1.1 2011/05/14 20:19:47 wiz Exp $
+
+Avoid a reference to the wrapped make in the pkgsrc work directory from showing up
+in an installed file.  See ${WRKDIR}/gcc-4.4.1/libjava/contrib/aotcompile.py.in
+
+--- libjava/configure.orig	2010-04-02 14:18:06.000000000 -0400
++++ libjava/configure
+@@ -24517,7 +24517,7 @@ $as_echo "Python modules dir: ${python_m
+ 
+ 
+ # needed for aot-compile-rpm
+-MAKE=`which make`
++MAKE=${PKGSRC_MAKE}
+ 
+ 
+ # Check whether --enable-aot-compile-rpm was given.
diff --git a/gcc45/patches/patch-ag b/gcc45/patches/patch-ag
new file mode 100644
index 0000000..0f1a5c1
--- /dev/null
+++ b/gcc45/patches/patch-ag
@@ -0,0 +1,29 @@
+$NetBSD: patch-ag,v 1.1.1.1 2011/05/14 20:19:47 wiz Exp $
+
+No need to use bash for this small script.
+
+Also -print0 is not portable to solaris and perhaps others.
+
+--- libjava/contrib/rebuild-gcj-db.in.orig	2008-07-02 09:17:54.000000000 -0400
++++ libjava/contrib/rebuild-gcj-db.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # rebuild-gcj-db
+ 
+ ## Copyright (C) 2000, 2002, 2003, 2008 Free Software Foundation
+@@ -16,12 +16,12 @@ for i in `@prefix@/bin/gcc --print-multi
+    base=@prefix@/lib/$dirname
+    dbLocation=`@prefix@/bin/gcj-dbtool -p $base`
+    libdir=$base/gcj
+-   if ! test -d $libdir; then
++   if test ! -d $libdir; then
+       # No shared libraries here.
+       continue
+    fi
+    dirname $dbLocation | xargs mkdir -p
+    @prefix@/bin/gcj-dbtool -n $dbLocation 64
+-   find $libdir -follow -name '*.db' -print0 | \
++   find $libdir -follow -name '*.db' -print | @AWK@ '{printf("%s%c", $1, 0);}' | \
+       @prefix@/bin/gcj-dbtool -0 -m $dbLocation $dbLocation
+ done
diff --git a/gcc45/patches/patch-ah b/gcc45/patches/patch-ah
new file mode 100644
index 0000000..fbf9318
--- /dev/null
+++ b/gcc45/patches/patch-ah
@@ -0,0 +1,22 @@
+$NetBSD: patch-ah,v 1.1.1.1 2011/05/14 20:19:47 wiz Exp $
+
+--- gcc/fortran/f95-lang.c.orig	2010-06-15 14:17:16.000000000 +0200
++++ gcc/fortran/f95-lang.c
+@@ -794,10 +794,17 @@
+ 
+   gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, 
+ 		      BUILT_IN_CABSL, "cabsl", true);
++#if defined(__NetBSD__)
++  gfc_define_builtin ("__builtin_cabs", func_cdouble_double, 
++		      BUILT_IN_CABS, "__c99_cabs", true);
++  gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, 
++		      BUILT_IN_CABSF, "__c99_cabsf", true);
++#else
+   gfc_define_builtin ("__builtin_cabs", func_cdouble_double, 
+ 		      BUILT_IN_CABS, "cabs", true);
+   gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, 
+ 		      BUILT_IN_CABSF, "cabsf", true);
++#endif
+  
+   gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], 
+ 		      BUILT_IN_COPYSIGNL, "copysignl", true);
diff --git a/gcc45/patches/patch-aj b/gcc45/patches/patch-aj
new file mode 100644
index 0000000..c8cc10e
--- /dev/null
+++ b/gcc45/patches/patch-aj
@@ -0,0 +1,46 @@
+$NetBSD: patch-aj,v 1.3 2013/04/29 21:34:49 joerg Exp $
+
+--- libstdc++-v3/config/os/bsd/netbsd/ctype_base.h.orig	2009-04-09 15:00:19.000000000 +0000
++++ libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
+@@ -41,6 +41,33 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
+ 
+     // NB: Offsets into ctype<char>::_M_table force a particular size
+     // on the mask type. Because of this, we don't use an enum.
++#if defined(_CTYPE_BL)
++    typedef unsigned short      mask;
++    static const mask upper     = _CTYPE_U;
++    static const mask lower     = _CTYPE_L;
++    static const mask alpha     = _CTYPE_A;
++    static const mask digit     = _CTYPE_D;
++    static const mask xdigit    = _CTYPE_X;
++    static const mask space     = _CTYPE_S;
++    static const mask print     = _CTYPE_R;
++    static const mask graph     = _CTYPE_G;
++    static const mask cntrl     = _CTYPE_C;
++    static const mask punct     = _CTYPE_P;
++    static const mask alnum     = _CTYPE_A | _CTYPE_D;
++#elif defined(_CTYPE_U)
++    typedef unsigned char      	mask;
++    static const mask upper    	= _CTYPE_U;
++    static const mask lower 	= _CTYPE_L;
++    static const mask alpha 	= _CTYPE_U | _CTYPE_L;
++    static const mask digit 	= _CTYPE_N;
++    static const mask xdigit 	= _CTYPE_N | _CTYPE_X;
++    static const mask space 	= _CTYPE_S;
++    static const mask print 	= _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
++    static const mask graph 	= _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
++    static const mask cntrl 	= _CTYPE_C;
++    static const mask punct 	= _CTYPE_P;
++    static const mask alnum 	= _CTYPE_U | _CTYPE_L | _CTYPE_N;
++#else
+     typedef unsigned char      	mask;
+     static const mask upper    	= _U;
+     static const mask lower 	= _L;
+@@ -53,6 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
+     static const mask cntrl 	= _C;
+     static const mask punct 	= _P;
+     static const mask alnum 	= _U | _L | _N;
++#endif
+   };
+ 
+ _GLIBCXX_END_NAMESPACE
diff --git a/gcc45/patches/patch-ak b/gcc45/patches/patch-ak
new file mode 100644
index 0000000..e808c16
--- /dev/null
+++ b/gcc45/patches/patch-ak
@@ -0,0 +1,16 @@
+$NetBSD: patch-ak,v 1.1.1.1 2011/05/14 20:19:47 wiz Exp $
+
+--- gcc/ginclude/stddef.h.orig	2011-03-03 15:35:00.000000000 +0000
++++ gcc/ginclude/stddef.h
+@@ -53,6 +53,11 @@ see the files COPYING3 and COPYING.RUNTI
+    one less case to deal with in the following.  */
+ #if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
+ #include <machine/ansi.h>
++#if !defined(_MACHINE_ANSI_H_)
++#if defined(_I386_ANSI_H_) || defined(_X86_64_ANSI_H_)
++#define _MACHINE_ANSI_H_
++#endif
++#endif
+ #endif
+ /* On FreeBSD 5, machine/ansi.h does not exist anymore... */
+ #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
diff --git a/gcc45/patches/patch-gcc_config_netbsd.h b/gcc45/patches/patch-gcc_config_netbsd.h
new file mode 100644
index 0000000..782a607
--- /dev/null
+++ b/gcc45/patches/patch-gcc_config_netbsd.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-gcc_config_netbsd.h,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+when using shared, link against libc.
+
+--- gcc/config/netbsd.h.orig	2013-01-10 20:38:27.000000000 +0000
++++ gcc/config/netbsd.h
+@@ -96,6 +96,7 @@ along with GCC; see the file COPYING3.  
+        %{!pg:-lposix}}		\
+      %{p:-lposix_p}		\
+      %{pg:-lposix_p}}		\
++   %{shared:-lc}		\
+    %{!shared:			\
+      %{!symbolic:		\
+        %{!p:			\
+@@ -109,6 +110,7 @@ along with GCC; see the file COPYING3.  
+        %{!pg:-lposix}}		\
+      %{p:-lposix_p}		\
+      %{pg:-lposix_p}}		\
++   %{shared:-lc}		\
+    %{!shared:			\
+      %{!symbolic:		\
+        %{!p:			\
diff --git a/gcc45/patches/patch-gcc_doc_cppopts.texi b/gcc45/patches/patch-gcc_doc_cppopts.texi
new file mode 100644
index 0000000..bbdc657
--- /dev/null
+++ b/gcc45/patches/patch-gcc_doc_cppopts.texi
@@ -0,0 +1,15 @@
+$NetBSD: patch-gcc_doc_cppopts.texi,v 1.1 2014/03/26 11:07:27 jperkin Exp $
+
+Texinfo 5 compatibility.
+
+--- gcc/doc/cppopts.texi.orig	2010-04-02 19:54:46.000000000 +0000
++++ gcc/doc/cppopts.texi
+@@ -760,7 +760,7 @@ Replacement:      [    ]    @{    @}    
+ Enable special code to work around file systems which only permit very
+ short file names, such as MS-DOS@.
+ 
+-@itemx --help
++@item --help
+ @itemx --target-help
+ @opindex help
+ @opindex target-help
diff --git a/gcc45/patches/patch-gcc_doc_generic.texi b/gcc45/patches/patch-gcc_doc_generic.texi
new file mode 100644
index 0000000..d7a825d
--- /dev/null
+++ b/gcc45/patches/patch-gcc_doc_generic.texi
@@ -0,0 +1,22 @@
+$NetBSD: patch-gcc_doc_generic.texi,v 1.1 2014/03/26 11:07:27 jperkin Exp $
+
+Texinfo 5 compatibility.
+
+--- gcc/doc/generic.texi.orig	2010-07-06 20:23:53.000000000 +0000
++++ gcc/doc/generic.texi
+@@ -1407,13 +1407,13 @@ generate these expressions anyhow, if it
+ not matter.  The type of the operands and that of the result are
+ always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
+ 
+-@itemx POINTER_PLUS_EXPR
++@item POINTER_PLUS_EXPR
+ This node represents pointer arithmetic.  The first operand is always
+ a pointer/reference type.  The second operand is always an unsigned
+ integer type compatible with sizetype.  This is the only binary
+ arithmetic operand that can operate on pointer types.
+ 
+-@itemx PLUS_EXPR
++@item PLUS_EXPR
+ @itemx MINUS_EXPR
+ @itemx MULT_EXPR
+ These nodes represent various binary arithmetic operations.
diff --git a/gcc45/patches/patch-gcc_doc_invoke.texi b/gcc45/patches/patch-gcc_doc_invoke.texi
new file mode 100644
index 0000000..58d2d64
--- /dev/null
+++ b/gcc45/patches/patch-gcc_doc_invoke.texi
@@ -0,0 +1,61 @@
+$NetBSD: patch-gcc_doc_invoke.texi,v 1.1 2014/03/26 11:07:27 jperkin Exp $
+
+Texinfo 5 compatibility.
+
+--- gcc/doc/invoke.texi.orig	2011-03-23 22:03:29.000000000 +0000
++++ gcc/doc/invoke.texi
+@@ -4875,11 +4875,11 @@ Dump after duplicating the computed goto
+ @option{-fdump-rtl-ce3} enable dumping after the three
+ if conversion passes.
+ 
+-@itemx -fdump-rtl-cprop_hardreg
++@item -fdump-rtl-cprop_hardreg
+ @opindex fdump-rtl-cprop_hardreg
+ Dump after hard register copy propagation.
+ 
+-@itemx -fdump-rtl-csa
++@item -fdump-rtl-csa
+ @opindex fdump-rtl-csa
+ Dump after combining stack adjustments.
+ 
+@@ -4890,11 +4890,11 @@ Dump after combining stack adjustments.
+ @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
+ the two common sub-expression elimination passes.
+ 
+-@itemx -fdump-rtl-dce
++@item -fdump-rtl-dce
+ @opindex fdump-rtl-dce
+ Dump after the standalone dead code elimination passes.
+ 
+-@itemx -fdump-rtl-dbr
++@item -fdump-rtl-dbr
+ @opindex fdump-rtl-dbr
+ Dump after delayed branch scheduling.
+ 
+@@ -4939,7 +4939,7 @@ Dump after the initialization of the reg
+ @opindex fdump-rtl-initvals
+ Dump after the computation of the initial value sets.
+ 
+-@itemx -fdump-rtl-into_cfglayout
++@item -fdump-rtl-into_cfglayout
+ @opindex fdump-rtl-into_cfglayout
+ Dump after converting to cfglayout mode.
+ 
+@@ -4969,7 +4969,7 @@ Dump after removing redundant mode switc
+ @opindex fdump-rtl-rnreg
+ Dump after register renumbering.
+ 
+-@itemx -fdump-rtl-outof_cfglayout
++@item -fdump-rtl-outof_cfglayout
+ @opindex fdump-rtl-outof_cfglayout
+ Dump after converting from cfglayout mode.
+ 
+@@ -4981,7 +4981,7 @@ Dump after the peephole pass.
+ @opindex fdump-rtl-postreload
+ Dump after post-reload optimizations.
+ 
+-@itemx -fdump-rtl-pro_and_epilogue
++@item -fdump-rtl-pro_and_epilogue
+ @opindex fdump-rtl-pro_and_epilogue
+ Dump after generating the function pro and epilogues.
+ 
diff --git a/gcc45/patches/patch-include_libiberty.h b/gcc45/patches/patch-include_libiberty.h
new file mode 100644
index 0000000..13e27c3
--- /dev/null
+++ b/gcc45/patches/patch-include_libiberty.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-include_libiberty.h,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+Don't use PARAMS
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- include/libiberty.h.orig	2011-01-03 20:52:22.000000000 +0000
++++ include/libiberty.h
+@@ -85,11 +85,11 @@ extern char **dupargv (char **) ATTRIBUT
+ 
+ /* Expand "@file" arguments in argv.  */
+ 
+-extern void expandargv PARAMS ((int *, char ***));
++extern void expandargv (int *, char ***);
+ 
+ /* Write argv to an @-file, inserting necessary quoting.  */
+ 
+-extern int writeargv PARAMS ((char **, FILE *));
++extern int writeargv (char **, FILE *);
+ 
+ /* Return the last component of a path name.  Note that we can't use a
+    prototype here because the parameter is declared inconsistently
diff --git a/gcc45/patches/patch-libgcc_config_t-slibgcc-darwin b/gcc45/patches/patch-libgcc_config_t-slibgcc-darwin
new file mode 100644
index 0000000..d786fb4
--- /dev/null
+++ b/gcc45/patches/patch-libgcc_config_t-slibgcc-darwin
@@ -0,0 +1,26 @@
+$NetBSD: patch-libgcc_config_t-slibgcc-darwin,v 1.1 2014/05/08 10:14:46 pho Exp $
+
+If we don't install libgcc_s.10.[45].dylib, our gcc links binaries
+with *both* /usr/lib/libgcc_s.1.dylib and
+${GCC_PREFIX}/lib/libgcc_s.1.dylib, which is certainly a bad thing.
+
+The problem was already reported to the upstream but it caught
+seemingly no attention:
+http://gcc.gnu.org/ml/gcc-help/2010-07/msg00164.html
+
+--- libgcc/config/t-slibgcc-darwin.orig	2010-02-02 08:18:48.000000000 +0000
++++ libgcc/config/t-slibgcc-darwin
+@@ -26,13 +26,7 @@ SHLIB_MKMAP = $(gcc_srcdir)/mkmap-flat.a
+ SHLIB_MKMAP_OPTS = -v leading_underscore=1
+ SHLIB_MAPFILES += $(gcc_srcdir)/libgcc-std.ver $(gcc_srcdir)/libgcc-libsystem.ver
+ 
+-# we're only going to build the stubs if the target slib is /usr/lib
+-# there is no other case in which they're useful in a live system.
+-ifeq (/usr/lib,$(shlib_slibdir))
+ LGCC_STUBS = libgcc_s.10.4.dylib libgcc_s.10.5.dylib
+-else
+-LGCC_STUBS =
+-endif
+ 
+ LGCC_FILES = libgcc_s.$(SHLIB_SOVERSION)$(SHLIB_EXT)
+ LGCC_FILES += $(LGCC_STUBS)
diff --git a/gcc45/patches/patch-libiberty___doprnt.c b/gcc45/patches/patch-libiberty___doprnt.c
new file mode 100644
index 0000000..9f29022
--- /dev/null
+++ b/gcc45/patches/patch-libiberty___doprnt.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-libiberty___doprnt.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/_doprnt.c.orig	2005-05-10 15:33:18.000000000 +0000
++++ libiberty/_doprnt.c
+@@ -222,11 +222,11 @@ static int
+ checkit (const char* format, ...)
+ {
+   int result;
+-  VA_OPEN (args, format);
+-  VA_FIXEDARG (args, char *, format);
++  va_list args;
++  va_start (args, format);
+ 
+   result = _doprnt (format, args, stdout);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return result;
+ }
diff --git a/gcc45/patches/patch-libiberty_asprintf.c b/gcc45/patches/patch-libiberty_asprintf.c
new file mode 100644
index 0000000..8487ad11
--- /dev/null
+++ b/gcc45/patches/patch-libiberty_asprintf.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-libiberty_asprintf.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/asprintf.c.orig	2005-05-10 15:33:18.000000000 +0000
++++ libiberty/asprintf.c
+@@ -47,10 +47,9 @@ int
+ asprintf (char **buf, const char *fmt, ...)
+ {
+   int status;
+-  VA_OPEN (ap, fmt);
+-  VA_FIXEDARG (ap, char **, buf);
+-  VA_FIXEDARG (ap, const char *, fmt);
++  va_list ap;
++  va_start (ap, fmt);
+   status = vasprintf (buf, fmt, ap);
+-  VA_CLOSE (ap);
++  va_end (ap);
+   return status;
+ }
diff --git a/gcc45/patches/patch-libiberty_concat.c b/gcc45/patches/patch-libiberty_concat.c
new file mode 100644
index 0000000..a432433
--- /dev/null
+++ b/gcc45/patches/patch-libiberty_concat.c
@@ -0,0 +1,108 @@
+$NetBSD: patch-libiberty_concat.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/concat.c.orig	2011-02-03 07:23:20.000000000 +0000
++++ libiberty/concat.c
+@@ -102,11 +90,11 @@ unsigned long
+ concat_length (const char *first, ...)
+ {
+   unsigned long length;
++  va_list args;
+ 
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   length = vconcat_length (first, args);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return length;
+ }
+@@ -117,13 +105,12 @@ char *
+ concat_copy (char *dst, const char *first, ...)
+ {
+   char *save_dst;
++  va_list args;
+ 
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, char *, dst);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   vconcat_copy (dst, first, args);
+   save_dst = dst; /* With K&R C, dst goes out of scope here.  */
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return save_dst;
+ }
+@@ -141,10 +128,10 @@ char *libiberty_concat_ptr;
+ char *
+ concat_copy2 (const char *first, ...)
+ {
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, const char *, first);
++  va_list args;
++  va_start (args, first);
+   vconcat_copy (libiberty_concat_ptr, first, args);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return libiberty_concat_ptr;
+ }
+@@ -153,18 +140,17 @@ char *
+ concat (const char *first, ...)
+ {
+   char *newstr;
++  va_list args;
+ 
+   /* First compute the size of the result and get sufficient memory.  */
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   newstr = XNEWVEC (char, vconcat_length (first, args) + 1);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   /* Now copy the individual pieces to the result string. */
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   vconcat_copy (newstr, first, args);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return newstr;
+ }
+@@ -191,22 +177,19 @@ char *
+ reconcat (char *optr, const char *first, ...)
+ {
+   char *newstr;
++  va_list args;
+ 
+   /* First compute the size of the result and get sufficient memory.  */
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, char *, optr);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   newstr = XNEWVEC (char, vconcat_length (first, args) + 1);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   /* Now copy the individual pieces to the result string. */
+-  VA_OPEN (args, first);
+-  VA_FIXEDARG (args, char *, optr);
+-  VA_FIXEDARG (args, const char *, first);
++  va_start (args, first);
+   vconcat_copy (newstr, first, args);
+   if (optr) /* Done before VA_CLOSE so optr stays in scope for K&R C.  */
+     free (optr);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   return newstr;
+ }
diff --git a/gcc45/patches/patch-libiberty_snprintf.c b/gcc45/patches/patch-libiberty_snprintf.c
new file mode 100644
index 0000000..7076d0d
--- /dev/null
+++ b/gcc45/patches/patch-libiberty_snprintf.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-libiberty_snprintf.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/snprintf.c.orig	2011-02-03 07:23:20.000000000 +0000
++++ libiberty/snprintf.c
+@@ -53,11 +53,9 @@ int
+ snprintf (char *s, size_t n, const char *format, ...)
+ {
+   int result;
+-  VA_OPEN (ap, format);
+-  VA_FIXEDARG (ap, char *, s);
+-  VA_FIXEDARG (ap, size_t, n);
+-  VA_FIXEDARG (ap, const char *, format);
++  va_list ap;
++  va_start (ap, format);
+   result = vsnprintf (s, n, format, ap);
+-  VA_CLOSE (ap);
++  va_end (ap);
+   return result;
+ }
diff --git a/gcc45/patches/patch-libiberty_vasprintf.c b/gcc45/patches/patch-libiberty_vasprintf.c
new file mode 100644
index 0000000..0686d80
--- /dev/null
+++ b/gcc45/patches/patch-libiberty_vasprintf.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-libiberty_vasprintf.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/vasprintf.c.orig	2011-02-03 07:23:20.000000000 +0000
++++ libiberty/vasprintf.c
+@@ -165,10 +165,10 @@ static void ATTRIBUTE_PRINTF_1
+ checkit (const char *format, ...)
+ {
+   char *result;
+-  VA_OPEN (args, format);
+-  VA_FIXEDARG (args, const char *, format);
++  va_list args;
++  va_start (args, format);
+   vasprintf (&result, format, args);
+-  VA_CLOSE (args);
++  va_end (args);
+ 
+   if (strlen (result) < (size_t) global_total_width)
+     printf ("PASS: ");
diff --git a/gcc45/patches/patch-libiberty_vsnprintf.c b/gcc45/patches/patch-libiberty_vsnprintf.c
new file mode 100644
index 0000000..043b5ad
--- /dev/null
+++ b/gcc45/patches/patch-libiberty_vsnprintf.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-libiberty_vsnprintf.c,v 1.1 2016/09/10 13:59:31 maya Exp $
+
+use stdarg, not VA_* macros.
+cherry picked necessary parts from
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881
+
+fixes PR pkg/50042
+
+--- libiberty/vsnprintf.c.orig	2011-02-03 07:23:20.000000000 +0000
++++ libiberty/vsnprintf.c
+@@ -95,12 +95,10 @@ static int ATTRIBUTE_PRINTF_3
+ checkit (char *s, size_t n, const char *format, ...)
+ {
+   int result;
+-  VA_OPEN (ap, format);
+-  VA_FIXEDARG (ap, char *, s);
+-  VA_FIXEDARG (ap, size_t, n);
+-  VA_FIXEDARG (ap, const char *, format);
++  va_list ap;
++  va_start (ap, format);
+   result = vsnprintf (s, n, format, ap);
+-  VA_CLOSE (ap);
++  va_end (ap);
+   return result;
+ }
+ 
diff --git a/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h b/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h
new file mode 100644
index 0000000..3346b16
--- /dev/null
+++ b/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-libstdc++-v3_config_os_bsd_netbsd_ctype__inline.h,v 1.1 2013/04/29 21:34:49 joerg Exp $
+
+--- libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h.orig	2009-04-09 15:00:19.000000000 +0000
++++ libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h
+@@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
+   is(const char* __low, const char* __high, mask* __vec) const
+   {
+     while (__low < __high)
+-      *__vec++ = _M_table[*__low++];
++      *__vec++ = _M_table[(unsigned char)*__low++];
+     return __high;
+   }
+ 
diff --git a/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h b/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h
new file mode 100644
index 0000000..4ab8aca
--- /dev/null
+++ b/gcc45/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h
@@ -0,0 +1,57 @@
+$NetBSD: patch-libstdc++-v3_config_os_bsd_netbsd_ctype__noninline.h,v 1.1 2013/04/29 21:34:49 joerg Exp $
+
+--- libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h.orig	2009-04-09 15:00:19.000000000 +0000
++++ libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
+@@ -33,11 +33,17 @@
+   
+ // Information as gleaned from /usr/include/ctype.h
+ 
++#ifndef _CTYPE_BL
+   extern "C" const u_int8_t _C_ctype_[];
++#endif
+ 
+   const ctype_base::mask*
+   ctype<char>::classic_table() throw()
+-  { return _C_ctype_ + 1; }
++#ifdef _CTYPE_BL
++  { return _C_ctype_tab_ + 1; }
++#else
++   { return _C_ctype_ + 1; }
++#endif
+ 
+   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+ 		     size_t __refs) 
+@@ -64,14 +70,14 @@
+ 
+   char
+   ctype<char>::do_toupper(char __c) const
+-  { return ::toupper((int) __c); }
++  { return ::toupper((int)(unsigned char) __c); }
+ 
+   const char*
+   ctype<char>::do_toupper(char* __low, const char* __high) const
+   {
+     while (__low < __high)
+       {
+-	*__low = ::toupper((int) *__low);
++	*__low = ::toupper((int)(unsigned char) *__low);
+ 	++__low;
+       }
+     return __high;
+@@ -79,14 +85,14 @@
+ 
+   char
+   ctype<char>::do_tolower(char __c) const
+-  { return ::tolower((int) __c); }
++  { return ::tolower((int)(unsigned char) __c); }
+ 
+   const char* 
+   ctype<char>::do_tolower(char* __low, const char* __high) const
+   {
+     while (__low < __high)
+       {
+-	*__low = ::tolower((int) *__low);
++	*__low = ::tolower((int)(unsigned char) *__low);
+ 	++__low;
+       }
+     return __high;


Home | Main Index | Thread Index | Old Index