diff -ur clsql-3.6.3.orig/db-mysql/mysql-loader.lisp clsql-3.6.3/db-mysql/mysql-loader.lisp --- clsql-3.6.3.orig/db-mysql/mysql-loader.lisp 2005-07-05 19:51:52.000000000 -0500 +++ clsql-3.6.3/db-mysql/mysql-loader.lisp 2006-07-10 00:42:56.000000000 -0500 @@ -18,17 +18,6 @@ (in-package #:mysql) -(defparameter *clsql-mysql-library-candidate-names* - (list #+(or 64bit x86-64) "clsql_mysql64" - #+(or 64bit x86-64) (make-pathname :name "clsql_mysql64" - :directory (pathname-directory *load-truename*)) - "clsql_mysql" - (make-pathname :name "clsql_mysql" - :directory (pathname-directory *load-truename*)))) - -(defvar *mysql-library-candidate-names* - '("libmysqlclient" "libmysql")) - (defvar *mysql-supporting-libraries* '("c") "Used only by CMU. List of library flags needed to be passed to ld to load the MySQL client library succesfully. If this differs at your site, @@ -41,12 +30,16 @@ *mysql-library-loaded*) (defmethod clsql-sys:database-type-load-foreign ((database-type (eql :mysql))) - (clsql-uffi:find-and-load-foreign-library *mysql-library-candidate-names* - :module "mysql" - :supporting-libraries *mysql-supporting-libraries*) - (clsql-uffi:find-and-load-foreign-library *clsql-mysql-library-candidate-names* - :module "clsql-mysql" - :supporting-libraries *mysql-supporting-libraries*) + (uffi:load-foreign-library (make-pathname :directory '(:absolute "usr" "@LIBDIR@") + :name "libmysqlclient" + :type "so") + :module "mysql" + :supporting-libraries *mysql-supporting-libraries*) + (uffi:load-foreign-library (make-pathname :directory '(:absolute "usr" "@LIBDIR@" "clsql") + :name "clsql_mysql" + :type "so") + :module "clsql-mysql" + :supporting-libraries *mysql-supporting-libraries*) (setq *mysql-library-loaded* t)) diff -ur clsql-3.6.3.orig/db-postgresql/postgresql-loader.lisp clsql-3.6.3/db-postgresql/postgresql-loader.lisp --- clsql-3.6.3.orig/db-postgresql/postgresql-loader.lisp 2005-06-08 14:25:33.000000000 -0500 +++ clsql-3.6.3/db-postgresql/postgresql-loader.lisp 2006-07-10 00:47:40.000000000 -0500 @@ -33,9 +33,11 @@ (defmethod clsql-sys:database-type-load-foreign ((database-type (eql :postgresql))) - (clsql-uffi:find-and-load-foreign-library "libpq" - :module "postgresql" - :supporting-libraries *postgresql-supporting-libraries*) + (uffi:load-foreign-library (make-pathname :directory '(:absolute "usr" "@LIBDIR@") + :name "libpq" + :type "so") + :module "postgresql" + :supporting-libraries *postgresql-supporting-libraries*) (setq *postgresql-library-loaded* t)) (clsql-sys:database-type-load-foreign :postgresql) diff -ur clsql-3.6.3.orig/uffi/clsql-uffi-loader.lisp clsql-3.6.3/uffi/clsql-uffi-loader.lisp --- clsql-3.6.3.orig/uffi/clsql-uffi-loader.lisp 2006-05-03 09:39:11.000000000 -0500 +++ clsql-3.6.3/uffi/clsql-uffi-loader.lisp 2006-07-10 00:44:58.000000000 -0500 @@ -18,35 +18,6 @@ (in-package #:clsql-uffi) -(defun find-and-load-foreign-library (filenames &key module supporting-libraries (errorp t)) - "Attempt to load a foreign library. This will search for any of the filenames, as -well as any of the filenames in any of the clsql:*foreign-library-search-paths*" - (setq filenames (if (listp filenames) filenames (list filenames))) - - (flet ((try-load (testpath) - (handler-case - (uffi:load-foreign-library testpath - :module module - :supporting-libraries supporting-libraries) - (error (c) (warn "~A" c) nil)))) - (or - (loop for type in (uffi:foreign-library-types) - thereis - (loop for name in filenames - for pn = (make-pathname :name name :type type) - thereis (or - (loop for search-path in clsql:*foreign-library-search-paths* - thereis (try-load (merge-pathnames pn search-path))) - (try-load pn)))) - (when errorp - (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) "clsql_uffi64" - "clsql_uffi")) - (defvar *clsql-uffi-supporting-libraries* '("c") "Used only by CMU. List of library flags needed to be passed to ld to load the MySQL client library succesfully. If this differs at your site, @@ -57,10 +28,12 @@ (defun load-uffi-foreign-library () (clsql:push-library-path clsql-uffi-system::*clsql-uffi-library-dir*) - (find-and-load-foreign-library *clsql-uffi-library-filenames* - :module "clsql-uffi" - :supporting-libraries - *clsql-uffi-supporting-libraries*) + (uffi:load-foreign-library (make-pathname :directory '(:absolute "usr" "@LIBDIR@" "clsql") + :name "clsql_uffi" + :type "so") + :module "clsql-uffi" + :supporting-libraries + *clsql-uffi-supporting-libraries*) (setq *uffi-library-loaded* t)) (load-uffi-foreign-library)