-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sh
executable file
·53 lines (47 loc) · 1.31 KB
/
build.sh
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
#!/bin/sh
unset backends
SBCL=${SBCL:-clbuild lisp}
if test $# -eq 0; then
cat <<eof
Building backends tty and clx.
(Specify backend types at the command line to override this default.)
eof
else
while test $# -gt 0; do
case $1 in
tty|clx|qt)
backends="$backends :hemlock.$1"
echo backend $1 enabled
shift
;;
*)
echo invalid backend type $1
exit 1
;;
esac
done
fi
$SBCL <<EOF
;; NOTE: the order in which clx and tty are given matters.
;; The last backend loaded is the default, and only if no $DISPLAY is
;; specified, main.lisp has special-cased the tty backend as a fallback,
;; so CLX must come last to have a chance of overriding it.
;;
(dolist (system (or '($backends) '(:hemlock.tty :hemlock.clx)))
(asdf:operate 'asdf:load-op system))
(defun hemlock-toplevel ()
#+ccl (when (find-package :qt) (funcall (find-symbol "REBIRTH" :qt)))
(let ((argv0 (car (command-line-arguments:get-command-line-arguments))))
(setf hi::*installation-directory*
(concatenate
'string
(iolib.pathnames:file-path-directory argv0 :namestring t)
"/"))
(setf hemlock::*slave-command* (list argv0 "--slave"))
(hemlock:main))
(quit))
(sb-ext:save-lisp-and-die "hemlock"
:save-runtime-options t
:toplevel 'hemlock-toplevel
:executable t)
EOF