Index: Portfile
===================================================================
--- Portfile	(revision 111066)
+++ Portfile	(working copy)
@@ -40,6 +40,8 @@
 depends_skip_archcheck-append gcc_select ld64 cctools
 license_noconflict  gmp mpfr ppl libmpc
 
+patchfiles          PR-40478.patch
+
 set major           4.8
 
 platform darwin {
Index: files/PR-40478.patch
===================================================================
--- files/PR-40478.patch	(revision 0)
+++ files/PR-40478.patch	(working copy)
@@ -0,0 +1,69 @@
+commit 5afa36223ac98bc13dbc85acc9d9ca9edbd4641c
+Author: Lawrence Velázquez <larryv@alum.mit.edu>
+Date:   Sat Sep 14 13:31:49 2013 -0400
+
+    Fix broken universal build on Leopard.
+    
+    Patch by jeremyhu. See https://trac.macports.org/ticket/40478.
+
+diff --git config-apple-verbatim.h config-apple-verbatim.h
+new file mode 100644
+index 0000000..1ef40be
+--- /dev/null
++++ config-apple-verbatim.h
+@@ -0,0 +1,14 @@
++#ifdef __APPLE__
++
++#undef SIZEOF_LONG
++
++#if __LP64__
++#define SIZEOF_LONG 8
++#else
++#define SIZEOF_LONG 4
++#endif
++
++#undef SIZEOF_VOID_P
++#define SIZEOF_VOID_P SIZEOF_LONG
++
++#endif
+diff --git gcc/config.in gcc/config.in
+index 0b07f3e..8e0a7dc 100644
+--- gcc/config.in
++++ gcc/config.in
+@@ -2041,3 +2041,6 @@
+ #undef vfork
+ #endif
+ 
++#ifndef USED_FOR_TARGET
++#include "../config-apple-verbatim.h"
++#endif
+diff --git libcpp/config.in libcpp/config.in
+index 1b0b255..8532acb 100644
+--- libcpp/config.in
++++ libcpp/config.in
+@@ -356,3 +356,5 @@
+ /* Define to the type of an unsigned integer type wide enough to hold a
+    pointer, if such a type exists, and if the system does not define it. */
+ #undef uintptr_t
++
++#include "../config-apple-verbatim.h"
+diff --git libdecnumber/config.in libdecnumber/config.in
+index 98dc67d..a1a344c 100644
+--- libdecnumber/config.in
++++ libdecnumber/config.in
+@@ -92,3 +92,5 @@
+ 
+ /* Define to `long int' if <sys/types.h> does not define. */
+ #undef off_t
++
++#include "../config-apple-verbatim.h"
+diff --git libgomp/config.h.in libgomp/config.h.in
+index 14c7e2a..d69e3f5 100644
+--- libgomp/config.h.in
++++ libgomp/config.h.in
+@@ -133,3 +133,5 @@
+ 
+ /* Version number of package */
+ #undef VERSION
++
++#include "../config-apple-verbatim.h"
