# $Id: Portfile 61327 2009-12-08 20:04:24Z mww@macports.org $

PortSystem 1.0

name			apple-gcc42
version			5531
categories		lang
platforms		darwin
maintainers		nomaintainer
description		Apple's version of gcc 4.2
long_description	Apple's version of the GNU compiler collection, \
			version 4.2. Supports C and Objective-C.

homepage		http://developer.apple.com/documentation/DeveloperTools/gcc-4.2/gcc/
master_sites		http://www.opensource.apple.com/darwinsource/tarballs/other/
distname		gcc_42-${version}
checksums		sha1 b8635f310393c17e6494fef0358ee944e03aa5c1

post-extract { file mkdir ${workpath}/build }

set nprefix ${prefix}/lib/${name}

# try to avoid non-Apple programs at all costs (rather volatile build)
configure.dir		${workpath}/build
configure.cmd		${worksrcpath}/configure
configure.pre_args	--prefix=${nprefix}
# C++ support breaks the build
configure.args		--enable-languages=c,objc \
			--program-suffix=-apple-4.2
configure.cflags
configure.ldflags
configure.cppflags
configure.env		PATH="/bin:/usr/bin:/sbin:/usr/sbin"

build.dir		${configure.dir}

destroot.dir		${build.dir}

post-destroot {
	file delete -force \
		${destroot}${nprefix}/man ${destroot}${nprefix}/info
	system "cd ${destroot}${prefix}/bin && ln -sf ${nprefix}/bin/gcc-apple-4.2 && ln -sf ${nprefix}/bin/cpp-apple-4.2"
}

livecheck.type		moddate
livecheck.url		${master_sites}

