File: config.lisp

package info (click to toggle)
fricas 1.3.6-5
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 117,640 kB
  • sloc: lisp: 606,654; ansic: 36,919; sh: 3,994; makefile: 2,342; javascript: 1,381; awk: 965
file content (41 lines) | stat: -rw-r--r-- 1,346 bytes parent folder | download
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
(defun get-version-number ()
    (let* ((ver (lisp-implementation-version))
           (pos (position-if #'digit-char-p ver)))
          ;;; First strip leading and trailing garbage
          (if pos (setf ver (subseq ver pos))
                  (return-from get-version-number 'bad-version-string))
          (setf pos (position #\Space ver))
          (if pos (setf ver (subseq ver 0 pos)))
          ver))

(with-open-file (out "config_cl.out"
                     :direction :output
                     :if-does-not-exist :create
                     :if-exists :supersede)
    (format out "fricas_fasl_type=~a~&"
        (pathname-type (compile-file-pathname "foo.lisp")))

    (format out "fricas_lisp_flavor=~a~&"
        #+:gcl "gcl"
        #+:ecl "ecl"
        #+:openmcl "openmcl"
        #+:sbcl "sbcl"
        #+:clisp "clisp"
        #+:poplog "poplog"
        #+:cmu    "cmucl"
        #+:lispworks "lispworks"
        #-(or :gcl :ecl :openmcl :sbcl :clisp :poplog :cmu :lispworks) "unknown"
    )
    #+:clisp
    (if (not (find-package "FFI"))
        (format out "fricas_clisp_no_ffi"))
    (let ((ver (get-version-number)))
         (if (eq ver 'bad-version-string)
             (format t "Unable to determine version")
             (format out "fricas_lisp_version=~a~&" ver)))
)

#+:poplog
(pop11::sysexit)
#-:poplog
(quit)