Index: Portfile
===================================================================
--- Portfile	(revision 89751)
+++ Portfile	(working copy)
@@ -2,24 +2,25 @@
 
 PortSystem			1.0
 name            	avr-gcc
-version         	4.0.2
-
-# Parameters for this port.
-set crossgcc-target avr
-set default-languages --enable-languages="c,c++"
-
-description     	gcc cross-compilers for avr
-long_description	GNU compilers collection (c and c++) for avr.
-homepage			http://gcc.gnu.org/
+version                 4.6.2
 platforms       	darwin
 categories      	cross devel
 maintainers     	nomaintainer
+license                 {GPL-3+ Permissive}
+description     	GNU cross compilers for Atmel AVR
+long_description        GNU compilers collection (c and c++) for Atmel AVR 8bit microcontrollers..
+homepage                http://gcc.gnu.org/
 master_sites		gnu:gcc/gcc-${version}/
 distfiles			gcc-${version}.tar.bz2
+use_bzip2               yes
 worksrcdir			gcc-${version}
-checksums			md5 a659b8388cac9db2b13e056e574ceeb0 \
-					sha1 f1b714c6398393d8f7f4ad5be933b462a95b075d \
-					rmd160 70c7e21820da4d29ce6e8e48329d906ee19333aa
+checksums               md5 028115c4fbfb6cfd75d6369f4a90d87e \
+                        sha256 60b05463dfe18d40d68fb8a71b25b408a01f86cc6ceaf5e6b22238b6b0f450c2 \
+                        rmd160 e7041933b39629f9524848dcf81a1a4c02a225c6
+
+# Parameters for this port.
+set crossgcc-target avr
+set default-languages --enable-languages="c,c++"
 
 # All cross ports violate the mtree layout.
 destroot.violate_mtree	yes
@@ -31,11 +32,11 @@
 					bin:${crossgcc-target}-as:${crossgcc-target}-binutils \
 					bin:${crossgcc-target}-ld:${crossgcc-target}-binutils \
 					bin:${crossgcc-target}-nm:${crossgcc-target}-binutils \
-					bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils
+                        bin:${crossgcc-target}-ranlib:${crossgcc-target}-binutils \
+                        port:gmp port:mpfr port:libiconv port:libmpc port:ppl
+
 depends_build		bin:msgfmt:gettext
 
-# gcc is .bz2.
-use_bzip2			yes
 # Since we don't build gcc and binutils at the same time, gcc's Makefile will try to transform
 # program names as gcc's name (add -${version} with ${version} being the version of gcc).
 # But it won't work because binutils binaries don't have the ${version} suffix, and even if they
@@ -53,9 +54,12 @@
 pre-configure   {
 	file mkdir "${workpath}/build"
 }
+
+patchfiles-append	lto-plugin-osx.diff
+
 configure.dir   ${workpath}/build
 configure.cmd   ${workpath}/gcc-${version}/configure
-configure.cc    "cc -no-cpp-precomp"
+# configure.cc           "cc -no-cpp-precomp"
 configure.env	${environment}
 configure.args  --infodir='${prefix}/share/info' \
 				--mandir='${prefix}/share/man' \
@@ -63,8 +67,13 @@
 				--program-prefix=${crossgcc-target}- \
 				--with-included-gettext \
 				--enable-obsolete \
+                        --disable-nls \
+			--enable-lto \
+			--with-plugin-ld=${crossgcc-target}-ld \
+			--disable-libquadmath \
 				--with-gxx-include-dir=${prefix}/${crossgcc-target}/include/c++/${version}/ \
 				${default-languages}
+
 if {$build_arch != "" && ${os.platform} == "darwin"} {
     configure.cc_archflags
     configure.cxx_archflags
@@ -78,10 +87,6 @@
 build.args		${environment}
 destroot.args	${environment}
 
-patchfiles		gcc-config-avr-avr.c.diff \
-				gcc-config-avr-avr.h.diff \
-				gcc-config-avr-t-avr.diff
-
 platform darwin 9 {
 	patchfiles-append	gcc-config-rs6000-host-darwin.c.diff
 }
@@ -168,6 +173,9 @@
 	# gcc/doc/gccint.texi
 	crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccint texi
 
+	# libquadmath/libquadmath.texi
+	crossgcc::fixinfo libquadmath libquadmath/Makefile.in libquadmath texi
+
 	# gcc/f/g77.texi
 	crossgcc::fixinfo gcc/fortran/ gcc/fortran/Make-lang.in gfortran texi
 
@@ -175,7 +183,7 @@
 	crossgcc::fixinfo gcc/java/ gcc/java/Make-lang.in gcj texi
 
 	# fastjar/fastjar.texi
-	crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
+	#crossgcc::fixinfo fastjar/ fastjar/Makefile.in fastjar texi
 	
 	# gcc/doc/gccinstall.info
 	crossgcc::fixinfo gcc/doc/ gcc/Makefile.in gccinstall info
@@ -220,7 +228,7 @@
 	file delete -force "${destroot}${prefix}/share/man/man7"
 
 	# (host) libiberty
-	file delete "${destroot}${prefix}/lib/libiberty.a"
+	file delete "${destroot}${prefix}/lib/${build_arch}/libiberty.a"
 
 	# aliases for charsets (should already be there)
 	file delete "${destroot}${prefix}/lib/charset.alias"
