Fossil SCM

fossil-scm / autosetup / autosetup-find-tclsh
Source Blame History 16 lines
51d006f… stephan 1 #!/bin/sh
51d006f… stephan 2 # Looks for a suitable tclsh or jimsh in the PATH
370c263… stephan 3 # If not found, builds a bootstrap jimsh in current dir from source
370c263… stephan 4 # Prefer $autosetup_tclsh if is set in the environment (unless ./jimsh0 works)
370c263… stephan 5 # If an argument is given, use that as the test instead of autosetup-test-tclsh
370c263… stephan 6 d="`dirname "$0"`"
370c263… stephan 7 for tclsh in ./jimsh0 $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; do
ddfc5c4… stephan 8 { $tclsh "$d/${1-autosetup-test-tclsh}"; } 2>/dev/null && exit 0
51d006f… stephan 9 done
51d006f… stephan 10 echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
51d006f… stephan 11 for cc in ${CC_FOR_BUILD:-cc} gcc; do
ddfc5c4… stephan 12 { $cc -o jimsh0 "$d/jimsh0.c"; } >/dev/null 2>&1 || continue
ddfc5c4… stephan 13 ./jimsh0 "$d/${1-autosetup-test-tclsh}" && exit 0
51d006f… stephan 14 done
51d006f… stephan 15 echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."
51d006f… stephan 16 echo false

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button