X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fmysql%2Fmysql-loader.cl;h=7a2345ab2092f550c611ecab950f63a9c8add38b;hb=3687a687d03faa3849306b1b230546bb4d6e0ccb;hp=d12faddb751623f8e32e0d69d325ee00d201fbb6;hpb=2359c743fa126e65514454a7996e025f139a8241;p=clsql.git diff --git a/interfaces/mysql/mysql-loader.cl b/interfaces/mysql/mysql-loader.cl index d12fadd..7a2345a 100644 --- a/interfaces/mysql/mysql-loader.cl +++ b/interfaces/mysql/mysql-loader.cl @@ -7,7 +7,7 @@ ;;;; Programmers: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: mysql-loader.cl,v 1.4 2002/04/01 05:27:55 kevin Exp $ +;;;; $Id: mysql-loader.cl,v 1.21 2002/07/26 02:47:12 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -26,11 +26,14 @@ ;;;; -- support Allegro CL and Lispworks (defvar *clsql-mysql-library-filename* - (translate-logical-pathname - #+(or linux unix) "CLSQL:interfaces;mysql;clsql-mysql.so" - #+(or mswindows win32) "CLSQL:interfaces;mysql;clsql-mysql.dll" - )) - + (uffi:find-foreign-library + "clsql-mysql" + `(,(directory-namestring + (translate-logical-pathname + "cl-library:clsql;interfaces;mysql;")) + "/usr/lib/clsql/") + :drive-letters '("C" "D" "E" "F" "G"))) + (defvar *mysql-library-filename* (cond ((probe-file "/opt/mysql/lib/mysql/libmysqlclient.so") @@ -62,17 +65,20 @@ set to the right path before compiling or loading the system.") (defvar *mysql-library-loaded* nil "T if foreign library was able to be loaded successfully") -(defmethod clsql-sys:database-type-library-loaded ((database-type (eql :mysql))) +(defmethod clsql-base-sys:database-type-library-loaded ((database-type (eql :mysql))) *mysql-library-loaded*) -(defmethod clsql-sys:database-type-load-foreign ((database-type (eql :mysql))) +(defmethod clsql-base-sys:database-type-load-foreign ((database-type (eql :mysql))) (let ((mysql-path (uffi:find-foreign-library *mysql-library-candidate-names* *mysql-library-candidate-directories* :drive-letters *mysql-library-candidate-drive-letters*))) - (when - (and + ;; zlib required to load mysql on CMUCL Solaris + (uffi:load-foreign-library + (uffi:find-foreign-library '("libz" "zlib") + '("/usr/lib/" "/usr/local/" "/lib/"))) + (if (and (uffi:load-foreign-library mysql-path :module "mysql" :supporting-libraries @@ -81,9 +87,10 @@ set to the right path before compiling or loading the system.") :module "clsql-mysql" :supporting-libraries (append *mysql-supporting-libraries*))) - (setq *mysql-library-loaded* t)))) - + (setq *mysql-library-loaded* t) + (warn "Unable to load MySQL client library ~A or CLSQL-MySQL library ~A" + mysql-path *clsql-mysql-library-filename*)))) -(clsql-sys:database-type-load-foreign :mysql) +(clsql-base-sys:database-type-load-foreign :mysql)