[80088] trunk/base/src

jmr at macports.org jmr at macports.org
Sun Jul 3 18:25:11 PDT 2011


Revision: 80088
          http://trac.macports.org/changeset/80088
Author:   jmr at macports.org
Date:     2011-07-03 18:25:09 -0700 (Sun, 03 Jul 2011)
Log Message:
-----------
choose default configure.compiler based on Xcode version (#30009)

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/port1.0/portconfigure.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2011-07-04 00:22:51 UTC (rev 80087)
+++ trunk/base/src/macports1.0/macports.tcl	2011-07-04 01:25:09 UTC (rev 80088)
@@ -374,8 +374,7 @@
                         set macports::xcodeversion "3.2.6"
                     } elseif {$devtoolscore_v >= 1204.0} {
                         set macports::xcodeversion "3.1.4"
-                    } elseif {$devtoolscore_v > 921.0} {
-                        # XXX find actual version corresponding to 3.1
+                    } elseif {$devtoolscore_v >= 1100.0} {
                         set macports::xcodeversion "3.1"
                     } elseif {$devtoolscore_v >= 921.0} {
                         set macports::xcodeversion "3.0"
@@ -3026,11 +3025,10 @@
                 append configure_args " --with-unsupported-prefix"
             }
 
+            # Choose a sane compiler
             set cc_arg ""
-            switch -glob -- $::macports::macosx_version {
-                10.[45] { set cc_arg "CC=/usr/bin/gcc-4.0 " }
-                10.6     { set cc_arg "CC=/usr/bin/gcc-4.2 " }
-                10.*     { set cc_arg "CC=/usr/bin/llvm-gcc-4.2 " }
+            if {$::macports::os_platform == "darwin"} {
+                set cc_arg "CC=/usr/bin/cc "
             }
 
             # do the actual configure, build and installation of new base

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2011-07-04 00:22:51 UTC (rev 80087)
+++ trunk/base/src/port1.0/portconfigure.tcl	2011-07-04 01:25:09 UTC (rev 80088)
@@ -352,28 +352,15 @@
 
 # internal function to determine the default compiler
 proc portconfigure::configure_get_default_compiler {args} {
-    global macosx_deployment_target developer_dir
-    switch -exact ${macosx_deployment_target} {
-        "10.4"      -
-        "10.5"      {
-            if {![file executable /usr/bin/gcc-4.0]} {
-                if {[file executable /usr/bin/gcc-4.2]} {
-                    return gcc-4.2
-                } elseif {[file executable ${developer_dir}/usr/bin/llvm-gcc-4.2]} {
-                    return llvm-gcc-4.2
-                }
-            }
-            return gcc-4.0
-        }
-        "10.6"      {
-            if {![file executable /usr/bin/gcc-4.2] &&
-                [file executable ${developer_dir}/usr/bin/llvm-gcc-4.2]} {
-                return llvm-gcc-4.2
-            }
-            return gcc-4.2
-        }
-        "10.7"      { return llvm-gcc-4.2 }
-        default     { return gcc }
+    global xcodeversion macosx_deployment_target
+    if {$xcodeversion == "none" || $xcodeversion == ""} {
+        return gcc
+    } elseif {[rpm-vercomp $xcodeversion 4.0] >= 0} {
+        return llvm-gcc-4.2
+    } elseif {[rpm-vercomp $xcodeversion 3.2] >= 0 && $macosx_deployment_target != "10.4"} {
+        return gcc-4.2
+    } else {
+        return gcc-4.0
     }
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110703/b5d67fb4/attachment.html>


More information about the macports-changes mailing list