r5562: *** empty log message ***
[uffi.git] / src / libraries.lisp
index 1344d9d31a39113c7f08b5d6532ca86b0d93c85a..5e72a920ef96c89bd0d0c42b7592843a52f81615 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: libraries.lisp,v 1.7 2003/06/06 21:59:18 kevin Exp $
+;;;; $Id: libraries.lisp,v 1.11 2003/08/26 17:39:47 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
@@ -72,7 +72,7 @@ library type if type is not specified."
 
 (defun load-foreign-library (filename &key module supporting-libraries
                                           force-load)
-  #+(or allegro lispworks mcl) (declare (ignore module supporting-libraries))
+  #+(or allegro mcl) (declare (ignore module supporting-libraries))
   #+(or cmu scl sbcl) (declare (ignore module))
   
   (when (and filename (probe-file filename))
@@ -85,12 +85,12 @@ library type if type is not specified."
       (progn
        #+cmu
        (let ((type (pathname-type (parse-namestring filename))))
-         (if (equal type "so")
+         (if (string-equal type "so")
              (sys::load-object-file filename)
-           (alien:load-foreign filename 
-                               :libraries
-                               (convert-supporting-libraries-to-string
-                                supporting-libraries))))
+             (alien:load-foreign filename 
+                                 :libraries
+                                 (convert-supporting-libraries-to-string
+                                  supporting-libraries))))
        #+scl
        (let ((type (pathname-type (parse-namestring filename))))
          (alien:load-foreign filename 
@@ -98,10 +98,14 @@ library type if type is not specified."
                              (convert-supporting-libraries-to-string
                               supporting-libraries)))
        #+sbcl
-       (sb-alien:load-foreign filename 
-                              :libraries
-                                (convert-supporting-libraries-to-string
-                                 supporting-libraries))
+       (let ((type (pathname-type (parse-namestring filename))))
+         (if (or (string-equal type "so")
+                 (string-equal type "dylib"))
+             (sb-alien::load-1-foreign filename)
+             (sb-alien:load-foreign filename 
+                                    :libraries
+                                    (convert-supporting-libraries-to-string
+                                     supporting-libraries))))
        #+lispworks (fli:register-module module :real-name filename)
        #+allegro (load filename)
        #+openmcl (ccl:open-shared-library filename)