<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.

</pre>
<p><a href="https://github.com/macports/macports-base/commit/5a46743a6bd437d591985e514f471ed0441ea554">https://github.com/macports/macports-base/commit/5a46743a6bd437d591985e514f471ed0441ea554</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new 5a46743a set an appropriate SDKROOT when selfupdating
</span>5a46743a is described below

<span style='display:block; white-space:pre;color:#808000;'>commit 5a46743a6bd437d591985e514f471ed0441ea554
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Dec 31 13:05:19 2020 +1100

<span style='display:block; white-space:pre;color:#404040;'>    set an appropriate SDKROOT when selfupdating
</span>---
 src/macports1.0/selfupdate.tcl | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/selfupdate.tcl b/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index eea5a408..6b32768d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -186,16 +186,40 @@ proc selfupdate::main {{optionslist {}} {updatestatusvar {}}} {
</span>                 append configure_args " --with-unsupported-prefix"
             }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            # Choose a sane compiler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            # Choose a sane compiler and SDK
</span>             set cc_arg {}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+            set sdk_arg {}
</span>             if {$::macports::os_platform eq "darwin"} {
                 set cc_arg "CC=/usr/bin/cc "
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {$::macports::os_major >= 18 || ![file exists /usr/include/sys/cdefs.h]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set cltpath /Library/Developer/CommandLineTools
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set sdk_version $::macports::macos_version_major
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set check_dirs [list ${cltpath}/SDKs \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        ${::macports::developer_dir}/Platforms/MacOSX.platform/Developer/SDKs \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        ${::macports::developer_dir}/SDKs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    foreach check_dir $check_dirs {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set sdk ${check_dir}/MacOSX${sdk_version}.sdk
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        if {[file exists $sdk]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set sdk_arg "SDKROOT=${sdk} "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        } elseif {$::macports::os_major >= 20} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set matches [glob -nocomplain -directory ${check_dir} MacOSX${sdk_version}*.sdk]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            if {[llength $matches] > 1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                set matches [lsort -decreasing -command vercmp $matches]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            if {[llength $matches] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                set sdk_arg "SDKROOT=[lindex $matches 0] "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                                break
</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;'>+                    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span>             }
 
             # do the actual configure, build and installation of new base
             ui_msg "Installing new MacPorts release in $prefix as ${owner}:${group}; permissions ${perms}\n"
             try {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                system -W $mp_source_path "${cc_arg}./configure $configure_args && make SELFUPDATING=1 && make install SELFUPDATING=1"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                system -W $mp_source_path "${cc_arg}${sdk_arg}./configure $configure_args && ${sdk_arg}make SELFUPDATING=1 && make install SELFUPDATING=1"
</span>             } catch {{*} eCode eMessage} {
                 return -code error "Error installing new MacPorts base: $eMessage"
             }
</pre><pre style='margin:0'>

</pre>