+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
;;;; 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)
# 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
#
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
;;;; 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"))