better SIGNAL
[sbcl.git] / run-sbcl.sh
bloba3507d168c8d82af123c0b6ae11c763699f76eb7
1 #!/bin/sh
2 # A simple shell-script to run the freshly build SBCL without
3 # installing it.
5 # This software is part of the SBCL system. See the README file for
6 # more information.
8 # This software is derived from the CMU CL system, which was
9 # written at Carnegie Mellon University and released into the
10 # public domain. The software is in the public domain and is
11 # provided with absolutely no warranty. See the COPYING and CREDITS
12 # files for more information.
14 set -e
16 BASE=`dirname "$0"`
17 if (readlink -f "${BASE}") >/dev/null 2>&1; then
18 BASE=`readlink -f ${BASE}`
19 else
20 opwd=`pwd`
21 cd "${BASE}"
22 BASE=`pwd`
23 cd "${opwd}"
25 if [ "$OSTYPE" = "cygwin" ]
26 then
27 BASE=`cygpath -w "$BASE"`
29 CORE_DEFINED=no
31 for arg in $*; do
32 case $arg in
33 --core)
34 CORE_DEFINED=yes
36 --help)
37 echo "usage: run-sbcl.sh sbcl-options*"
38 echo
39 echo "Runs SBCL from the build directory or binary tarball without need for"
40 echo "installation. Except for --help, accepts all the same command-line options"
41 echo "as SBCL does."
42 echo
43 exit 1
45 esac
46 done
48 ARGUMENTS=""
50 if [ "$CORE_DEFINED" = "no" ]; then
51 ARGUMENTS="--core "$BASE"/output/sbcl.core"
54 if [ -x "$BASE"/src/runtime/sbcl -a -f "$BASE"/output/sbcl.core ]; then
55 echo "(running SBCL from: $BASE)" 1>&2
56 SBCL_HOME="$BASE"/contrib "$BASE"/src/runtime/sbcl $ARGUMENTS "$@"
57 else
58 echo "No built SBCL here ($BASE): run 'sh make.sh' first!"
59 exit 1