1#!/bin/sh 2# Looks for a suitable tclsh or jimsh in the PATH 3# If not found, builds a bootstrap jimsh from source 4d=`dirname "$0"` 5{ "$d/jimsh0" "$d/test-tclsh"; } 2>/dev/null && exit 0 6PATH="$PATH:$d" 7for tclsh in jimsh tclsh tclsh8.5 tclsh8.6; do 8 { $tclsh "$d/test-tclsh"; } 2>/dev/null && exit 0 9done 10echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0" 11./make-bootstrap-jim > $d/jimsh0.c 12for cc in ${CC_FOR_BUILD:-cc} gcc; do 13 { $cc -o "$d/jimsh0" "$d/jimsh0.c"; } 2>/dev/null || continue 14 "$d/jimsh0" "$d/test-tclsh" && exit 0 15done 16echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc." 17echo false 18