X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/a32597397889eb5d995ea476e16c2627c953cf58..79c7839653d89bae3d5d7ef490ef32dd5d248b30:/glib/glib.asd diff --git a/glib/glib.asd b/glib/glib.asd index bc1d30e..5c18f0b 100644 --- a/glib/glib.asd +++ b/glib/glib.asd @@ -3,10 +3,13 @@ (asdf:oos 'asdf:load-op :clg-tools) (defpackage "GLIB-SYSTEM" - (:use "COMMON-LISP" "ASDF" "PKG-CONFIG") - (:export "*GTK-LIBRARY-PATH*")) + (: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 @@ -17,41 +20,58 @@ (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*)) -;; TODO: remove this -(defvar *gtk-library-path* (pkg-variable "gtk+-2.0" "libdir")) +(when (string>= (pkg-version "glib-2.0") "2.8.0") + (push :glib2.8 *features*)) + +#+sbcl +(when (string>= (lisp-implementation-version) "0.9.8") + (push :sbcl>=0.9.8 *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"))))