Skip to content

Commit

Permalink
Make Nibbles work well both with ASDF 2.27 and with earlier versions.
Browse files Browse the repository at this point in the history
Stop using the :if-component-dep-fails feature dropped in ASDF 2.27.
Instead use proper #+ read-time conditionals in the SBCL-only files.
This keeps all files tracked as part of the component tree.
Simplify some of the ASDF plumbing.
  • Loading branch information
fare authored and froydnj committed Dec 28, 2012
1 parent 535f975 commit 85d94f3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
29 changes: 5 additions & 24 deletions nibbles.asd
Expand Up @@ -5,11 +5,8 @@


(cl:in-package :nibbles-system) (cl:in-package :nibbles-system)


(defclass txt-file (asdf:doc-file) ()) (defclass txt-file (asdf:doc-file) ((type :initform "txt")))
(defclass css-file (asdf:doc-file) ()) (defclass css-file (asdf:doc-file) ((type :initform "css")))

(defmethod asdf:source-file-type ((c txt-file) (s asdf:module)) "txt")
(defmethod asdf:source-file-type ((c css-file) (s asdf:module)) "css")


(asdf:defsystem :nibbles (asdf:defsystem :nibbles
:version "0.10" :version "0.10"
Expand All @@ -30,27 +27,15 @@
(:css-file "style"))) (:css-file "style")))
(:module "sbcl-opt" (:module "sbcl-opt"
:depends-on ("package" "macro-utils") :depends-on ("package" "macro-utils")
:if-component-dep-fails :ignore :components ((:file "fndb")
:components ((:file "fndb"
:in-order-to ((asdf:compile-op
(asdf:feature :sbcl))))
(:file "nib-tran" :depends-on ("fndb")) (:file "nib-tran" :depends-on ("fndb"))
(:file "x86-vm" (:file "x86-vm" :depends-on ("fndb"))
:in-order-to ((asdf:compile-op (asdf:feature :x86)) (:file "x86-64-vm" :depends-on ("fndb"))))))
(asdf:compile-op (asdf:load-op "fndb"))))
(:file "x86-64-vm" :depends-on ("fndb")
:in-order-to ((asdf:compile-op (asdf:feature :x86-64))
(asdf:compile-op (asdf:load-op "fndb"))))))))


(defmethod asdf:perform ((op asdf:test-op) (defmethod asdf:perform ((op asdf:test-op)
(c (eql (asdf:find-system :nibbles)))) (c (eql (asdf:find-system :nibbles))))
(asdf:oos 'asdf:test-op 'nibbles-tests)) (asdf:oos 'asdf:test-op 'nibbles-tests))


;;; A tester's job is never done!
(defmethod asdf:operation-done-p ((op asdf:test-op)
(c (eql (asdf:find-system :nibbles))))
nil)

(asdf:defsystem :nibbles-tests (asdf:defsystem :nibbles-tests
:depends-on (:nibbles) :depends-on (:nibbles)
:version "0.1" :version "0.1"
Expand All @@ -60,10 +45,6 @@
:components ((:file "rt") :components ((:file "rt")
(:file "tests" :depends-on ("rt")))) (:file "tests" :depends-on ("rt"))))


(defmethod asdf:operation-done-p ((op asdf:test-op)
(c (eql (asdf:find-system :nibbles-tests))))
nil)

(defmethod asdf:perform ((op asdf:test-op) (defmethod asdf:perform ((op asdf:test-op)
(c (eql (asdf:find-system :nibbles-tests)))) (c (eql (asdf:find-system :nibbles-tests))))
(or (funcall (intern "DO-TESTS" (find-package "RTEST"))) (or (funcall (intern "DO-TESTS" (find-package "RTEST")))
Expand Down
4 changes: 4 additions & 0 deletions sbcl-opt/fndb.lisp
Expand Up @@ -2,6 +2,8 @@


(cl:in-package :nibbles) (cl:in-package :nibbles)


#+sbcl (progn

;;; Efficient array bounds checking ;;; Efficient array bounds checking
(sb-c:defknown %check-bound (sb-c:defknown %check-bound
((simple-array (unsigned-byte 8) (*)) index (and fixnum sb-vm:word) ((simple-array (unsigned-byte 8) (*)) index (and fixnum sb-vm:word)
Expand Down Expand Up @@ -39,3 +41,5 @@
,internal-arg-types ,internal-arg-types
,arg-type) into defknowns ,arg-type) into defknowns
finally (return `(progn ,@defknowns))) finally (return `(progn ,@defknowns)))

);#+sbcl
4 changes: 4 additions & 0 deletions sbcl-opt/nib-tran.lisp
Expand Up @@ -2,6 +2,8 @@


(cl:in-package :nibbles) (cl:in-package :nibbles)


#+sbcl (progn

(sb-c:deftransform %check-bound ((vector bound offset n-bytes) (sb-c:deftransform %check-bound ((vector bound offset n-bytes)
((simple-array (unsigned-byte 8) (*)) index ((simple-array (unsigned-byte 8) (*)) index
(and fixnum sb-vm:word) (and fixnum sb-vm:word)
Expand Down Expand Up @@ -95,3 +97,5 @@
else if (<= bitsize sb-vm:n-word-bits) else if (<= bitsize sb-vm:n-word-bits)
collect generic-little-transform into transforms collect generic-little-transform into transforms
finally (return `(progn ,@transforms)))) finally (return `(progn ,@transforms))))

);#+sbcl
5 changes: 5 additions & 0 deletions sbcl-opt/x86-64-vm.lisp
@@ -1,7 +1,10 @@
;;;; x86-64-vm.lisp -- VOP definitions SBCL ;;;; x86-64-vm.lisp -- VOP definitions SBCL


#+sbcl
(cl:in-package :sb-vm) (cl:in-package :sb-vm)


#+(and sbcl x86-64) (progn

(define-vop (%check-bound) (define-vop (%check-bound)
(:translate nibbles::%check-bound) (:translate nibbles::%check-bound)
(:policy :fast-safe) (:policy :fast-safe)
Expand Down Expand Up @@ -113,3 +116,5 @@
for big-endian-p = (logbitp 0 i) for big-endian-p = (logbitp 0 i)
collect (frob bitsize setterp signedp big-endian-p) into forms collect (frob bitsize setterp signedp big-endian-p) into forms
finally (return `(progn ,@forms)))) finally (return `(progn ,@forms))))

);#+(and sbcl x86-64)
5 changes: 5 additions & 0 deletions sbcl-opt/x86-vm.lisp
@@ -1,7 +1,10 @@
;;;; x86-vm.lisp -- VOP definitions for SBCL ;;;; x86-vm.lisp -- VOP definitions for SBCL


#+sbcl
(cl:in-package :sb-vm) (cl:in-package :sb-vm)


#+(and sbcl x86) (progn

(define-vop (%check-bound) (define-vop (%check-bound)
(:translate nibbles::%check-bound) (:translate nibbles::%check-bound)
(:policy :fast-safe) (:policy :fast-safe)
Expand Down Expand Up @@ -158,3 +161,5 @@
for big-endian-p = (logbitp 0 i) for big-endian-p = (logbitp 0 i)
collect (frob setterp signedp big-endian-p) into forms collect (frob setterp signedp big-endian-p) into forms
finally (return `(progn ,@forms)))) finally (return `(progn ,@forms))))

);#+(and sbcl x86)

0 comments on commit 85d94f3

Please sign in to comment.