--- Portfile.orig	2007-12-26 09:00:31.000000000 -0800
+++ Portfile	2008-03-30 03:12:12.000000000 -0700
@@ -28,8 +28,6 @@
 
 use_bzip2       yes
 
-configure.env   ABI=32
-configure.cflags-append -force_cpusubtype_ALL
 configure.args  --infodir=${prefix}/share/info \
                 --enable-shared \
                 --enable-cxx
@@ -38,14 +36,46 @@
 
 post-destroot {
     system "ranlib ${destroot}${prefix}/lib/libgmp.a"
+
+    if {[variant_isset i386_64]} {
+       ui_msg "------------------------------------------------------------"
+       ui_msg "Since the 64-bit variant was used, any program that uses    "
+       ui_msg "this version of gmp *must* be compiled with the -m64 switch."
+       ui_msg "------------------------------------------------------------"
+    } elseif {[variant_isset i386]} {
+       ui_msg "------------------------------------------------------------"
+       ui_msg "Since the i386_64 variant was not used, this version of gmp "
+       ui_msg "will be significantly slower; however, it will be           "
+       ui_msg "compatible with existing 32-bit programs.                   "
+       ui_msg "------------------------------------------------------------"
+    }
 }
 
+use_parallel_build yes
+
 test.run        yes
 test.cmd        make
 test.target     check
 
+platform powerpc {
+    configure.args-append     ABI=32
+    configure.cflags-append   -force_cpusubtype_ALL
+    configure.cxxflags-append -force_cpusubtype_ALL
+}
+
 platform i386 {
-    configure.env-delete    ABI=32
-    configure.args-append   --host=none-apple-darwin
-    configure.cflags-delete -force_cpusubtype_ALL
+    configure.args-append     --build=x86-apple-darwin ABI=standard
+    configure.cflags-append   -m32
+    configure.cxxflags-append -m32
+}
+
+variant i386_64 requires i386 conflicts powerpc {
+    # this must match declarations in platform i386 block above.
+    configure.args-delete     --build=x86-apple-darwin ABI=standard
+    configure.cflags-delete   -m32
+    configure.cxxflags-delete -m32
+
+    configure.args-append     --build=x86_64-apple-darwin ABI=64
+    configure.cflags-append   -m64
+    configure.cxxflags-append -m64
 }
