<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/d41c34a1ee84ee538fb5b99ca64e34c8ab059a3c">https://github.com/macports/macports-ports/commit/d41c34a1ee84ee538fb5b99ca64e34c8ab059a3c</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit d41c34a1ee84ee538fb5b99ca64e34c8ab059a3c
</span>Author: Chris Jones <jonesc@macports.org>
AuthorDate: Thu May 6 11:46:06 2021 +0100
<span style='display:block; white-space:pre;color:#404040;'> compiler_wrapper PG: Add pipe and isysroot settings to wrappers
</span>---
_resources/port1.0/group/compiler_wrapper-1.0.tcl | 47 +++++++++++++++++------
1 file changed, 35 insertions(+), 12 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/compiler_wrapper-1.0.tcl b/_resources/port1.0/group/compiler_wrapper-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 824f7eee851..b8638640ab2 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/compiler_wrapper-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/compiler_wrapper-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -64,28 +64,39 @@ proc compwrap::comp_flags {tag} {
</span> return "[option configure.${ftag}flags] [get_canonical_archflags ${tag}]"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc compwrap::create_wrapper {tag} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc compwrap::wrapper_path {tag} {
</span> global prefix
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Get the underlying compiler
set comp [option configure.${tag}]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # If not defined, or tag not in list of known compilers to wrap, just return
if {${comp} eq "" || [lsearch -exact [option compwrap.compilers_to_wrap] ${tag}] < 0} {
return ${comp}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Create the directory for the wrapper. Format is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Return the path to the wrapper. Format is :-
</span> # <port workpath>/<compiler tag>/<path to underlying compiler>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set wrapdir [option workpath]/compwrap/${tag}[file dirname ${comp}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set comp [option workpath]/compwrap/${tag}${comp}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc compwrap::create_wrapper {tag} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global prefix env
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Get the underlying compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set comp [option configure.${tag}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Get the wrapper
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set wrapcomp [compwrap::wrapper_path ${tag}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { ${wrapcomp} eq ${comp} } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${comp}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Create the directory for the wrapper.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set wrapdir [file dirname ${wrapcomp}]
</span> if {![file exists ${wrapdir}]} {
xinstall -d ${wrapdir}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # Wrapper name, same as underlying compiler.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set fname ${wrapdir}/[file tail ${comp}]
</span>
# Force recreate in case underlying compiler has changed
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force ${fname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file delete -force ${wrapcomp}
</span>
# Basic option, to pass on all command line arguments
set comp_opts "[trim compwrap.compiler_pre_flags] [trim compwrap.compiler_args_forward] [trim compwrap.compiler_post_flags]"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -100,14 +111,26 @@ proc compwrap::create_wrapper {tag} {
</span> set comp_opts "\$\{MACPORTS_LEGACY_SUPPORT_CPPFLAGS\} ${comp_opts}"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # isysroot
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[option configure.sdkroot] ne "" && \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ![option compiler.limit_flags] && \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [lsearch -exact [option compwrap.ccache_supported_compilers] ${tag}] >= 0 } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set comp_opts "-isysroot[option configure.sdkroot] ${comp_opts}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # pipe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if { [option configure.pipe] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set comp_opts "-pipe ${comp_opts}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Prepend ccache launcher if active
if { [compwrap::use_ccache ${tag}] } {
set comp "${prefix}/bin/ccache ${comp}"
}
# Finally create the wrapper script
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Creating compiler wrapper ${fname}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set f [open ${fname} w 0755]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug "Creating compiler wrapper ${wrapcomp}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set f [open ${wrapcomp} w 0755]
</span> puts ${f} "#!/bin/bash"
# If ccache active make sure correct CCACHE_DIR is used as not all build systems
# (looking at you Bazel) propagate this flag.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -121,7 +144,7 @@ proc compwrap::create_wrapper {tag} {
</span> puts ${f} "exec \${CMD}"
close ${f}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return ${fname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ${wrapcomp}
</span> }
# Set various env vars
</pre><pre style='margin:0'>
</pre>