diff -ruN ../atlas.orig/Portfile ./Portfile
--- ../atlas.orig/Portfile	2009-12-28 16:32:35.000000000 +0000
+++ ./Portfile	2010-01-02 00:31:43.000000000 +0000
@@ -29,6 +29,9 @@
 distfiles           ${atlasdist}:atlas \
                     ${lapackdist}:lapack
 
+patchfiles          patch-ATL_AVgcc-fix.diff \
+                    patch-archinfo_freebsd.c.diff
+
 checksums           atlas${version}.tar.bz2 \
                     md5     6c13be94a87178e7582111c08e9503bc \
                     sha1    c7546210df4796457d9e96a00444adc4c0f2e77f \
diff -ruN ../atlas.orig/files/Portfile ./files/Portfile
--- ../atlas.orig/files/Portfile	2009-06-13 06:10:01.000000000 +0100
+++ ./files/Portfile	1970-01-01 01:00:00.000000000 +0100
@@ -1,176 +0,0 @@
-# $Id: Portfile 52257 2009-06-13 05:10:01Z jameskyle@macports.org $
-
-PortSystem          1.0
-
-categories          math
-name                atlas
-version             3.8.3
-
-# additional versions
-set lapackversion   3.2.1
-set lapackname      lapack
-set atlasdist       ${name}${version}.tar.bz2
-set lapackdist      ${lapackname}.tgz
-
-maintainers         cornell.edu:ajb78
-platforms           darwin
-
-description         Portable optimal linear algebra software
-long_description    The current version provides a complete BLAS and LAPACK API.\
-                    For many operations, ATLAS achieves performance on par with\
-                    machine-specific tuned libraries.
-
-homepage            http://math-atlas.sourceforge.net/
-
-master_sites        sourceforge:math-atlas/${name}${version}.tar.bz2:atlas \
-                    http://www.netlib.org/lapack:lapack
-
-distfiles           ${atlasdist}:atlas \
-                    ${lapackdist}:lapack
-
-checksums           atlas3.8.3.tar.bz2 \
-                    md5     6c13be94a87178e7582111c08e9503bc \
-                    sha1    c7546210df4796457d9e96a00444adc4c0f2e77f \
-                    rmd160  0425e630d9d0c5b7aae81427a41b7eaa18447e90 \
-                    lapack.tgz \
-                    md5     a3202a4f9e2f15ffd05d15dab4ac7857 \
-                    sha1    c75223fdef3258c461370af5d2b889d580d7f38a \
-                    rmd160  e8fabba2fdd944afbc02a83599cf45a0d721030d
-
-
-# the following patch corrects extension conventions for osx's dynamic libs
-set make_patch      patch-build-Make.top.diff
-use_parallel_build  no
-build.target build
-build.dir           ${workpath}/${name}-${version}/build
-
-destroot.dir        ${build.dir}
-destroot.destdir    DESTDIR=${destroot}${prefix}
-depends_lib         port:gcc43 \
-                    port:bzip2 \
-                    port:gzip
-
-# Set fortran compiler flags
-set myf77           ${prefix}/bin/gfortran-mp-4.3
-
-configure.args      -C xc ${prefix}/bin/gcc-mp-4.3 \
-                    -C gc ${prefix}/bin/gcc-mp-4.3 \
-                    -C if ${myf77} \
-                    -C ic ${prefix}/bin/gcc-mp-4.3 \
-                    -C dm ${prefix}/bin/gcc-mp-4.3 \
-                    -C sm ${prefix}/bin/gcc-mp-4.3 \
-                    -C dk ${prefix}/bin/gcc-mp-4.3 \
-                    -C sk ${prefix}/bin/gcc-mp-4.3 \
-                    --cc=${prefix}/bin/gcc-mp-4.3 \
-                    -b 32 \
-                    -Fa alg -fPIC 
-                    
-configure.compiler macports-gcc-4.3
-
-        
-
-# we are configuring from the build directory
-configure.dir       ${workpath}/${name}-${version}/build
-configure.cmd       ../configure
-
-# change the default compilers to those of gcc43 and make into shared library
-
-extract {
-    # extract atlas and move to a consistent working directory name
-    system "cd ${workpath} && bunzip2 -dc ${distpath}/${atlasdist} | \
-         gnutar --no-same-owner -xf -"
-    system "mv ${workpath}/ATLAS ${workpath}/${name}-${version}"
-
-    # extract lapack
-    system "cd ${workpath} && gunzip -dc ${distpath}/${lapackdist} | \
-         gnutar --no-same-owner -xf -"
-}
-
-
-
-pre-configure {
-    # Get some system specific variables for maximum optimization
-    set cpufreq [expr {[exec sysctl -n hw.cpufrequency]/1000000}]
-    ui_debug "Setting CPU Frequency for: ${cpufreq}"
-    configure.args-append -D c -DPentiumCPS=${cpufreq}
-
-    # first do a 'fake configure' of atlas so we get optimized lapack libraries
-    ui_debug "performing fake configure of atlas for optimized lapack"
-    # atlas docs: 3.1.2
-    set atlas_path ${workpath}/${name}-${version}
-    file mkdir ${workpath}/${name}-${version}/temp
-    ui_debug "Assembled Command: '${configure.cmd} ${configure.args}"
-    system "cd ${atlas_path}/temp && \
-            ${configure.cmd} ${configure.args}"
-    
-    # Get the F77FLAGS 
-    set atlas_f77    [join [lrange [split [exec grep "F77 = " $atlas_path/temp/Make.inc     ] =] 1 end] =]
-    ui_debug "Found atlas F77: ${atlas_f77}"
-    
-    set atlas_fflags [join [lrange [split [exec grep "F77FLAGS = " $atlas_path/temp/Make.inc] =] 1 end] =]
-    ui_debug "Found atlas F77FLAGS: ${atlas_fflags}"
-    # Remove the old test configure directory
-    system "rm -rf ${atlas_path}/temp"
-    
-    # compile lapack
-    system "cd ${workpath}/${lapackname}-${lapackversion} && \
-            cp INSTALL/make.inc.gfortran make.inc"
-    reinplace "s|gfortran|${atlas_f77}|" \
-           ${workpath}/${lapackname}-${lapackversion}/make.inc
-    reinplace "s|OPTS     = -O2|OPTS = ${atlas_fflags}|" \
-           ${workpath}/${lapackname}-${lapackversion}/make.inc
-    
-    reinplace "s|NOOPT    = -O0|NOOPT = -O2 -m32|" \
-           ${workpath}/${lapackname}-${lapackversion}/make.inc
-
-    reinplace "s|PLAT = _LINUX|PLAT = _darwin|" \
-           ${workpath}/${lapackname}-${lapackversion}/make.inc
-    
-    reinplace "s|LOADOPTS =|LOADOPTS = ${atlas_fflags}|" \
-           ${workpath}/${lapackname}-${lapackversion}/make.inc
-    
-    system "cd ${workpath}/${lapackname}-${lapackversion} && make lib"
-
-    # create a build directory for atlas
-    file mkdir ${workpath}/${name}-${version}/build
-
-
-    configure.args-append --with-netlib-lapack=${workpath}/${lapackname}-${lapackversion}/lapack_darwin.a 
-}
-
-post-configure {
-    # recursively remove directories
-    reinplace "s|rm -f|rm -rf|g" ${workpath}/${name}-${version}/build/Makefile
-
-    # patch ${name}-${version}/build/Make.top to install dynamic libs
-    system "cd ${worksrcpath}/build/ && \
-            patch -p0 < ${filespath}/${make_patch}"
-}
-
-pre-destroot {
-  # We have to manually create the dylib shared libs as the default build does not do this
-  set ld "ld -dynamic -arch i386 -dylib -single_module -dead_strip -x \
-          -all_load -L. -L${prefix}/lib/gcc43 -ldylib1.o -dylib_install_name"
-  
-  system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} libatlas.dylib libatlas.a -o libatlas.dylib -lSystem"
-  
-  system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} libptcblas.dylib libptcblas.a -o libptcblas.dylib -latlas -lSystem"
-  
-  system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} libptf77blas.dylib libptf77blas.a -o libptf77blas.dylib -lgfortran \
-          -latlas -lSystem"
-
-  system "cd ${workpath}/${name}-${version}/build/lib && \
-          ${ld} liblapack.dylib liblapack.a -o liblapack.dylib -lptf77blas \
-          -lgfortran -lptcblas -latlas -lgcc_s.1 -lSystem"
-
-}
-
-post-destroot {
-  # we make soft links to the parallel built libs
-  system "cd ${destroot}${prefix}/lib && \
-          ln -sf ./libptcblas.dylib libcblas.dylib && \
-          ln -sf ./libptf77blas.dylib libf77blas.dylib"
-}
diff -ruN ../atlas.orig/files/patch-ATL_AVgcc-fix.diff ./files/patch-ATL_AVgcc-fix.diff
--- ../atlas.orig/files/patch-ATL_AVgcc-fix.diff	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-ATL_AVgcc-fix.diff	2010-01-02 00:24:14.000000000 +0000
@@ -0,0 +1,17 @@
+--- CONFIG/src/SpewMakeInc.c.orig	2009-02-18 19:47:37.000000000 +0100
++++ CONFIG/src/SpewMakeInc.c	2009-12-15 22:05:56.000000000 +0100
+@@ -579,11 +579,11 @@
+ /*
+  * Need up update handling of apple vs. gnu gcc for altivec
+  */
+-#if 0
++/*#if 0
+    if (ISAX == ISA_AV && strstr(CC, "gcc") && strstr(MCC, "gcc") &&
+-       !GccIsApple(CC))
++       !GccIsApple(CC))*/
+       fprintf(fpout, " -DATL_%s -DATL_AVgcc", ISAXNAM[ISAX]);
+-#endif
++/*#endif*/
+    fprintf(fpout, "\n\n");
+ 
+    fprintf(fpout,
diff -ruN ../atlas.orig/files/patch-archinfo_freebsd.c.diff ./files/patch-archinfo_freebsd.c.diff
--- ../atlas.orig/files/patch-archinfo_freebsd.c.diff	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-archinfo_freebsd.c.diff	2010-01-02 00:14:48.000000000 +0000
@@ -0,0 +1,11 @@
+--- CONFIG/src/backend/archinfo_freebsd.c.orig	2009-02-18 18:47:37.000000000 +0000
++++ CONFIG/src/backend/archinfo_freebsd.c	2010-01-01 11:45:22.000000000 +0000
+@@ -69,7 +69,7 @@
+             if (strstr(res,"c1,2")||strstr(res,"c3,1")||strstr(res,"c3,2")||
+                 strstr(res,"c3,3")||strstr(res,"c3,4")||strstr(res,"c3,5")||
+                 strstr(res,"c3,6")||strstr(res,"c4,2")||strstr(res,"c4,5")||
+-                strstr(res,"c5,1"))
++                strstr(res,"c5,1")||strstr(res,"c10,1"))
+                mach = PPCG4;
+             else if (strstr(res,"c11,2")|| strstr(res,"c12,1")||
+                      strstr(res,"c7,2") || strstr(res,"c7,3") ||
