-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.lisp
58 lines (45 loc) · 1.96 KB
/
loader.lisp
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
;;;;;;;; function for loader-file relative paths ;;;;;;;;
(defun loadfn (name &key (dir nil) (type nil) (root *load-pathname*))
"(LOADFN DIR NAME) computes filename relative to load directory."
(when (not (listp dir)) (setq dir (list dir)))
(make-pathname :name name :type type
:directory (append (pathname-directory root) dir)))
(defun compilefn (name &key (dir nil) (type nil) (root *compile-file-pathname*))
"(COMPILEFN DIR NAME) computes filename relative to load directory."
(when (not (listp dir)) (setq dir (list dir)))
(make-pathname :name name :type type
:directory (append (pathname-directory root) dir)))
;;;;;;;; Loading subsystems ;;;;;;;;
; check if snark available
(ignore-errors (when (probe-file (loadfn "snark")) (push :snark *features*)))
#+snark
(format t "~&Snark is available.~%")
#-snark
(format t "~&Snark is unavailable.~%")
(defvar *localrootdir* *load-pathname*)
; external libraries
(load (loadfn "load" :dir "cl-ppcre-2.0.3")) ; regular expressions
(load (loadfn "load" :dir "cl-emb-0.4.4")) ; templates
;(load (loadfn "lex" :dir "cl-lex"))
(load (loadfn "load" :dir '("dso-lex-0.3.2" "dso-util-0.1.2"))) ; lex
(load (loadfn "load" :dir "dso-lex-0.3.2")) ; lex
(load (loadfn "yacc" :dir "cl-yacc-0.3")) ; yacc
(load (loadfn "loader" :dir "sapa-stats")) ; statistics
(load (loadfn "xmls" :dir "xmls-1.4.1")) ; XML/HTML parsing
; epilog
(load (loadfn "loader" :dir "epilog"))
; infomaster
(load (loadfn "loader" :dir "infomaster"))
; snark: load if possible
#+snark (progn
(load (loadfn "snark-system" :type "lisp" :dir "snark"))
(make-snark-system)
(in-package :common-lisp-user))
; global variables (set before researchmaster, as it loads code using web interface)
(setq *host* (hostname))
(setq *port* 3000)
(setq *home* "/docserver/")
(setq *homedir* (namestring (loadfn nil)))
(setq *web* (stringappend "http://" *host* ":" (princ-to-string *port*)))
; researchmaster
(load (loadfn "loader" :dir "researchmaster"))