aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2016-04-04 05:24:45 +1000
committerSteve Bennett <steveb@workware.net.au>2016-08-17 15:57:39 +1000
commit97fd55353a2cc0b874e30a3c3ed63bf0ec2edc59 (patch)
treeaa646c63d7be3ae0e5fd99673fa0a7a500056682 /bootstrap.tcl
parent0f35c013121121193b8f12e59015cf9c2da4ae10 (diff)
downloadjimtcl-97fd55353a2cc0b874e30a3c3ed63bf0ec2edc59.zip
jimtcl-97fd55353a2cc0b874e30a3c3ed63bf0ec2edc59.tar.gz
jimtcl-97fd55353a2cc0b874e30a3c3ed63bf0ec2edc59.tar.bz2
bootstrap: Add minimal package require support
Makes it easier to run the test suite if a minmal 'package require' is supported. Also omit SSL code from jim-aio.c Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'bootstrap.tcl')
-rw-r--r--bootstrap.tcl15
1 files changed, 12 insertions, 3 deletions
diff --git a/bootstrap.tcl b/bootstrap.tcl
index e7adf4b..f6c404f 100644
--- a/bootstrap.tcl
+++ b/bootstrap.tcl
@@ -1,3 +1,12 @@
-# No need for package support in the bootstrap jimsh, but
-# Tcl extensions call package require
-proc package {args} {}
+# Minimal support for package require
+# No error on failure since C extensions aren't handled
+proc package {cmd pkg} {
+ if {$cmd eq "require"} {
+ foreach path $::auto_path {
+ if {[file exists $path/$pkg.tcl]} {
+ uplevel #0 [list source $path/$pkg.tcl]
+ return
+ }
+ }
+ }
+}