chiark / gitweb /
Checking if CLISP is started with the -ansi option
[clg] / tools / config.lisp
index bfc660dbc5ccc6eec19a40c13d044c4b4fa77429..aa15f19cce1a4bc665a42e892af18e817bf4a95a 100644 (file)
@@ -3,7 +3,7 @@ (defpackage #:pkg-config
   #+sbcl
   (:import-from #:sb-int #:featurep)
   (:export #:pkg-cflags #:pkg-libs #:pkg-exists-p #:pkg-version #:pkg-variable)
-  (:export #:featurep #:sbcl>=))
+  (:export #:featurep #:sbcl>= #:clisp>=))
 
 (in-package #:pkg-config)
 
@@ -122,7 +122,9 @@   (defun sbcl-version ()
       (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) :junk-allowed t))))
+       (if dot2
+          (parse-integer (lisp-implementation-version) :start (1+ dot2) :junk-allowed t)
+        0))))
   (defun sbcl>= (req-major req-minor req-micro)
     (multiple-value-bind (major minor micro) (sbcl-version)      
       (or 
@@ -134,3 +136,21 @@   (defun sbcl>= (req-major req-minor req-micro)
 (defun sbcl>= (req-major req-minor req-micro)
   (declare (ignore req-major req-minor req-micro))
   nil)
+
+#+clisp
+(progn
+  (defun clisp-version ()
+    (let* ((dot (position #\. (lisp-implementation-version))))
+      (values 
+       (parse-integer (lisp-implementation-version) :end dot)
+       (parse-integer (lisp-implementation-version) :start (1+ dot) :junk-allowed t))))
+  (defun clisp>= (req-major req-minor)
+    (multiple-value-bind (major minor) (clisp-version)      
+      (or 
+       (> major req-major)
+       (and (= major req-major) (> minor req-minor))))))
+
+#-clisp
+(defun clisp>= (req-major req-minor)
+  (declare (ignore req-major req-minor))
+  nil)