Initial commit
[cl-vendor.git] / vendor.lisp
blobbbed723bcefafc0523d06eaa866d0c108589abbe
1 (in-package vendor)
3 (defvar *init-file*
4 #+sbcl
5 ".sbclrc"
6 #+(and ccl windows)
7 "ccl-init.lisp"
8 #+(and ccl (not windows))
9 ".ccl-init.lisp")
11 (:implementation allegro
12 ".clinit.cl")
13 (:implementation abcl
14 ".abclrc")
15 (:implementation ccl
16 #+windows
17 "ccl-init.lisp"
18 #-windows
19 ".ccl-init.lisp")
20 (:implementation clisp
21 ".clisprc.lisp")
22 (:implementation ecl
23 ".eclrc")
24 (:implementation lispworks
25 ".lispworks")
26 (:implementation sbcl
27 ".sbclrc")
28 (:implementation cmucl
29 ".cmucl-init.lisp")
30 (:implementation scl
31 ".scl-init.lisp")
36 (defun write-to-init-file (code)
37 (with-open-file (stream *init-file* :direction :output :if-exists :append)
38 (write-string code stream)
40 (export 'write-to-init-file)
42 (defun write-vendor-to-init-file ()
43 (write-to-init-file (format nil "~%(require 'cl-vendor)~%")))
44 (export 'write-vendor-to-init-file)
46 (defmacro error-platform-unsupported ()
47 `(error "This platform is not supported"))
49 (defun quit (&optional (exit-code 0))
50 (declare (ignorable exit-code))
51 #+sbcl
52 (sb-ext:quit)
53 #+ccl
54 (ccl:quit)
55 #-(or sbcl ccl)
56 (error-platform-unsupported)
58 (export 'quit)
61 (defun generate-exe (filename toplevel-fn)
62 #+ccl
63 (progn
64 (ccl:save-application filename
65 :toplevel-function toplevel-fn
66 :error-handler :quit
67 :prepend-kernel t)
68 (quit)
71 #+sbcl
72 (sb-ext:save-lisp-and-die filename
73 :toplevel toplevel-fn
74 :executable t)
76 #-(or sbcl ccl)
77 (error-platform-unsupported)
79 (export 'generate-exe)
81 (defmacro eval-when-all (&body body)
82 `(eval-when (:compile-toplevel :load-toplevel :execute)
83 ,@body))
85 (export 'eval-when-all)