From: Kevin M. Rosenberg Date: Mon, 9 Dec 2002 10:39:38 +0000 (+0000) Subject: r3587: *** empty log message *** X-Git-Tag: v3.8.6~887 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=8b2ffc1ca1f3118db6fe4b879a82955338fccae4 r3587: *** empty log message *** --- diff --git a/db-mysql/Makefile b/db-mysql/Makefile index 197d126..6e3f029 100644 --- a/db-mysql/Makefile +++ b/db-mysql/Makefile @@ -3,11 +3,11 @@ # FILE IDENTIFICATION # # Name: Makefile -# Purpose: Makefile for the CLSQL UFFI helper package +# Purpose: Makefile for the CLSQL MySQL database interface # Programer: Kevin M. Rosenberg # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.1 2002/09/18 07:43:40 kevin Exp $ +# CVS Id: $Id: Makefile,v 1.2 2002/12/09 10:34:16 kevin Exp $ # # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg # @@ -49,9 +49,14 @@ compile: $(shared_lib) $(object): $(source) mysql.h $(CC) ${SHARED_CC_OPT} $(INCLUDE_DIRS) -c $< -o $@ -$(shared_lib): $(object) -lmysqlclient +$(shared_lib): $(object) $(LD) ${SHARED_LD_OPT} $^ -o $@ +mac: $(object) + ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress $(object) -o $(base).dylib + ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /sw/lib/libmysqlclient.dylib -o libmysqlclient.dylib + ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o libz.dylib + clean: @rm -f $(object) $(shared_lib) *~ diff --git a/db-mysql/clsql-mysql.c b/db-mysql/clsql-mysql.c index 0d0ee4d..abe70b1 100644 --- a/db-mysql/clsql-mysql.c +++ b/db-mysql/clsql-mysql.c @@ -6,7 +6,7 @@ * Programmer: Kevin M. Rosenberg * Date Started: Mar 2002 * - * $Id: clsql-mysql.c,v 1.1 2002/09/18 07:43:40 kevin Exp $ + * $Id: clsql-mysql.c,v 1.2 2002/12/09 10:34:16 kevin Exp $ * * This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg * @@ -52,7 +52,7 @@ clsql_mysql_data_seek (MYSQL_RES* res, unsigned int offset_high32, They return the 32-bit low part and store in upper 32-bits in a located sent via a pointer */ -const unsigned int bitmask_32bits = 0xFFFFFFFF; +static const unsigned int bitmask_32bits = 0xFFFFFFFF; #define lower_32bits(int64) ((unsigned int) int64 & bitmask_32bits) #define upper_32bits(int64) ((unsigned int) (int64 >> 32)) diff --git a/db-mysql/mysql-loader.lisp b/db-mysql/mysql-loader.lisp index 4a7fe2a..c256d70 100644 --- a/db-mysql/mysql-loader.lisp +++ b/db-mysql/mysql-loader.lisp @@ -7,7 +7,7 @@ ;;;; Programmers: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: mysql-loader.lisp,v 1.5 2002/11/23 18:00:26 kevin Exp $ +;;;; $Id: mysql-loader.lisp,v 1.6 2002/12/09 10:34:16 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -25,7 +25,7 @@ ;;;; -- prevent library from being loaded multiple times ;;;; -- support Allegro CL and Lispworks -(defvar *clsql-mysql-library-filename* +(defparameter *clsql-mysql-library-path* (uffi:find-foreign-library "clsql-mysql" `(,(make-pathname :directory (pathname-directory *load-truename*)) @@ -33,12 +33,23 @@ "/sw/lib/clsql/" "/home/kevin/debian/src/clsql/db-mysql/") :drive-letters '("C" "D" "E"))) + +(defparameter *libz-library-path* + (uffi:find-foreign-library + "libz" + `(,(make-pathname :directory (pathname-directory *load-truename*)) + "/usr/lib/" + "/sw/lib/" + "/usr/local/lib/" + "/home/kevin/debian/src/clsql/db-mysql/") + :drive-letters '("C" "D" "E"))) (defvar *mysql-library-candidate-names* '("libmysqlclient" "libmysql")) -(defvar *mysql-library-candidate-directories* - '("/opt/mysql/lib/mysql/" "/usr/local/lib/" "/usr/lib/" "/usr/local/lib/mysql/" "/usr/lib/mysql/" "/mysql/lib/opt/" "/sw/lib/mysql/")) +(defparameter *mysql-library-candidate-directories* + `(,(pathname-directory *load-pathname*) + "/opt/mysql/lib/mysql/" "/usr/local/lib/" "/usr/lib/" "/usr/local/lib/mysql/" "/usr/lib/mysql/" "/mysql/lib/opt/" "/sw/lib/mysql/")) (defvar *mysql-library-candidate-drive-letters* '("C" "D" "E")) @@ -58,22 +69,16 @@ set to the right path before compiling or loading the system.") (uffi:find-foreign-library *mysql-library-candidate-names* *mysql-library-candidate-directories* :drive-letters - *mysql-library-candidate-drive-letters*)) - (zlib-path - (uffi:find-foreign-library '("libz" "zlib") - '("/usr/lib/" "/usr/local/lib/" "/lib/")))) + *mysql-library-candidate-drive-letters*))) (unless (probe-file mysql-path) (error "Can't find mysql client library to load")) - (unless (probe-file zlib-path) - (error "Can't find zlib client library to load")) - - (uffi:load-foreign-library zlib-path) (if (and + (uffi:load-foreign-library *libz-library-path*) (uffi:load-foreign-library mysql-path :module "mysql" :supporting-libraries *mysql-supporting-libraries*) - (uffi:load-foreign-library *clsql-mysql-library-filename* + (uffi:load-foreign-library *clsql-mysql-library-path* :module "clsql-mysql" :supporting-libraries (append *mysql-supporting-libraries*))) diff --git a/uffi/Makefile b/uffi/Makefile index d24b555..48507a6 100644 --- a/uffi/Makefile +++ b/uffi/Makefile @@ -7,7 +7,7 @@ # Programer: Kevin M. Rosenberg # Date Started: Mar 2002 # -# CVS Id: $Id: Makefile,v 1.2 2002/11/23 18:00:26 kevin Exp $ +# CVS Id: $Id: Makefile,v 1.3 2002/12/09 10:34:16 kevin Exp $ # # This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg # @@ -50,6 +50,6 @@ clean: distclean: clean -macosx: $(source) Makefile +mac: $(source) Makefile cc -dynamic -c $(source) -o $(object) ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $(base).dylib $(object)