r5564: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 27 Aug 2003 20:00:21 +0000 (20:00 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Wed, 27 Aug 2003 20:00:21 +0000 (20:00 +0000)
debian/changelog
src/libraries.lisp
tests/Makefile
tests/foreign-loader.lisp

index 9102acc5b32e0dd5f18541351c5c0386531ae2b3..76a6801ac515c4768a4226a8ef3b7740e4cc6404 100644 (file)
@@ -1,3 +1,10 @@
+cl-uffi (1.3.5-1) unstable; urgency=low
+
+  * Rework loading of foreign libraries to better support MacOSX, especially
+  sbcl
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Wed, 27 Aug 2003 10:01:11 -0600
+
 cl-uffi (1.3.4-1) unstable; urgency=low
 
   * New upstream
index 5e72a920ef96c89bd0d0c42b7592843a52f81615..f91f3db0d5f535ad08bd6164e45bb75c9d771931 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: libraries.lisp,v 1.11 2003/08/26 17:39:47 kevin Exp $
+;;;; $Id: libraries.lisp,v 1.12 2003/08/27 20:00:21 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
   #-(or win32 mswindows macosx darwin ccl-5.0) "so"
 )
 
+(defun foreign-library-types ()
+  "Returns list of string naming possible library types for platform, sorted by preference"
+  #+(or win32 mswindows) '("dll" "lib")
+  #+(or macosx darwin ccl-5.0) '("dylib" "bundle")
+  #-(or win32 mswindows macosx darwin ccl-5.0) '("so" "a" "o")
+)
+
 (defun find-foreign-library (names directories &key types drive-letters)  
   "Looks for a foreign library. directories can be a single
 string or a list of strings of candidate directories. Use default
 library type if type is not specified."
   (unless types
-    (setq types (default-foreign-library-type)))
+    (setq types (foreign-library-types)))
   (unless (listp types)
     (setq types (list types)))
   (unless (listp names)
index 88fda03b0f16f56d8e42148fe0b2fda71951c31e..1ec75c73f9523e9b628fbf1c7b43302ac7c9c5ce 100644 (file)
@@ -5,7 +5,7 @@
 #  Programer:    Kevin M. Rosenberg
 #  Date Started: Mar 2002
 #
-#  CVS Id:   $Id: Makefile,v 1.20 2003/04/29 14:08:02 kevin Exp $
+#  CVS Id:   $Id: Makefile,v 1.21 2003/08/27 19:58:25 kevin Exp $
 #
 # This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 #
@@ -36,6 +36,10 @@ linux: $(source) Makefile
        rm $(object)
 
 mac:
+       gcc -bundle -c $(source) -o $(object).dylib
+       ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
+
+mac-old:
        cc -dynamic -c $(source) -o $(object)
        ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)
        ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
index a4e924a97828755f86b15b1e92e7de5c392ee45f..68fe923886a689929eb900d5c75c55d88a512a68 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: foreign-loader.lisp,v 1.6 2003/08/26 17:27:01 kevin Exp $
+;;;; $Id: foreign-loader.lisp,v 1.7 2003/08/27 19:58:25 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (in-package uffi-tests)
 
 (unless (uffi:load-foreign-library
-        #-(or macosx darwin)
         (uffi:find-foreign-library
+         #-(or macosx darwin)
          "libz"
-         '("/usr/local/lib/" "/usr/lib/" "/zlib/")
-         :types '("so" "a"))
-        #+(or macosx darwin)
-        (uffi:find-foreign-library
-         "z" (list (pathname-directory *load-pathname*)))
+         #+(or macosx darwin)
+         "z"
+         (list (pathname-directory *load-pathname*)
+               "/usr/local/lib/" "/usr/lib/" "/zlib/"))
         :module "zlib" 
         :supporting-libraries '("c"))
   (warn "Unable to load zlib"))
   
 (unless (uffi:load-foreign-library 
-        (uffi:find-foreign-library "uffi-c-test-lib" 
-                                   (list
-                                    (pathname-directory *load-truename*)
-                                    "/usr/lib/uffi/"))
+        (uffi:find-foreign-library
+         "uffi-c-test-lib" 
+         (list (pathname-directory *load-truename*)
+               "/usr/lib/uffi/"))
         :supporting-libraries '("c")
         :module "uffi_tests")
   (warn "Unable to load uffi-c-test-lib library"))