|
|
|
@ -2446,6 +2446,16 @@ set rtfolder $binfolder/runtime/$rt_os_arch |
|
|
|
set rt_sourcefolder $sourcefolder/runtime ;#where our config lives |
|
|
|
set rt_sourcefolder $sourcefolder/runtime ;#where our config lives |
|
|
|
#review - when building kits for other platforms - it's unlikely runtime will be marked as executable - we should probably process all files in runtime folder except those with certain extensions |
|
|
|
#review - when building kits for other platforms - it's unlikely runtime will be marked as executable - we should probably process all files in runtime folder except those with certain extensions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc ::punkboot::lib::runtime_buildcopyname {runtime} { |
|
|
|
|
|
|
|
if {$::tcl_platform(platform) eq "windows"} { |
|
|
|
|
|
|
|
set rtname [file rootname [file tail $runtime]] |
|
|
|
|
|
|
|
set bcname ${rtname}_BUILDCOPY.exe |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
set rtname [file tail $runtime] |
|
|
|
|
|
|
|
set bcname ${rtname}_BUILDCOPY |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $bcname |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set runtimes [list] |
|
|
|
set runtimes [list] |
|
|
|
if {[file dirname [info nameofexecutable]] eq $rtfolder} { |
|
|
|
if {[file dirname [info nameofexecutable]] eq $rtfolder} { |
|
|
|
@ -2453,9 +2463,11 @@ if {[file dirname [info nameofexecutable]] eq $rtfolder} { |
|
|
|
# - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. |
|
|
|
# - when the current runtime is using a runtime in the rtfolder that is a tclkit, it is mounted at the same path as the physical file and so appears to Tcl as if it's a directory. |
|
|
|
# - use external filesystem tools to make a copy of the file |
|
|
|
# - use external filesystem tools to make a copy of the file |
|
|
|
if {$::tcl_platform(platform) eq "windows"} { |
|
|
|
if {$::tcl_platform(platform) eq "windows"} { |
|
|
|
exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe |
|
|
|
#exec cmd /c copy [info nameofexecutable] $rtfolder/[file rootname [file tail [info nameofexecutable]]]_BUILDCOPY.exe |
|
|
|
|
|
|
|
exec cmd /c copy [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY |
|
|
|
#exec cp [info nameofexecutable] $rtfolder/[file tail [info nameofexecutable]]_BUILDCOPY |
|
|
|
|
|
|
|
exec cp [info nameofexecutable] $rtfolder/[punkboot::lib::runtime_buildcopyname [info nameofexecutable]] |
|
|
|
} |
|
|
|
} |
|
|
|
lappend runtimes [file tail [info nameofexecutable]] |
|
|
|
lappend runtimes [file tail [info nameofexecutable]] |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2491,13 +2503,34 @@ if {$sdxpath eq ""} { |
|
|
|
set sdxpath [auto_execok sdx] |
|
|
|
set sdxpath [auto_execok sdx] |
|
|
|
} |
|
|
|
} |
|
|
|
if {$sdxpath eq ""} { |
|
|
|
if {$sdxpath eq ""} { |
|
|
|
#last resort - a tclkit and sdx.kit fine |
|
|
|
#last resorts - a tclkit and sdx.kit file |
|
|
|
if {[file exists $binfolder/sdx.kit]} { |
|
|
|
if {[file exists $binfolder/sdx.kit]} { |
|
|
|
set tclkitpath [auto_execok $binfolder/tclkit] |
|
|
|
set tclkitpath [auto_execok $binfolder/tclkit] |
|
|
|
if {$tclkitpath eq ""} { |
|
|
|
if {$tclkitpath eq ""} { |
|
|
|
set tclkitpath [auto_execok tclkit] |
|
|
|
set tclkitpath [auto_execok tclkit] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if {$tclkitpath ne ""} { |
|
|
|
set sdxpath [list {*}$tclkitpath $binfolder/sdx.kit] |
|
|
|
set sdxpath [list {*}$tclkitpath $binfolder/sdx.kit] |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
#see if the runtime (or any runtime *for current platform*) has tclkit in the name or has_starkit(?) and use that |
|
|
|
|
|
|
|
#todo - review |
|
|
|
|
|
|
|
#picking first found for now - fix |
|
|
|
|
|
|
|
dict for {rtname rtprops} $runtime_caps { |
|
|
|
|
|
|
|
if {[dict exists $rtprops has_starkit] && [dict get $rtprops has_starkit]} { |
|
|
|
|
|
|
|
set testpath $rtfolder/$rtname |
|
|
|
|
|
|
|
if {[file exists $testpath]} { |
|
|
|
|
|
|
|
if {[file type $testpath] eq "directory"} { |
|
|
|
|
|
|
|
set tclkitpath $rtfolder/[punk::lib::runtime_buildcopyname $testpath] |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
set tclkitpath $testpath |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if {$tclkitpath ne "" && [file exists $tclkitpath]} { |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|