chiark / gitweb /
Patch from Peter De Wachter to improve the SBCL version detection
[clg] / glib / glib.asd
CommitLineData
f11b84f6 1;;; -*- Mode: lisp -*-
2
3(asdf:oos 'asdf:load-op :clg-tools)
4
5(defpackage "GLIB-SYSTEM"
9adccb27 6 (:use "COMMON-LISP" "ASDF" "PKG-CONFIG"))
f11b84f6 7
73572c12 8#+cmu(ext:unlock-all-packages)
9#+sbcl
10(progn
11 (sb-ext:unlock-package "COMMON-LISP")
12 (sb-ext:unlock-package "SB-PCL"))
f11b84f6 13
14;;; Better put this in ~/.cmucl-init.lisp or some other file read at startup
15;; (setf
16;; (logical-pathname-translations "clg")
17;; '(("**;*.*.*" "/home/espen/src/clg/**/")))
18
f11b84f6 19(in-package "GLIB-SYSTEM")
20
21(pkg-exists-p "glib-2.0" :atleast-version "2.4.0")
22
56a1f31a 23(when (string>= (pkg-version "glib-2.0") "2.6.0")
24 (push :glib2.6 *features*))
f11b84f6 25
89b927ec 26(when (string>= (pkg-version "glib-2.0") "2.8.0")
27 (push :glib2.8 *features*))
28
65466e9c 29#+sbcl
46e84256 30(progn
31 (defun sbcl-version ()
32 (let ((dot1 (position #\. (lisp-implementation-version)))
33 (dot2 (position #\. (lisp-implementation-version) :from-end t)))
34 (values
35 (parse-integer (lisp-implementation-version) :end dot1)
36 (parse-integer (lisp-implementation-version) :start (1+ dot1) :end dot2)
37 (parse-integer (lisp-implementation-version) :start (1+ dot2)))))
38 (defun sbcl-version>= (req-major req-minor req-micro)
39 (multiple-value-bind (major minor micro) (sbcl-version)
40 (or
41 (> major req-major)
42 (and (= major req-major) (> minor req-minor))
43 (and (= major req-major) (= minor req-minor) (>= micro req-micro)))))
44 (when (sbcl-version>= 0 9 8)
45 (push :sbcl>=0.9.8 *features*))
46 (when (sbcl-version>= 0 9 10)
47 (push :sbcl>=0.9.10 *features*)))
65466e9c 48
f204f1f5 49#+(and sbcl (not alien-callbacks))
50(eval-when (:compile-toplevel :load-toplevel :execute)
51 (unless (find-symbol "DEFINE-ALIEN-FUNCTION" "SB-ALIEN")
52 (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.")))
53
54#+(and sbcl alien-callbacks)
55(eval-when (:compile-toplevel :load-toplevel :execute)
56 (when (find-symbol "DEFINE-ALIEN-FUNCTION" "SB-ALIEN")
57 (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.")))
58
59
f11b84f6 60(defsystem glib
61 :depends-on (clg-tools)
62 :components ((:file "defpackage")
2518e203 63 #+(and cmu (not non-broken-pcl) (not cmu19b))(:file "pcl")
56a1f31a 64 ;; For preloading to work in glib 2.6, the library needs to
65 ;; be configured and build with '--disable-visibility'
66 (:unix-dso "preload"
67 :components ((:c-source-file "logging"
68 :cflags #.(pkg-cflags "glib-2.0"))))
a3259739 69 (:library "libglib-2.0"
56a1f31a 70 :libdir #.(pkg-variable "glib-2.0" "libdir")
71 :depends-on ("preload"))
a3259739 72 (:library "libgobject-2.0"
73 :libdir #.(pkg-variable "glib-2.0" "libdir")
74 :depends-on ("libglib-2.0"))
73572c12 75 (:unix-dso "alien"
76 :components ((:c-source-file "callback"
77 :cflags #.(pkg-cflags "glib-2.0"))
78 (:c-source-file "gobject"
79 :cflags #.(pkg-cflags "glib-2.0")))
80 :depends-on ("libgobject-2.0"))
f11b84f6 81 (:file "utils" :depends-on ("defpackage"))
a3259739 82 (:file "ffi" :depends-on ("utils"))
83 (:file "glib" :depends-on ("ffi" "libglib-2.0"))
2518e203 84 (:file "proxy" :depends-on (#+(and cmu (not non-broken-pcl) (not cmu19b))"pcl" "glib"))
73572c12 85 (:file "gtype" :depends-on ("proxy" "alien" "libgobject-2.0"))
f11b84f6 86 (:file "gboxed" :depends-on ("gtype"))
87 (:file "genums" :depends-on ("gtype"))
88 (:file "gparam" :depends-on ("genums"))
f11b84f6 89 (:file "gobject" :depends-on ("gparam"))
a3259739 90 (:file "ginterface" :depends-on ("gobject"))
f11b84f6 91 (:file "gcallback" :depends-on ("gtype" "gparam" "gobject" "alien"))
56a1f31a 92 (:file "gerror" :depends-on ("gcallback"))
93 (:file "export" :depends-on ("utils" "glib" "proxy" "gboxed" "gtype" "gparam" "gcallback" "genums" "gobject" "gerror"))))