Revision: 80088 http://trac.macports.org/changeset/80088 Author: jmr@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 } }
participants (1)
-
jmr@macports.org