[60662] trunk/base/src/port1.0/portconfigure.tcl

Jeremy Huddleston jeremyhu at macports.org
Thu Nov 19 12:35:04 PST 2009


On Nov 19, 2009, at 12:04, Joshua Root wrote:

> I don't think we care about non-Apple ld, so we can always use -arch if
> the flag is in fact going to be passed straight to ld. The problem is
> non-Apple gcc, which doesn't understand -arch. So we have to use
> -m32/-m64 instead, which is fine to use in LDFLAGS if you link using
> gcc, but not if you link with ld directly.

Ah... because of configure.m{32,64} ...

what about something like this?

Index: portconfigure.tcl
===================================================================
--- portconfigure.tcl	(revision 60662)
+++ portconfigure.tcl	(working copy)
@@ -228,6 +228,27 @@
             set flags "-m32"
         }
     }
+
+    if {$tool == "ld"} {
+        if {$flags == "-m64"} {
+            if {${configure.build_arch} == "i386" || ${configure.build_arch} == "x86_64"} {
+                set flags "-arch x86_64"
+            } elseif {${configure.build_arch} == "ppc" || ${configure.build_arch} == "ppc64"} {
+                set flags "-arch ppc64"
+            } else {
+                set flags ""
+            }
+        } elseif {$flags == "-m32"} {
+            if {${configure.build_arch} == "i386" || ${configure.build_arch} == "x86_64"} {
+                set flags "-arch i386"
+            } elseif {${configure.build_arch} == "ppc" || ${configure.build_arch} == "ppc64"} {
+                set flags "-arch ppc"
+            } else {
+                set flags ""
+            }
+        }
+    }
+
     return $flags
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3333 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20091119/3de3e2ec/attachment.bin>


More information about the macports-dev mailing list