From b2a3a6e6f3e5adf857ba4e2c80b8e4f8a3124a33 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Wed, 27 Aug 2003 20:00:21 +0000 Subject: [PATCH] r5564: *** empty log message *** --- debian/changelog | 7 +++++++ src/libraries.lisp | 11 +++++++++-- tests/Makefile | 6 +++++- tests/foreign-loader.lisp | 21 ++++++++++----------- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9102acc..76a6801 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 27 Aug 2003 10:01:11 -0600 + cl-uffi (1.3.4-1) unstable; urgency=low * New upstream diff --git a/src/libraries.lisp b/src/libraries.lisp index 5e72a92..f91f3db 100644 --- a/src/libraries.lisp +++ b/src/libraries.lisp @@ -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 ;;;; @@ -28,12 +28,19 @@ #-(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) diff --git a/tests/Makefile b/tests/Makefile index 88fda03..1ec75c7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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 diff --git a/tests/foreign-loader.lisp b/tests/foreign-loader.lisp index a4e924a..68fe923 100644 --- a/tests/foreign-loader.lisp +++ b/tests/foreign-loader.lisp @@ -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 ;;;; @@ -19,23 +19,22 @@ (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")) -- 2.34.1