aboutsummaryrefslogtreecommitdiff
path: root/autosetup/test-tclsh
diff options
context:
space:
mode:
Diffstat (limited to 'autosetup/test-tclsh')
-rw-r--r--autosetup/test-tclsh21
1 files changed, 21 insertions, 0 deletions
diff --git a/autosetup/test-tclsh b/autosetup/test-tclsh
new file mode 100644
index 0000000..52b5f7f
--- /dev/null
+++ b/autosetup/test-tclsh
@@ -0,0 +1,21 @@
+# A small Tcl script to verify that the chosen
+# interpreter works. Sometimes we might e.g. pick up
+# an interpreter for a different arch.
+# Outputs the full path to the interpreter
+
+if {[catch {info version} version] == 0} {
+ if {$version >= 0.70} {
+ # Ensure that regexp works
+ regexp a a
+
+ # Unlike Tcl, [info nameofexecutable] can return a relative path
+ puts [file join [pwd] [info nameofexecutable]]
+ exit 0
+ }
+} elseif {[catch {info tclversion} version] == 0} {
+ if {$version >= 8.5} {
+ puts [info nameofexecutable]
+ exit 0
+ }
+}
+exit 1