[104174] trunk/base/src/port1.0/portconfigure.tcl
larryv at macports.org
larryv at macports.org
Tue Mar 19 16:12:45 PDT 2013
Revision: 104174
https://trac.macports.org/changeset/104174
Author: larryv at macports.org
Date: 2013-03-19 16:12:45 -0700 (Tue, 19 Mar 2013)
Log Message:
-----------
portconfigure.tcl: Allow globs in configure.blacklist.
This allows things like `configure.blacklist *gcc*`. Any pattern accepted by Tcl's "string match" is valid.
Modified Paths:
--------------
trunk/base/src/port1.0/portconfigure.tcl
Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl 2013-03-19 19:41:16 UTC (rev 104173)
+++ trunk/base/src/port1.0/portconfigure.tcl 2013-03-19 23:12:45 UTC (rev 104174)
@@ -406,22 +406,28 @@
# internal function to determine the default compiler
proc portconfigure::configure_get_default_compiler {args} {
- global compiler.blacklist compiler.whitelist compiler.fallback
- if {${compiler.whitelist} != {}} {
- set search_list ${compiler.whitelist}
+ if {[option compiler.whitelist] != {}} {
+ set search_list [option compiler.whitelist]
} else {
- set search_list ${compiler.fallback}
+ set search_list [option compiler.fallback]
}
foreach compiler $search_list {
- if {[lsearch -exact ${compiler.blacklist} $compiler] == -1} {
- if {[file executable [configure_get_compiler cc $compiler]]
- || [compiler_is_port $compiler]} {
- return $compiler
+ set blocked no
+ foreach pattern [option compiler.blacklist] {
+ if {[string match $pattern $compiler]} {
+ set blocked yes
+ break
}
}
+ if {!$blocked &&
+ ([file executable [configure_get_compiler cc $compiler]] ||
+ [compiler_is_port $compiler])
+ } then {
+ return $compiler
+ }
}
- ui_warn "All compilers are either blacklisted or unavailable; using first fallback entry as last resort"
- return [lindex ${compiler.fallback} 0]
+ ui_warn "All compilers are either blacklisted or unavailable; defaulting to first fallback option"
+ return [lindex [option compiler.fallback] 0]
}
# internal function to choose compiler fallback list based on platform
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130319/b5fd2739/attachment.html>
More information about the macports-changes
mailing list