Skip to content
Snippets Groups Projects
Commit d65a272e authored by Daniel Barlow's avatar Daniel Barlow
Browse files

s/-system/-op/

parent 9d9f8a71
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
(defclass constants-file (cl-source-file) ()) (defclass constants-file (cl-source-file) ())
(defmethod perform ((op compile-system) (component constants-file)) (defmethod perform ((op compile-op) (component constants-file))
;; we want to generate all our temporary files in the fasl directory ;; we want to generate all our temporary files in the fasl directory
;; because that's where we have write permission. Can't use /tmp; ;; because that's where we have write permission. Can't use /tmp;
;; it's insecure (these files will later be owned by root) ;; it's insecure (these files will later be owned by root)
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
(logical-pathname (translate-logical-pathname pathname)) (logical-pathname (translate-logical-pathname pathname))
(t pathname)))) (t pathname))))
(defmethod output-files ((operation compile-system) (dso unix-dso)) (defmethod output-files ((operation compile-op) (dso unix-dso))
(let ((dir (component-pathname dso))) (let ((dir (component-pathname dso)))
(list (list
(make-pathname :type "so" (make-pathname :type "so"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
:directory (butlast (pathname-directory dir)) :directory (butlast (pathname-directory dir))
:defaults dir)))) :defaults dir))))
(defmethod perform :after ((operation compile-system) (dso unix-dso)) (defmethod perform :after ((operation compile-op) (dso unix-dso))
(let ((dso-name (unix-name (car (output-files operation dso))))) (let ((dso-name (unix-name (car (output-files operation dso)))))
(unless (zerop (unless (zerop
(run-shell-command (run-shell-command
...@@ -66,38 +66,37 @@ ...@@ -66,38 +66,37 @@
(module-components dso))))) (module-components dso)))))
(error 'operation-error :operation operation :component dso)))) (error 'operation-error :operation operation :component dso))))
(defmethod perform ((operation load-system) (dso unix-dso)) (defmethod perform ((operation load-op) (dso unix-dso))
(let ((dso-name (unix-name (car (output-files (let ((dso-name (unix-name (car (output-files
(make-instance 'compile-system) dso))))) (make-instance 'compile-op) dso)))))
#+sbcl (sb-sys::load-1-foreign dso-name) #+sbcl (sb-sys::load-1-foreign dso-name)
#+cmu (system::load-object-file dso-name))) #+cmu (system::load-object-file dso-name)))
;;; if this goes into the standard asdf, it could reasonably be extended ;;; if this goes into the standard asdf, it could reasonably be extended
;;; to allow cflags to be set somehow ;;; to allow cflags to be set somehow
(defmethod output-files ((op compile-system) (c c-source-file)) (defmethod output-files ((op compile-op) (c c-source-file))
(list (let ((*default-pathname-defaults* *component-parent-pathname*)) (list (let ((*default-pathname-defaults* *component-parent-pathname*))
(make-pathname :type "o" :defaults (make-pathname :type "o" :defaults
(component-pathname c))))) (component-pathname c)))))
(defmethod perform ((op compile-system) (c c-source-file)) (defmethod perform ((op compile-op) (c c-source-file))
(unless (unless
(= 0 (run-shell-command "/usr/bin/gcc -fPIC -o ~S -c ~S" (= 0 (run-shell-command "/usr/bin/gcc -fPIC -o ~S -c ~S"
(unix-name (car (output-files op c))) (unix-name (car (output-files op c)))
(unix-name (component-pathname c)))) (unix-name (component-pathname c))))
(error 'operation-error :operation op :component c))) (error 'operation-error :operation op :component c)))
(defmethod perform ((operation load-system) (c c-source-file)) (defmethod perform ((operation load-op) (c c-source-file))
t) t)
(defmethod perform ((o load-system) (c unix-dso)) (defmethod perform ((o load-op) (c unix-dso))
(let ((co (make-instance 'compile-system))) (let ((co (make-instance 'compile-op)))
(perform co c) (perform co c)
(let ((filename (car (output-files co c)))) (let ((filename (car (output-files co c))))
#+cmu (system::load-object-file filename) #+cmu (system::load-object-file filename)
#+sbcl (sb-sys::load-1-foreign filename)))) #+sbcl (sb-sys::load-1-foreign filename))))
(defsystem db-sockets (defsystem db-sockets
:source-pathname #p"cl-library:db-sockets;"
:components ((:file "defpackage" :depends-on ("rt")) :components ((:file "defpackage" :depends-on ("rt"))
(:file "split" :depends-on ("defpackage")) (:file "split" :depends-on ("defpackage"))
(:unix-dso "alien" (:unix-dso "alien"
...@@ -108,13 +107,13 @@ ...@@ -108,13 +107,13 @@
(:constants-file "constants" (:constants-file "constants"
:pathname "constants.lisp" :pathname "constants.lisp"
:in-order-to :in-order-to
((compile-system ((compile-op
(load-system "def-to-lisp" (load-op "def-to-lisp"
"defpackage" "defpackage"
"foreign-glue")))) "foreign-glue"))))
(:file "sockets" (:file "sockets"
:in-order-to ((compile-system :in-order-to ((compile-op
(load-system "constants")))) (load-op "constants"))))
(:file "sockopt" :depends-on ("sockets")) (:file "sockopt" :depends-on ("sockets"))
(:file "inet" :depends-on ("sockets" "split" "constants" )) (:file "inet" :depends-on ("sockets" "split" "constants" ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment