Wed Apr 22 18:59:54 2009 UTC ()
Hack it to work on DragonFly.


(hasso)
diff -r1.40 -r1.41 pkgsrc/lang/gcc34/Makefile
diff -r1.18 -r1.19 pkgsrc/lang/gcc34/distinfo
diff -r0 -r1.1 pkgsrc/lang/gcc34/files/dragonfly-spec.h
diff -r0 -r1.1 pkgsrc/lang/gcc34/files/dragonfly.h
diff -r0 -r1.1 pkgsrc/lang/gcc34/files/i386-dragonfly.h
diff -r0 -r1.1 pkgsrc/lang/gcc34/files/i386-dragonfly64.h
diff -r0 -r1.1 pkgsrc/lang/gcc34/patches/patch-aa
diff -r0 -r1.1 pkgsrc/lang/gcc34/patches/patch-ab
diff -r1.1 -r1.2 pkgsrc/lang/gcc34/patches/patch-at

cvs diff -r1.40 -r1.41 pkgsrc/lang/gcc34/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/gcc34/Attic/Makefile 2007/10/25 21:04:22 1.40
+++ pkgsrc/lang/gcc34/Attic/Makefile 2009/04/22 18:59:54 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.40 2007/10/25 21:04:22 jlam Exp $ 1# $NetBSD: Makefile,v 1.41 2009/04/22 18:59:54 hasso Exp $
2# 2#
3 3
4DISTNAME= gcc-${GCC_VERSION} 4DISTNAME= gcc-${GCC_VERSION}
5PKGNAME= gcc34-${GCC_VERSION} 5PKGNAME= gcc34-${GCC_VERSION}
6PKGREVISION= 1 6PKGREVISION= 1
7CATEGORIES= lang 7CATEGORIES= lang
8MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/} 8MASTER_SITES= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VERSION}/}
9EXTRACT_SUFX= .tar.bz2 9EXTRACT_SUFX= .tar.bz2
10 10
11MAINTAINER= shannonjr@NetBSD.org 11MAINTAINER= shannonjr@NetBSD.org
12HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html 12HOMEPAGE= http://www.gnu.org/software/gcc/gcc.html
13COMMENT= This is the gcc 3.4 compiler 13COMMENT= This is the gcc 3.4 compiler
14 14
@@ -80,26 +80,32 @@ LANGS+='java' @@ -80,26 +80,32 @@ LANGS+='java'
80.if !empty(BUILD_OBJC:M[Yy][Ee][Ss]) 80.if !empty(BUILD_OBJC:M[Yy][Ee][Ss])
81LANGS+='objc' 81LANGS+='objc'
82.endif 82.endif
83CONFIGURE_ARGS+= --enable-languages=${LANGS:Q} 83CONFIGURE_ARGS+= --enable-languages=${LANGS:Q}
84CONFIGURE_ARGS+= --with-system-zlib 84CONFIGURE_ARGS+= --with-system-zlib
85CONFIGURE_ARGS+= --enable-shared 85CONFIGURE_ARGS+= --enable-shared
86CONFIGURE_ARGS+= --enable-__cxa_atexit 86CONFIGURE_ARGS+= --enable-__cxa_atexit
87CONFIGURE_ARGS+= --enable-long-long 87CONFIGURE_ARGS+= --enable-long-long
88CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q} 88CONFIGURE_ARGS+= --with-local-prefix=${GCC_PREFIX:Q}
89CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv} 89CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
90MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv} 90MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv}
91MAKE_ENV+= SHELL=${CONFIG_SHELL} 91MAKE_ENV+= SHELL=${CONFIG_SHELL}
92 92
 93# FIXME Because gcc ignores rpath for some reason, it breaks on DragonFly -
 94# binaries are linked against libintl. Disabling NLS for now.
 95.if ${OPSYS} == "DragonFly"
 96CONFIGURE_ARGS+= --disable-nls
 97.endif
 98
93UNLIMIT_RESOURCES+= datasize 99UNLIMIT_RESOURCES+= datasize
94 100
95.if !empty(BUILD_F77:M[Yy][Ee][Ss]) 101.if !empty(BUILD_F77:M[Yy][Ee][Ss])
96.include "../../devel/gmp/buildlink3.mk" 102.include "../../devel/gmp/buildlink3.mk"
97CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp} 103CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_PREFIX.gmp}
98USE_TOOLS+= chmod 104USE_TOOLS+= chmod
99MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q} 105MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q}
100.endif 106.endif
101 107
102# GNU pth is useless here 108# GNU pth is useless here
103.if !empty(BUILD_ADA:M[Yy][Ee][Ss]) 109.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
104# ADA tasking strictly requires native threads 110# ADA tasking strictly requires native threads
105PTHREAD_OPTS+= require native 111PTHREAD_OPTS+= require native
@@ -185,26 +191,32 @@ pre-configure: @@ -185,26 +191,32 @@ pre-configure:
185 (cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \ 191 (cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \
186 cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .) 192 cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .)
187 (cd ${ALT_GCC:H} && \ 193 (cd ${ALT_GCC:H} && \
188 bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \ 194 bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \
189 cd ${WRKDIR}/.gcc/bin/ && \ 195 cd ${WRKDIR}/.gcc/bin/ && \
190 for filename in ${ALT_GCC:T} $${bin_files} ; do \ 196 for filename in ${ALT_GCC:T} $${bin_files} ; do \
191 ${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \ 197 ${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \
192 ${ECHO} -n "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \ 198 ${ECHO} -n "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \
193 ${ECHO} '"$$@"' >>$${filename}; \ 199 ${ECHO} '"$$@"' >>$${filename}; \
194 ${CHMOD} +x $${filename}; \ 200 ${CHMOD} +x $${filename}; \
195 done ) 201 done )
196. endif 202. endif
197.endif 203.endif
 204.if ${OPSYS} == "DragonFly"
 205 ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/gcc/config/dragonfly.h
 206 ${CP} ${FILESDIR}/dragonfly-spec.h ${WRKSRC}/gcc/config/dragonfly-spec.h
 207 ${CP} ${FILESDIR}/i386-dragonfly.h ${WRKSRC}/gcc/config/i386/dragonfly.h
 208 ${CP} ${FILESDIR}/i386-dragonfly64.h ${WRKSRC}/gcc/config/i386/dragonfly64.h
 209.endif
198 210
199do-configure: 211do-configure:
200 ${MKDIR} ${WRKDIR}/obj 212 ${MKDIR} ${WRKDIR}/obj
201 cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS} 213 cd ${WRKDIR}/obj; ${SETENV} ${CONFIGURE_ENV} ${CONFIG_SHELL} ${WRKSRC}/configure ${CONFIGURE_ARGS}
202 214
203do-build: 215do-build:
204 (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} bootstrap) 216 (${_ULIMIT_CMD} cd ${WRKDIR}/obj && ${SETENV} ${MAKE_ENV} ${GMAKE} bootstrap)
205.if !empty(BUILD_ADA:M[Yy][Ee][Ss]) 217.if !empty(BUILD_ADA:M[Yy][Ee][Ss])
206 (${_ULIMIT_CMD} cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib-shared) 218 (${_ULIMIT_CMD} cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib-shared)
207 (${_ULIMIT_CMD} cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib_and_tools) 219 (${_ULIMIT_CMD} cd ${WRKDIR}/obj/gcc && ${SETENV} ${MAKE_ENV} ${GMAKE} gnatlib_and_tools)
208.endif 220.endif
209 221
210do-test: 222do-test:

cvs diff -r1.18 -r1.19 pkgsrc/lang/gcc34/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/gcc34/Attic/distinfo 2009/03/30 10:57:02 1.18
+++ pkgsrc/lang/gcc34/Attic/distinfo 2009/04/22 18:59:54 1.19
@@ -1,19 +1,21 @@ @@ -1,19 +1,21 @@
1$NetBSD: distinfo,v 1.18 2009/03/30 10:57:02 markd Exp $ 1$NetBSD: distinfo,v 1.19 2009/04/22 18:59:54 hasso Exp $
2 2
3SHA1 (gcc-3.4.6.tar.bz2) = 97b290fdc572c8e490b3b39f243e69bacad23c2b 3SHA1 (gcc-3.4.6.tar.bz2) = 97b290fdc572c8e490b3b39f243e69bacad23c2b
4RMD160 (gcc-3.4.6.tar.bz2) = b15003368cedc7964f6ceaee0c39ddc43a46c442 4RMD160 (gcc-3.4.6.tar.bz2) = b15003368cedc7964f6ceaee0c39ddc43a46c442
5Size (gcc-3.4.6.tar.bz2) = 28193401 bytes 5Size (gcc-3.4.6.tar.bz2) = 28193401 bytes
 6SHA1 (patch-aa) = 40ba26c4af81ecc0effce3b7ac3c74bdfe4b56a6
 7SHA1 (patch-ab) = 50345471e99264104e136acd7c09da0a5275cb62
6SHA1 (patch-ae) = 928fa6155e614ca85b02359cf893d6c62231b192 8SHA1 (patch-ae) = 928fa6155e614ca85b02359cf893d6c62231b192
7SHA1 (patch-af) = cdd6b0d13c557996cb6582d7fa5dc651d37ee0ee 9SHA1 (patch-af) = cdd6b0d13c557996cb6582d7fa5dc651d37ee0ee
8SHA1 (patch-ag) = beee5294d387faafa640ab048823499da629e715 10SHA1 (patch-ag) = beee5294d387faafa640ab048823499da629e715
9SHA1 (patch-ah) = 3b3471f42e801f8588c1e0959d5cfa704ce16a3e 11SHA1 (patch-ah) = 3b3471f42e801f8588c1e0959d5cfa704ce16a3e
10SHA1 (patch-ai) = 78320fde6d073cb4bc87b281b83168f173344341 12SHA1 (patch-ai) = 78320fde6d073cb4bc87b281b83168f173344341
11SHA1 (patch-aj) = ea0bef88be9e823ed2acfa54a59f29016de8cc5e 13SHA1 (patch-aj) = ea0bef88be9e823ed2acfa54a59f29016de8cc5e
12SHA1 (patch-ak) = 1188e98e65fce3b968f9a2c211ffe315644d87d5 14SHA1 (patch-ak) = 1188e98e65fce3b968f9a2c211ffe315644d87d5
13SHA1 (patch-al) = 3368a43981499dd46b2caa111eae19a0549d7499 15SHA1 (patch-al) = 3368a43981499dd46b2caa111eae19a0549d7499
14SHA1 (patch-am) = 5a27d8f6a289f9b110a4bdc640547e43b799f08c 16SHA1 (patch-am) = 5a27d8f6a289f9b110a4bdc640547e43b799f08c
15SHA1 (patch-at) = a8a310b85e661bbf2cb832027b84b72c1db27a0c 17SHA1 (patch-at) = f74c2cd4919c59c0591e5aac7fdf8bb20fb87b96
16SHA1 (patch-ba) = 6fc03fc155f630329f7dc831eece6b6464b453a6 18SHA1 (patch-ba) = 6fc03fc155f630329f7dc831eece6b6464b453a6
17SHA1 (patch-bb) = aa088194fb073fcde8d2f558ed55ec36106d60d0 19SHA1 (patch-bb) = aa088194fb073fcde8d2f558ed55ec36106d60d0
18SHA1 (patch-ca) = e04ff912406505abd015789f288ef09a7e1ae386 20SHA1 (patch-ca) = e04ff912406505abd015789f288ef09a7e1ae386
19SHA1 (patch-cc) = 0af9845a62f9a6f8ec27657d0ae0c16394e9fc12 21SHA1 (patch-cc) = 0af9845a62f9a6f8ec27657d0ae0c16394e9fc12

File Added: pkgsrc/lang/gcc34/files/Attic/dragonfly-spec.h
/* Base configuration file for all FreeBSD 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 
   David O'Brien <obrien@FreeBSD.org>
   Loren J. Rittle <ljrittle@acm.org>.  */


/* In case we need to know.  */
#define USING_CONFIG_DRAGONFLY_SPEC 1

/* This defines which switch letters take arguments.  On DragonFly, most of
   the normal cases (defined in gcc.c) apply, and we also have -h* and
   -z* options (for the linker) (coming from SVR4).
   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */

#define 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 == 4)						\
	  builtin_define ("__DragonFly__=4");			       	\
	else if (DFBSD_MAJOR == 3)					\
	  builtin_define ("__DragonFly__=3");			       	\
	if (DFBSD_MAJOR == 2)						\
	  builtin_define ("__DragonFly__=2");			       	\
	else if (DFBSD_MAJOR == 1)					\
	  builtin_define ("__DragonFly__=1");			       	\
	else								\
	  builtin_define ("__DragonFly__");			       	\
	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. */

/* Provide a LIB_SPEC appropriate for DragonFly.  Just select the appropriate
   libc, depending on whether we're doing profiling or need threads support.
   (similar to the default, except no -lg, and no -p).  */

#ifdef 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.}			\
  %{!shared:                                                            \
    %{!pg: -lc}                                                         \
    %{pg:  -lc_p}                                                       \
  }"
#else
#define DFBSD_LIB_SPEC "							\
  %{!shared:                                                            \
    %{!pg: %{pthread:-lpthread} -lc}                                    \
    %{pg:  %{pthread:-lpthread_p} -lc_p}                                \
  }"
#endif

#define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"

File Added: pkgsrc/lang/gcc34/files/Attic/dragonfly.h
/* Base configuration file for all FreeBSD targets.
   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING.  If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/* Common DragonFly configuration. 
   All DragonFly architectures should include this file, which will specify
   their commonalities.
   Adapted from gcc/config/i386/freebsd-elf.h by 
   David O'Brien <obrien@FreeBSD.org>.  
   Further work by David O'Brien <obrien@FreeBSD.org> and
   Loren J. Rittle <ljrittle@acm.org>.  */


/* In case we need to know.  */
#define USING_CONFIG_DRAGONFLY 1

/* This defines which switch letters take arguments.  On DragonFly, most of
   the normal cases (defined in gcc.c) apply, and we also have -h* and
   -z* options (for the linker) (coming from SVR4).
   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */

#undef  SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) (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


/************************[  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 FreeBSD's standard headers (<machine/ansi.h>, etc...)  */

#undef  WCHAR_TYPE
#define WCHAR_TYPE "int"

#define MATH_LIBRARY_PROFILE    "-lm_p"

/* Code generation parameters.  */

/* Use periods rather than dollar signs in special g++ assembler names.
   This ensures the configuration knows our system correctly so we can link
   with libraries compiled with the native cc.  */
#undef NO_DOLLAR_IN_LABEL

/* Used by libgcc2.c.  We support file locking with fcntl / F_SETLKW.
   This enables the test coverage code to use file locking when exiting a
   program, which avoids race conditions if the program has forked.  */
#define TARGET_HAS_F_SETLKW

File Added: pkgsrc/lang/gcc34/files/Attic/i386-dragonfly.h
/* Definitions for Intel 386 running DragonFly
   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>

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)");

/* 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)} \
  %{Wl,*:%*} \
  %{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)

File Added: pkgsrc/lang/gcc34/files/Attic/i386-dragonfly64.h
/* 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>

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING.  If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */


#undef  TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (DragonFly/x86-64)");

#define SUBTARGET_EXTRA_SPECS \
  { "dfbsd_dynamic_linker", DFBSD_DYNAMIC_LINKER }

/* Provide a LINK_SPEC appropriate for the DragonFly/x86-64 target.
   This is a copy of LINK_SPEC from <i386/dragonfly.h> tweaked for
   the x86-64 target.  */

#undef	LINK_SPEC
#define LINK_SPEC "\
  %{m32:-m elf_i386_dfbsd} \
  %{Wl,*:%*} \
  %{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}"

File Added: pkgsrc/lang/gcc34/patches/Attic/patch-aa
$NetBSD: patch-aa,v 1.1 2009/04/22 18:59:54 hasso Exp $

--- boehm-gc/include/private/gcconfig.h.orig	2009-04-08 14:54:58 +0300
+++ boehm-gc/include/private/gcconfig.h	2009-04-08 14:55:38 +0300
@@ -55,7 +55,7 @@
 # endif
 
 /* And one for FreeBSD: */
-# if defined(__FreeBSD__)
+# if defined(__FreeBSD__) || defined(__DragonFly__)
 #    define FREEBSD
 # endif
 

File Added: pkgsrc/lang/gcc34/patches/Attic/patch-ab
$NetBSD: patch-ab,v 1.1 2009/04/22 18:59:54 hasso Exp $

--- ../gcc-3.4.6/gcc/config.gcc	2005-07-20 00:08:48 +0300
+++ gcc/config.gcc	2009-04-09 09:26:24 +0300
@@ -451,6 +451,33 @@ case ${target} in
     "" | yes | posix) thread_file='posix' ;;
   esac
   ;;
+*-*-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*libc1* | *-*-linux*aout*)
   # Avoid the generic linux case.
   ;;
@@ -964,6 +991,12 @@ i[34567]86-*-freebsd*)
 x86_64-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
 	;;
+i[34567]86-*-dragonfly*)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${dfbsd_tm_file} i386/dragonfly.h"
+	;;
+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-*-netbsdelf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
 	;;

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

--- pkgsrc/lang/gcc34/patches/Attic/patch-at 2009/03/30 10:57:02 1.1
+++ pkgsrc/lang/gcc34/patches/Attic/patch-at 2009/04/22 18:59:54 1.2
@@ -1,24 +1,41 @@ @@ -1,24 +1,41 @@
1$NetBSD: patch-at,v 1.1 2009/03/30 10:57:02 markd Exp $ 1$NetBSD: patch-at,v 1.2 2009/04/22 18:59:54 hasso Exp $
2 2
3Alternative fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38182 3Alternative fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38182
4 4
5--- gcc/ginclude/stddef.h.orig 2009-02-28 18:57:06.000000000 +0100 5--- gcc/ginclude/stddef.h.orig 2004-08-12 03:34:33 +0300
6+++ gcc/ginclude/stddef.h 6+++ gcc/ginclude/stddef.h 2009-04-09 12:05:04 +0300
7@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA. */ 7@@ -61,10 +61,15 @@ Boston, MA 02111-1307, USA. */
 8 #include <sys/_types.h>
 9 #endif
 10
 11+#if defined (__DragonFly__)
 12+#include <machine/stdint.h>
 13+#include <sys/types.h>
 14+#endif
 15+
8 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are 16 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
9 defined if the corresponding type is *not* defined. 17 defined if the corresponding type is *not* defined.
10 FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */ 18 FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
11-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) 19-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
12+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) 20+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) || defined(__DragonFly__)
13 #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) 21 #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
14 #define _SIZE_T 22 #define _SIZE_T
15 #endif 23 #endif
16@@ -359,7 +359,7 @@ typedef __WINT_TYPE__ wint_t; 24@@ -201,7 +205,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 25 #define ___int_size_t_h
 26 #define _GCC_SIZE_T
 27 #define _SIZET_
 28-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
 29+#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) || defined(__DragonFly__)
 30 /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
 31 #else
 32 #define __size_t
 33@@ -359,7 +363,7 @@ typedef __WINT_TYPE__ wint_t;
17 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. 34 /* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
18 are already defined. */ 35 are already defined. */
19 /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ 36 /* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
20-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) 37-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
21+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) 38+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(__NetBSD__) || defined(__DragonFly__)
22 /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ 39 /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
23 are probably typos and should be removed before 2.8 is released. */ 40 are probably typos and should be removed before 2.8 is released. */
24 #ifdef _GCC_PTRDIFF_T_ 41 #ifdef _GCC_PTRDIFF_T_