[53388] trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

jmr at macports.org jmr at macports.org
Sat Jul 4 07:38:11 PDT 2009


Revision: 53388
          http://trac.macports.org/changeset/53388
Author:   jmr at macports.org
Date:     2009-07-04 07:38:11 -0700 (Sat, 04 Jul 2009)
Log Message:
-----------
clag the arch_flag_supported proc from trunk's portconfigure and always use -arch when supported

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl	2009-07-04 14:22:52 UTC (rev 53387)
+++ trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl	2009-07-04 14:38:11 UTC (rev 53388)
@@ -56,19 +56,41 @@
 default merger_arch_flag {yes}
 default merger_arch_compiler {yes}
 
+proc muniversal_arch_flag_supported {args} {
+    global configure.compiler
+    switch -exact ${configure.compiler} {
+        gcc-4.0 -
+        gcc-4.2 -
+        llvm-gcc-4.2 -
+        clang -
+        apple-gcc-4.0 -
+        apple-gcc-4.2 {
+            return yes
+        }
+        default {
+            return no
+        }
+    }
+}
+
 proc muniversal_get_arch_flag {arch} {
     global os.arch 
-    # Prefer -m to -arch 
-    set archf "-arch ${arch}" 
-    if { ${os.arch}=="i386" && ${arch}=="i386" } { 
-        set archf -m32 
-    } elseif { ${os.arch}=="i386" && ${arch}=="x86_64" } { 
-        set archf -m64 
-    } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc" } { 
-        set archf -m32 
-    } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc64" } { 
-        set archf -m64 
-    } 
+    # Prefer -arch to -m
+    if {[muniversal_arch_flag_supported]} {
+        set archf "-arch ${arch}"
+    } else {
+        if { ${os.arch}=="i386" && ${arch}=="i386" } { 
+            set archf -m32 
+        } elseif { ${os.arch}=="i386" && ${arch}=="x86_64" } { 
+            set archf -m64 
+        } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc" } { 
+            set archf -m32 
+        } elseif { ${os.arch}=="powerpc" && ${arch}=="ppc64" } { 
+            set archf -m64 
+        } else {
+            return -code error "selected compiler can't build for ${arch}"
+        }
+    }
     return ${archf}
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090704/d0a99cbb/attachment.html>


More information about the macports-changes mailing list