Index: Portfile
===================================================================
--- Portfile	(revision 46554)
+++ Portfile	(working copy)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name			apple-gcc42
-version			5531
+version			5564
 categories		lang
 platforms		darwin
 maintainers		mww
@@ -12,36 +12,30 @@
 			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/
+master_sites	http://www.opensource.apple.com/darwinsource/tarballs/other/
 distname		gcc_42-${version}
-checksums		sha1 b8635f310393c17e6494fef0358ee944e03aa5c1
+checksums		md5 cc919b07776db1a209ccaa48b0e19da7
 
-post-extract { file mkdir ${workpath}/build }
+set prefix      ${prefix}
 
-set nprefix ${prefix}/lib/${name}
+post-extract { 
+                file mkdir ${worksrcpath}/debug
+                file mkdir ${workpath}/destroot
+}
 
-# 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"
+post-patch {
+            reinplace "s|MAKEINFO=\$\(MAKEINFO\) \$\(MAKEINFOFLAGS\)|MAKEINFO=makeinfo \$\(MAKEINFOFLAGS\)|" ${worksrcpath}/Makefile.in
 }
 
+use_configure   no
+# This will automatically build gcc 4.2 with c++ and obj-c++ support
+build.cmd		${worksrcpath}/build_gcc \"[strsed ${configure.universal_archs} "g| |;|"]\" \"[strsed ${configure.universal_archs} "g| |;|"]\" \
+                ${worksrcpath} ${prefix} ${workpath}/destroot ${worksrcpath}/debug
+
+destroot        {}
+
+destroot.violate_mtree yes
+
 livecheck.check		moddate
 livecheck.url		${master_sites}
 

