Prims - die halts execution
[clnl] / bin / buildwindowsexec.sh
1 #!/bin/bash
2
3 # This sciprt builds a version of sbcl pre loaded with libraries that can run on windows.
4 # You can use ./winsbcl.exe to run it
5
6 # It is meant to be run from cygwin
7
8 if ! type sbcl &> /dev/null ; then
9   echo "Please install sbcl.  A version has been included in deps/windows for your convenience"
10   exit 1
11 fi
12
13 sbcl_exec=$(which sbcl)
14 sbcl_dir=${sbcl_exec%sbcl}
15
16 if [ ! -e "$sbcl_dir/freeglut.dll" ] ; then
17   echo "Please copy deps/windows/freeglut.dll into $sbcl_dir"
18   exit 1
19 fi
20
21 if [ ! -e "$sbcl_dir/pdcurses.dll" ] ; then
22   echo "Please copy deps/windows/pdcurses.dll into $sbcl_dir"
23   exit 1
24 fi
25
26 mkdir -p tmp/deps/
27
28 ( cd tmp/deps &&
29   tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
30   tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
31   tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
32   tar zxf ../../deps/common-lisp/cffi_0.15.0.tar.gz &&
33   tar zxf ../../deps/common-lisp/cl-ppcre.tar.gz &&
34   tar zxf ../../deps/common-lisp/ironclad.tar.gz &&
35   tar zxf ../../deps/common-lisp/mt19937-latest.tar.gz &&
36   tar zxf ../../deps/common-lisp/nibbles-v0.12.tar.gz &&
37   tar zxf ../../deps/common-lisp/trivial-features_0.8.tar.gz &&
38   tar zxf ../../deps/common-lisp/cl-charms-9bb94ef.tar.gz &&
39   tar zxf ../../deps/common-lisp/ieee-floats-92e481a.tar.gz &&
40   tar zxf ../../deps/common-lisp/strictmath_0.1.tar.gz
41 )
42
43 cur_dir=$(cygpath -d $PWD)
44 escaped_cur_dir=${cur_dir//\\/\\\\}
45
46 sbcl --no-sysinit --no-userinit \
47   --eval "(require 'asdf)" \
48   --eval "(asdf:initialize-source-registry '(:source-registry (:tree \"${escaped_cur_dir}\\\\tmp\\\\deps\") (:directory \"${escaped_cur_dir}\\\\src\\\\main\") :IGNORE-INHERITED-CONFIGURATION))" \
49   --eval "(asdf:load-system :clnl)" \
50   --eval "(asdf:clear-output-translations)" \
51   --eval '(sb-ext:save-lisp-and-die "clnl.exe" :executable t :toplevel (function clnl:run))'
52
53 rm -rf tmp
54
55 echo "Executable is clnl.exe"