--- Portfile.orig	2013-04-12 10:15:50.000000000 -0400
+++ Portfile	2013-04-12 10:23:41.000000000 -0400
@@ -6,11 +6,10 @@
 PortGroup compiler_blacklist_versions 1.0
 
 name                gcc47
-subport             libstdcxx {}
 epoch               1
 
 version             4.7.3
-revision            0
+revision            1
 platforms           darwin
 categories          lang
 maintainers         mww openmaintainer
@@ -54,7 +53,7 @@
 depends_skip_archcheck-append gcc_select ld64 cctools
 license_noconflict  gmp mpfr ppl libmpc
 
-patchfiles          ppc_fde_encoding.diff  gcc-PR-53453.patch
+patchfiles          ppc_fde_encoding.diff  gcc-PR-53453.patch libstdc++_nanosleep.patch
 patch.dir           ${workpath}/gcc-${version}
 
 set major           4.7
@@ -92,7 +91,6 @@
                     --enable-stage1-checking \
                     --disable-multilib \
                     --enable-lto \
-                    --enable-libstdcxx-time \
                     --with-as=${prefix}/bin/as \
                     --with-ld=${prefix}/bin/ld \
                     --with-ar=${prefix}/bin/ar \
@@ -126,51 +124,6 @@
 
 destroot.target     install install-info-host
 
-if {${subport} == "libstdcxx"} {
-    conflicts       libstdcxx-devel
-
-    patchfiles-append  force-static-gcc.patch
-
-    depends_run-delete path:lib/libstdc\\\\+\\\\+.6.dylib:libstdcxx
-
-    configure.args-delete --libdir=${prefix}/lib/${name}
-
-    configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java
-    configure.args-append --enable-languages=c++
-
-    # http://trac.macports.org/ticket/36116
-    compiler.blacklist-append {clang < 425}
-
-    configure.args-append --disable-bootstrap
-    build.target        all
-
-    destroot.target     install-target-libstdc++-v3
-
-    post-destroot {
-        eval file delete [glob ${destroot}${prefix}/lib/*{a,py}]
-        file delete -force ${destroot}${prefix}/share/gcc-${major}
-        file delete -force ${destroot}${prefix}/include/${name}
-
-        # Don't install the linktime symlink.  The compilers will place this
-        # in their libdir, and we don't want to break other toolchains by having
-        # them link against this libstdc++ (at least not until it is built on
-        # top of libc++abi).
-        file delete ${destroot}${prefix}/lib/libstdc++.dylib
-
-        # For compatibility.  Delete this eventually.
-        system "touch ${destroot}${prefix}/lib/.libstdcxx"
-
-        if {[variant_isset universal]} {
-            foreach archdir [glob ${destroot}${prefix}/lib/*/] {
-                if {[file exists ${archdir}/libstdc++.6.dylib]} {
-                    system "install_name_tool -id ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib"
-                    system "lipo -create -output ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib && mv ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib"
-                }
-                file delete -force ${archdir}
-            }
-        }
-    }
-} else {
 post-destroot {
     file delete -force ${destroot}${prefix}/share/man/man7 \
         ${destroot}${prefix}/share/info
@@ -193,13 +146,18 @@
 
     # http://trac.macports.org/ticket/35770
     eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
+    eval delete [glob ${destroot}${prefix}/lib/${name}/libgcc*dylib]
 
     ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
+    ln -s ${prefix}/lib/libgcc_ext.10.4.dylib ${destroot}${prefix}/lib/${name}/libgcc_ext.10.4.dylib
+    ln -s ${prefix}/lib/libgcc_ext.10.5.dylib ${destroot}${prefix}/lib/${name}/libgcc_ext.10.5.dylib
+    ln -s ${prefix}/lib/libgcc_s.1.dylib ${destroot}${prefix}/lib/${name}/libgcc_s.1.dylib
+    ln -s ${prefix}/lib/libgcc_s.1.dylib ${destroot}${prefix}/lib/${name}/libgcc_s_ppc64.1.dylib
+    ln -s ${prefix}/lib/libgcc_s.1.dylib ${destroot}${prefix}/lib/${name}/libgcc_s_x86_64.1.dylib
 
     # This symlink is provided as a transition aide and will be removed
     # with a future revision of this port.
     ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
-}
 
 select.group        gcc
 select.file         ${filespath}/mp-${name}
