X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=uffi%2Fclsql-uffi-loader.lisp;h=1655ed27cc29ebd5f6baf8d3f4e46f8ce7fd7311;hb=26cfa48009c72652e0ba8ce9aed8c53216e9a3d3;hp=28fd7ed1833c7de37cc22c0df87606a549b7e90c;hpb=473fb1cce3125859074ac32c2c1ba4eb25cdfb74;p=clsql.git diff --git a/uffi/clsql-uffi-loader.lisp b/uffi/clsql-uffi-loader.lisp index 28fd7ed..1655ed2 100644 --- a/uffi/clsql-uffi-loader.lisp +++ b/uffi/clsql-uffi-loader.lisp @@ -19,7 +19,13 @@ (in-package #:clsql-uffi) (defun find-and-load-foreign-library (filenames &key module supporting-libraries (errorp t)) - (setq filenames (if (listp filenames) filenames (list filenames))) + (setq filenames (if (listp filenames) filenames (list filenames)) + filenames + (append + (loop for search-path in clsql:*foreign-library-search-paths* + nconc (loop for filename in filenames + collect (merge-pathnames filename search-path))) + filenames)) (or (loop for type in (uffi:foreign-library-types) for suffix = (make-pathname :type type) thereis (loop for filename in filenames @@ -31,16 +37,17 @@ (warn "~A" c) nil)))) (when errorp - (error "Couldn't load foreign librar~@P ~{~S~^, ~}." - (length filenames) filenames)))) + (error "Couldn't load foreign librar~@P ~{~S~^, ~}. (searched ~S)" + (length filenames) filenames + 'clsql:*foreign-library-search-paths*)))) (defvar *clsql-uffi-library-filenames* - (list #+(or 64bit x86-64) (make-pathname :name "clsql_uffi64" + (list #+(or 64bit x86-64) "clsql_uffi64" + #+(or 64bit x86-64) (make-pathname :name "clsql_uffi64" :directory clsql-uffi-system::*library-file-dir*) - #+(or 64bit x86-64) "clsql_uffi64" + "clsql_uffi" (make-pathname :name "clsql_uffi" - :directory clsql-uffi-system::*library-file-dir*) - "clsql_uffi")) + :directory clsql-uffi-system::*library-file-dir*))) (defvar *clsql-uffi-supporting-libraries* '("c") "Used only by CMU. List of library flags needed to be passed to ld to @@ -52,8 +59,8 @@ set to the right path before compiling or loading the system.") (defun load-uffi-foreign-library () (find-and-load-foreign-library *clsql-uffi-library-filenames* - :module "clsql-uffi" - :supporting-libraries + :module "clsql-uffi" + :supporting-libraries *clsql-uffi-supporting-libraries*) (setq *uffi-library-loaded* t))