File: xcircuit.sh.in

package info (click to toggle)
xcircuit 3.9.73%2Bdfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,560 kB
  • sloc: ansic: 80,417; sh: 7,295; tcl: 5,891; python: 449; makefile: 300
file content (60 lines) | stat: -rwxr-xr-x 1,460 bytes parent folder | download | duplicates (4)
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
53
54
55
56
57
58
59
60
#!/bin/sh
#
# This script starts xcircuit under the Tcl interpreter,
# reading commands from a special .wishrc script which
# launches xcircuit and retains the Tcl interactive interpreter.
#

loclibdir=${XCIRCUIT_LIB_DIR:=XCLIBDIR}
exelibdir=${XCIRCUIT_LIB_DIR:=XCEXELIBDIR}
export XCIRCUIT_LIB_DIR
export XCIRCUIT_EXELIB_DIR
XCIRCUIT_WISH=WISH_EXE
export XCIRCUIT_WISH

# Hacks for Cygwin
if [ ${TERM:=""} = "cygwin" ]; then
   export PATH=$PATH:TCLLIBDIR
   export DISPLAY=${DISPLAY:=":0"}
fi

TKCON=true
for i in $@ ; do
   case $i in
      -noc*)
	   TKCON=;;
      --help)
	   echo "Standard usage:"
	   echo "   xcircuit [filename]"
	   echo "Online documentation:"
	   echo "   http://opencircuitdesign.com/xcircuit"
	   exit 0
	   ;;
      --version)
	   echo "XCircuit version PROG_VERSION revision PROG_REVISION"
	   exit 0
	   ;;
   esac
done

if [ $TKCON ]; then

   if [ ! -f ${loclibdir}/CONSOLE ]; then
      loclibdir=${loclibdir}/tcl
   fi

   exec ${loclibdir}/CONSOLE \
	-eval "source ${loclibdir}/CONSOLE_SCRIPT" \
        -slave "package require Tk; set argc $#; set argv [list $*]; \
        source ${loclibdir}/WRAPPER_INIT"
else

#
# Run the stand-in for wish (xcircexec), which acts exactly like "wish"
# except that it replaces ~/.wishrc with xcircuit.tcl.  This executable is
# *only* needed when running without the console; the console itself is
# capable of sourcing the startup script.
#
   exec ${exelibdir}/xcircexec -- $@

fi