(in-package :gdk)
-(load-foreign-library "libgdk-x11-2.0.so")
\ No newline at end of file
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gdk
+ (:unix (:or "libgdk-x11-2.0.so.0" "libgdk-x11-2.0.so"))
+ (t "libgdk-2.0")))
+
+(use-foreign-library gdk)
\ No newline at end of file
(eval-when (:compile-toplevel :load-toplevel :execute)
(define-foreign-library glib
- (:unix "libglib-2.0.so")
- (t "glib-2.0")))
+ (:unix (:or "libglib-2.0.so.0" "libglib-2.0.so"))
+ (t "libglib-2.0")))
(use-foreign-library glib)
-(load-foreign-library "libgthread-2.0.so")
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gthread
+ (:unix (:or "libgthread-2.0.so.0" "libgthread-2.0.so"))
+ (t "libgthread-2.0")))
+
+(use-foreign-library gthread)
;;
;; Glib Fundamentals
;; TODO: not sure about these: for amd64 they are ok
(eval-when (:compile-toplevel :load-toplevel :execute)
- (if (cffi-features:cffi-feature-p :x86-64)
- (defctype gsize :uint64)
- (error "Unknown type 'gsize'")))
+ (cond
+ ((cffi-features:cffi-feature-p :x86-64) (defctype gsize :uint64))
+ ((cffi-features:cffi-feature-p :x86) (defctype gsize :ulong))
+ (t (error "Can not define 'gsize', unknown CPU architecture (known are x86 and x86-64)"))))
(defctype gssize :long)
(in-package :gobject)
-(load-foreign-library "libgobject-2.0.so")
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gobject
+ (:unix (:or "libgobject-2.0.so.0" "libgobject-2.0.so"))
+ (t "libgobject-2.0")))
+
+(use-foreign-library gobject)
(defvar *gobject-debug* nil)
(in-package :gtk)
-(load-foreign-library "libgtk-x11-2.0.so")
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library gtk
+ (:unix (:or "libgtk-x11-2.0.so.0" "libgtk-x11-2.0.so"))
+ (t "libgtk-2.0")))
+
+(use-foreign-library gtk)
#+sbcl (when (and (find-package "SB-EXT")
(find-symbol "SET-FLOATING-POINT-MODES" (find-package "SB-EXT")))