File: find-tclsh

package info (click to toggle)
openocd 0.5.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 16,716 kB
  • sloc: ansic: 143,239; sh: 15,414; tcl: 5,758; makefile: 922; asm: 535; perl: 20
file content (14 lines) | stat: -rwxr-xr-x 535 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# Looks for a suitable tclsh or jimsh in the PATH
# If not found, builds a bootstrap jimsh from source
d=$(dirname "$0")
PATH="$PATH:$d"
for tclsh in jimsh tclsh8.5 tclsh8.6 jimsh0; do
	$tclsh "$d/test-tclsh" 2>/dev/null && exit 0
done
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
for cc in ${CC_FOR_BUILD:-cc} gcc; do
	$cc -o "$d/jimsh0" "$d/jimsh0.c" 2>/dev/null || continue
	"$d/jimsh0" "$d/test-tclsh" && exit 0
done
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."