# $Id: Portfile,v 1.14 2006/06/04 14:38:29 gwright Exp $

PortSystem 1.0
name            gcc34
version         3.4.6
set major	3.4
revision	1
description     The GNU compiler collection
long_description	${description}
platforms       darwin
categories      lang
maintainers     gwright@opendarwin.org

homepage	http://gcc.gnu.org/gcc-${major}
master_sites    gnu:/gcc/gcc-${version}

#user_notes	This port is intended to be used by other ports		\
#		requiring the features of the latest released gcc or	\
#		g++. For example, covariant returns in g++ are not	\
#		supported by the standard Apple g++-3.3, but are by	\
#		this version. Generally speaking, you'll know if you	\
#		need this.						\
#									\
#		The libraries are moved from their standard location	\
#		so as not to conflict with the libraries installed	\
#		by the system's gcc. It is necessary below to specify	\
#		the C++ include path explicitly (using the		\
#		--with-gxx-include-dir configure argument) because	\
#		of a bug in gcc-3.4.3 that causes incorrect include	\
#		paths to be generated if the library directory is	\
#		changed.


use_bzip2	yes
distname	gcc-${version}

checksums       md5 4a21ac777d4b5617283ce488b808da7b

worksrcdir	build

post-extract	{
		  file mkdir ${worksrcpath}
		}

# On Tiger, we have to use gcc-3.3 to build the port. Using gcc-4.0
# (in fact building any older gcc with a newer compiler) is not a
# supported configuration according to the developers.

platform darwin 8 {
		  patchfiles	patch-darwin.h
		  configure.env	CC=/usr/bin/gcc-3.3
		}

patch.dir	${workpath}/gcc-${version}
configure.cmd	${workpath}/gcc-${version}/configure
configure.args  --enable-languages=c,c++,f77,objc,java	\
		--libdir=${prefix}/lib/gcc-${major}	\
		--infodir=${prefix}/share/info		\
                --mandir=${prefix}/share/man		\
		--with-system-zlib			\
		--disable-nls				\
		--program-suffix=-dp-${major}		\
		--with-local-prefix=${prefix}		\
		--with-gxx-include-dir=${prefix}/include/gcc-${major}/c++/

build.target    bootstrap-lean

post-destroot   { cd ${destroot}${prefix}
		  file delete -force share/man/man7
		  file delete -force share/info
		}

