Revision: 79943 http://trac.macports.org/changeset/79943 Author: jmr@macports.org Date: 2011-06-29 19:29:09 -0700 (Wed, 29 Jun 2011) Log Message: ----------- add fallbacks for default configure.compiler when targeting older OS versions and using newer dev tools Modified Paths: -------------- trunk/base/src/port1.0/portconfigure.tcl Modified: trunk/base/src/port1.0/portconfigure.tcl =================================================================== --- trunk/base/src/port1.0/portconfigure.tcl 2011-06-30 02:19:54 UTC (rev 79942) +++ trunk/base/src/port1.0/portconfigure.tcl 2011-06-30 02:29:09 UTC (rev 79943) @@ -352,11 +352,26 @@ # internal function to determine the default compiler proc portconfigure::configure_get_default_compiler {args} { - global macosx_deployment_target + global macosx_deployment_target developer_dir switch -exact ${macosx_deployment_target} { "10.4" - - "10.5" { return gcc-4.0 } - "10.6" { return gcc-4.2 } + "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 } }