From b9380691d2a69e2371a356d00940e26aaf83eb48 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Sat, 5 Aug 2023 05:01:57 +1000 Subject: [PATCH] Fix build.tcl for case when sdx uses punk runtime instead of external tclsh --- src/make.tcl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/make.tcl b/src/make.tcl index dbf6d7f9..c469fc4f 100644 --- a/src/make.tcl +++ b/src/make.tcl @@ -60,6 +60,11 @@ if {[llength $runtimes] > 1} { } set runtimefile [lindex $runtimes 0] +#sdx *may* be pointed to use the runtime we use to build the kit, or the user may manually use this runtime if they don't have tclsh +#sdx will complain if the same runtime is used for the shell as is used in the -runtime argument - so we make a copy (REVIEW) +if {![file exists $sourcefolder/_build/buildruntime.exe]} { + file copy $rtfolder/$runtimefile $sourcefolder/_build/buildruntime.exe +} puts stdout "Found [llength $vfs_folders] .vfs folders - building executable for each..." foreach vfs $vfs_folders { @@ -72,12 +77,12 @@ foreach vfs $vfs_folders { file delete $sourcefolder/_build/$vfsname } - puts stdout "building $vfsname with sdx.." + puts stdout "building $vfsname with sdx.. vfsdir:$vfs cwd: [pwd]" if {[catch { - exec sdx wrap _build/$vfsname -runtime runtime/$runtimefile -verbose + exec sdx wrap [pwd]/_build/$vfsname -vfs [pwd]/$vfs -runtime $sourcefolder/_build/buildruntime.exe -verbose } result]} { - puts stderr "sdx wrap _build/$vfsname -runtime runtime/$runtimefile -verbose failed with msg: $result" + puts stderr "sdx wrap _build/$vfsname -vfs [pwd]/$vfs -runtime $sourcefolder/_build/buildruntime.exe -verbose failed with msg: $result" } else { puts stdout "ok - finished sdx" set separator [string repeat = 40]