<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/a24bcd61c347724cb05e83c6a67f11d7ddf004c3">https://github.com/macports/macports-ports/commit/a24bcd61c347724cb05e83c6a67f11d7ddf004c3</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a24bcd61c347724cb05e83c6a67f11d7ddf004c3
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Wed May 5 09:21:37 2021 +0100
<span style='display:block; white-space:pre;color:#404040;'> compilerwrapper: Make compiler lists configurable options
</span>---
_resources/port1.0/group/compilerwrapper-1.0.tcl | 45 ++++++------------------
1 file changed, 11 insertions(+), 34 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/compilerwrapper-1.0.tcl b/_resources/port1.0/group/compilerwrapper-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 1d42fc498c8..48edab3d19f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/compilerwrapper-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/compilerwrapper-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -25,11 +25,17 @@ default compwrap.compiler_post_flags {{}}
</span> options compwrap.compiler_args_forward
default compwrap.compiler_args_forward {{\$\{\@\}}}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+options compwrap.compilers_to_wrap
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default compwrap.compilers_to_wrap [list cc objc cxx objcxx fc f77 f90]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options compwrap.ccache_supported_compilers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default compwrap.ccache_supported_compilers [list cc objc cxx objcxx]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc compwrap::use_ccache {tag} {
global prefix
return [ expr [option configure.ccache] && \
[file exists ${prefix}/bin/ccache] && \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- [lsearch -exact [compwrap::known_fortran_compiler_tags] ${tag}] < 0 ]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [lsearch -exact [option compwrap.ccache_supported_compilers] ${tag}] >= 0 ]
</span> }
proc compwrap::get_ccache_dir {} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,14 +47,6 @@ proc compwrap::get_ccache_dir {} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc compwrap::known_compiler_tags {} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return [list cc objc cxx objcxx fc f77 f90]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-proc compwrap::known_fortran_compiler_tags {} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return [list fc f77 f90]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> proc compwrap::trim {c} {
if { [string range [option $c] 0 0] eq "\{" } {
return [string range [option $c] 1 end-1 ]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -63,7 +61,7 @@ proc compwrap::create_wrapper {tag} {
</span> # Get the underlying compiler
set comp [option configure.${tag}]
# If not defined, or tag not in list of known compilers to wrap, just return
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${comp} eq "" || [lsearch -exact [compwrap::known_compiler_tags] ${tag}] < 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${comp} eq "" || [lsearch -exact [option compwrap.compilers_to_wrap] ${tag}] < 0} {
</span> return ${comp}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -115,36 +113,15 @@ proc compwrap::create_wrapper {tag} {
</span> return ${fname}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc compwrap::get_compiler {tag} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set comp [option configure.${tag}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[option configure.ccache]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set comp [compwrap::create_wrapper ${tag}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return ${comp}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Set various env vars
proc compwrap::configure_envs {} {
global prefix
# Set some cmake env vars incase build uses cmake
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach tag [compwrap::known_compiler_tags] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach tag [option compwrap.compilers_to_wrap] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check for compilers supported by ccache
</span> if {[compwrap::use_ccache ${tag}]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- switch ${tag} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fc {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ctag Fortran
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- f77 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ctag Fortran
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- f90 {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ctag Fortran
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ctag [string toupper $tag]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> foreach phase [list configure build destroot] {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ${phase}.env-append CMAKE_${ctag}_COMPILER_LAUNCHER=${prefix}/bin/ccache
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${phase}.env-append CMAKE_[string toupper $tag]_COMPILER_LAUNCHER=${prefix}/bin/ccache
</span> }
}
}
</pre><pre style='margin:0'>
</pre>