--- Portfile.orig	2009-09-12 22:19:45.000000000 -0400
+++ Portfile	2009-09-12 22:15:02.000000000 -0400
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name			gcc44
-epoch			1
+epoch			2
 version			4.4.1
 platforms		darwin
 categories		lang
@@ -42,24 +42,17 @@
 
 set major		4.4
 
+patchfiles              gcc44-config.guess.diff
 worksrcdir		build
-
-# the generated compiler doesn't accept -arch
-if {[info exists build_arch] && ${os.platform} == "darwin"} {
-    if {(${os.arch} == "i386" && $build_arch == "i386") || (${os.arch} == "powerpc" && $build_arch == "ppc")} {
-        configure.env-append CFLAGS_FOR_TARGET="-m32 ${configure.cflags}"
-    } elseif {(${os.arch} == "i386" && $build_arch == "x86_64") || (${os.arch} == "powerpc" && $build_arch == "ppc64")} {
-        configure.env-append CFLAGS_FOR_TARGET="-m64 ${configure.cflags}"
-    } else {
-        pre-fetch {
-            return -code error "Cannot build $name for $build_arch"
-        }
-    }
-    configure.env-append CFLAGS_FOR_BUILD="${configure.cc_archflags} ${configure.cflags}"
-    configure.cc_archflags
-    configure.cxx_archflags
-    configure.objc_archflags
+pre-patch {
+        file mkdir ${worksrcpath}
 }
+patch.dir               ${workpath}/gcc-${version}
+
+configure.env-append CFLAGS_FOR_BUILD="${configure.cflags}"
+configure.cc_archflags
+configure.cxx_archflags
+configure.objc_archflags
 
 pre-configure {
 	file mkdir ${worksrcpath}
@@ -77,7 +70,7 @@
 		--program-suffix=-mp-${major} \
 		--with-gxx-include-dir=${prefix}/include/${name}/c++/ \
 		--with-gmp=${prefix} \
-		--with-mpfr=${prefix}
+		--with-mpfr=${prefix} 
 # do NOT use MacPorts binutils -- they do not work
 configure.env-append    AR_FOR_TARGET=/usr/bin/ar \
 			AS_FOR_TARGET=/usr/bin/as \

