-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild-sbcl.lisp
More file actions
45 lines (37 loc) · 1.55 KB
/
build-sbcl.lisp
File metadata and controls
45 lines (37 loc) · 1.55 KB
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
(in-package :cl-user)
(push :shuffletron-deploy *features*)
;;; Xach says never to do this:
(load "shuffletron.asd")
;;; (Sorry, Xach!)
(asdf:oos 'asdf:compile-op :shuffletron)
(asdf:oos 'asdf:load-op :shuffletron)
;;; Don't need this nonsense:
#+linux (sb-alien:unload-shared-object "librt.so")
#+linux (sb-alien:unload-shared-object "librt.so.1")
;;; Round up generated shared objects and put them in libs subdirectory:
#+linux
(let ((libdir (merge-pathnames
(make-pathname :directory '(:relative "libs"))
*load-pathname*)))
(format t "Gathering generated objects:~%")
(ensure-directories-exist libdir)
(loop for library in (cffi:list-foreign-libraries :type :grovel-wrapper)
for n upfrom 0
as filename = (cffi:foreign-library-pathname library)
as newname = (format nil "gen~D" n)
do
;; cffi-grovel previously didn't give generated libraries
;; meaningful or guaranteed unique names, so I rename them
;; myself.
(format t "~D: ~A~%" n filename)
(alexandria:copy-file filename
(merge-pathnames
(make-pathname :name newname :type "so")
libdir))
(cffi:close-foreign-library library)
(cffi:load-foreign-library (format nil "~A.so" newname))))
(print sb-sys:*shared-objects*)
(sb-ext:save-lisp-and-die "shuffletron-bin"
:executable t
:toplevel #'shuffletron:run
:save-runtime-options t)