X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/9adccb27da69b60d058aa37867d55ea20ecf97ca..46e84256e0168f49ac84c3460bf9486e6bdfe001:/glib/glib.asd diff --git a/glib/glib.asd b/glib/glib.asd index c779bec..f6fd3e7 100644 --- a/glib/glib.asd +++ b/glib/glib.asd @@ -5,7 +5,11 @@ (defpackage "GLIB-SYSTEM" (:use "COMMON-LISP" "ASDF" "PKG-CONFIG")) -(ext:unlock-all-packages) +#+cmu(ext:unlock-all-packages) +#+sbcl +(progn + (sb-ext:unlock-package "COMMON-LISP") + (sb-ext:unlock-package "SB-PCL")) ;;; Better put this in ~/.cmucl-init.lisp or some other file read at startup ;; (setf @@ -16,38 +20,74 @@ (pkg-exists-p "glib-2.0" :atleast-version "2.4.0") -(defvar *cmucl-include-path* "/usr/lib/cmucl/include") +(when (string>= (pkg-version "glib-2.0") "2.6.0") + (push :glib2.6 *features*)) + +(when (string>= (pkg-version "glib-2.0") "2.8.0") + (push :glib2.8 *features*)) + +#+sbcl +(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) :components ((:file "defpackage") - (:file "pcl") - ;; It is necessary to load this before libglib-2.0.so, - ;; otherwise our implementation of g_logv won't be - ;; used by the library - (:unix-dso "alien" - :components ((:c-source-file "callback" - :definitions ("CMUCL") - :include-paths (#.*cmucl-include-path*) - :cflags #.(pkg-cflags "glib-2.0")) - (:c-source-file "gobject" - :cflags #.(pkg-cflags "glib-2.0")))) + #+(and cmu (not non-broken-pcl) (not cmu19b))(:file "pcl") + ;; For preloading to work in glib 2.6, the library needs to + ;; be configured and build with '--disable-visibility' + (:unix-dso "preload" + :components ((:c-source-file "logging" + :cflags #.(pkg-cflags "glib-2.0")))) (:library "libglib-2.0" :libdir #.(pkg-variable "glib-2.0" "libdir") - :depends-on ("alien")) + :depends-on ("preload")) (:library "libgobject-2.0" :libdir #.(pkg-variable "glib-2.0" "libdir") :depends-on ("libglib-2.0")) + (:unix-dso "alien" + :components ((:c-source-file "callback" + :cflags #.(pkg-cflags "glib-2.0")) + (:c-source-file "gobject" + :cflags #.(pkg-cflags "glib-2.0"))) + :depends-on ("libgobject-2.0")) (:file "utils" :depends-on ("defpackage")) (:file "ffi" :depends-on ("utils")) (:file "glib" :depends-on ("ffi" "libglib-2.0")) - (:file "proxy" :depends-on ("pcl" "glib")) - (:file "gtype" :depends-on ("proxy" "libgobject-2.0")) + (:file "proxy" :depends-on (#+(and cmu (not non-broken-pcl) (not cmu19b))"pcl" "glib")) + (:file "gtype" :depends-on ("proxy" "alien" "libgobject-2.0")) (:file "gboxed" :depends-on ("gtype")) (:file "genums" :depends-on ("gtype")) (:file "gparam" :depends-on ("genums")) (:file "gobject" :depends-on ("gparam")) (:file "ginterface" :depends-on ("gobject")) (:file "gcallback" :depends-on ("gtype" "gparam" "gobject" "alien")) - (:file "export" :depends-on ("utils" "glib" "proxy" "gboxed" "gtype" "gparam" "gcallback" "genums" "gobject")))) + (:file "gerror" :depends-on ("gcallback")) + (:file "export" :depends-on ("utils" "glib" "proxy" "gboxed" "gtype" "gparam" "gcallback" "genums" "gobject" "gerror"))))