summaryrefslogtreecommitdiff
blob: 39a42b7e5e65b0ec482ffaa0e798f66c016bf724 (plain)
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
;;; -*- mode: lisp; syntax: common-lisp; package: common-lisp -*-

(defpackage #:swank-system
  (:use #:common-lisp
        #:asdf))

(defpackage #:swank-loader
  (:use #:common-lisp))

(in-package #:swank-system)

;; http://www.caddr.com/macho/archives/sbcl-devel/2004-3/3014.html

(defclass unsafe-file (cl-source-file) ())

(defmethod perform :around ((op compile-op) (c unsafe-file))
  (setf (operation-on-warnings op) :ignore
        (operation-on-failure op) :warn) ; adjust to taste
  (call-next-method))

(defmacro define-swank-system (&rest sysdep-components)
  `(defsystem swank
       :name "Swank is the Common Lips back-end to SLIME"
       :serial t
       :components ((:file "swank-backend")
                    (:file "nregex")
                    ,@(mapcar #'(lambda (component)
                                  (if (atom component)
                                      (list :file component)
                                      component))
                              sysdep-components)
                    (:file "swank"))
       :depends-on (#+sbcl sb-bsd-sockets)))

#+sbcl  (define-swank-system "swank-sbcl" "swank-source-path-parser" "swank-gray")
#+cmu   (define-swank-system "swank-source-path-parser" "swank-cmucl")
#+clisp (define-swank-system "xref" "metering" "swank-clisp" "swank-gray")

(in-package #:swank-loader)

(defun user-init-file ()
  "Return the name of the user init file or nil."
  (probe-file (merge-pathnames (user-homedir-pathname)
                               (make-pathname :name ".swank" :type "lisp"))))

(when (user-init-file)
  (load (user-init-file)))

;; swank.asd ends here