Changes required by SBCL 0.9.10
[clg] / glib / glib.asd
index 668c59b..f6fd3e7 100644 (file)
   (push :glib2.8 *features*))
 
 #+sbcl
-(when (string>= (lisp-implementation-version) "0.9.8")
-  (push :sbcl>=0.9.8 *features*))
+(progn
+  (defun sbcl-version ()
+    (let ((dot1 (position #\. (lisp-implementation-version)))
+         (dot2 (position #\. (lisp-implementation-version) :from-end t)))
+      (values 
+       (parse-integer (lisp-implementation-version) :end dot1)
+       (parse-integer (lisp-implementation-version) :start (1+ dot1) :end dot2)
+       (parse-integer (lisp-implementation-version) :start (1+ dot2)))))
+  (defun sbcl-version>= (req-major req-minor req-micro)
+    (multiple-value-bind (major minor micro) (sbcl-version)      
+      (or 
+       (> major req-major)
+       (and (= major req-major) (> minor req-minor))
+       (and (= major req-major) (= minor req-minor) (>= micro req-micro)))))
+  (when (sbcl-version>= 0 9 8)
+    (push :sbcl>=0.9.8 *features*))
+  (when (sbcl-version>= 0 9 10)
+    (push :sbcl>=0.9.10 *features*)))
+
+#+(and sbcl (not alien-callbacks))
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (unless (find-symbol "DEFINE-ALIEN-FUNCTION" "SB-ALIEN")
+    (error "You need to upgrade SBCL to a version with native C callback support or see the README file about how to add third party callbacks to your current SBCL version.")))
+
+#+(and sbcl alien-callbacks)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+  (when (find-symbol "DEFINE-ALIEN-FUNCTION" "SB-ALIEN")
+    (error "Third party C callback code detected in a SBCL image with native callback support. As clg now uses native callbacks when available, you need to use a \"clean\" core file.")))
+
 
 (defsystem glib
     :depends-on (clg-tools)