X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fmysql%2Fmysql-loader.cl;h=35dfb101c15a029a796ab33ed3a25ffb01316984;hb=e13d17f714f9cff42ae60fb84366f3dd565c0201;hp=d12faddb751623f8e32e0d69d325ee00d201fbb6;hpb=2359c743fa126e65514454a7996e025f139a8241;p=clsql.git diff --git a/interfaces/mysql/mysql-loader.cl b/interfaces/mysql/mysql-loader.cl index d12fadd..35dfb10 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.10 2002/05/14 16:15:24 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -26,10 +26,11 @@ ;;;; -- 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" + `(,(translate-logical-pathname + "CL-LIBRARY:clsql;interfaces;clsql-uffi;") + "/usr/share/common-lisp/source/clsql/interfaces/clsql-uffi/"))) (defvar *mysql-library-filename* (cond @@ -71,8 +72,11 @@ set to the right path before compiling or loading the system.") *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 +85,13 @@ 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) - - +(when (clsql-sys:database-type-library-loaded :mysql) + (clsql-sys:initialize-database-type :database-type :mysql) + (setq clsql:*default-database-type* :mysql) + (pushnew :mysql cl:*features*))