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

mcalhoun at macports.org mcalhoun at macports.org
Sun Jan 25 07:57:34 PST 2009


Revision: 45923
          http://trac.macports.org/changeset/45923
Author:   mcalhoun at macports.org
Date:     2009-01-25 07:57:33 -0800 (Sun, 25 Jan 2009)
Log Message:
-----------
muniversal-1.0.tcl: Improve comments.
Add proc muniversal_get_arch_flag which gives -m or -arch for a given architecture.

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-01-25 15:52:43 UTC (rev 45922)
+++ trunk/dports/_resources/port1.0/group/muniversal-1.0.tcl	2009-01-25 15:57:33 UTC (rev 45923)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
-# merge_universal-1.0.tcl
+# muniversal-1.0.tcl
 #
 # $Id$
 #
@@ -57,6 +57,7 @@
         configure.ldflags-delete   -arch ${arch}
     }
 
+    # set universal_archs_to_use as the intersection of universal_archs and universal_archs_supported
     set universal_archs_to_use {}
     foreach arch ${universal_archs} {
         set arch_ok no
@@ -76,20 +77,10 @@
 
             copy ${worksrcpath} ${workpath}/${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
-            }
+            set archf [muniversal_get_arch_flag ${arch}]
             configure.cflags-append    ${archf}
             configure.cxxflags-append  ${archf}
-            configure.ldflags-append  ${archf}
+            configure.ldflags-append   ${archf}
 
             if { [info exists merger_configure_env(${arch})] } {
                 configure.env-append  $merger_configure_env(${arch})
@@ -312,4 +303,20 @@
             }
         }
     }
+
+    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
+        }
+        return ${archf}
+    }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090125/7230d1d1/attachment.html>


More information about the macports-changes mailing list