-
Notifications
You must be signed in to change notification settings - Fork 6
/
irsim.sh.in
executable file
·52 lines (41 loc) · 1.37 KB
/
irsim.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
#
# For installation, put this file (irsim.sh) in a standard executable path.
# Put startup script "irsim.tcl" and shared library "tclirsim.so"
# in ${CAD_ROOT}/irsim/tcl/, with a symbolic link from file
# ".wishrc" to "irsim.tcl".
#
# This script starts irsim under the Tcl interpreter,
# reading commands from a special .wishrc script which
# launches irsim and retains the Tcl interactive interpreter.
# Parse for the argument "-c[onsole]". If it exists, run irsim
# with the TkCon console. Strip this argument from the argument list.
TKCON=true
IRSIM_WISH=WISH_EXE
export IRSIM_WISH
# Hacks for Cygwin
if [ "`uname | cut -d_ -f1`" = "CYGWIN" ]; then
export PATH="$PATH:TCLLIB_DIR"
export DISPLAY=${DISPLAY:=":0"}
fi
for i in $@ ; do
case $i in
-noc*) TKCON=;;
esac
done
if [ $TKCON ]; then
exec TCL_DIR/tkcon.tcl \
-eval "source TCL_DIR/console.tcl" \
-slave "package require Tk; set argc $#; set argv [list $*]; \
source TCL_DIR/irsim.tcl"
# exec TCL_DIR/tkcon.tcl -exec "" -eval \
# "set argc $#; set argv [list $*]; source TCL_DIR/irsim.tcl"
else
#
# Run the stand-in for wish (irsimexec), which acts exactly like "wish"
# except that it replaces ~/.wishrc with irsim.tcl. This executable is
# *only* needed when running without the console; the console itself is
# capable of sourcing the startup script.
#
exec TCL_DIR/irsimexec -- $@
fi