r3587: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 9 Dec 2002 10:39:38 +0000 (10:39 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 9 Dec 2002 10:39:38 +0000 (10:39 +0000)
db-mysql/Makefile
db-mysql/clsql-mysql.c
db-mysql/mysql-loader.lisp
uffi/Makefile

index 197d12646f09bf3d9d67447ae8eb1d2edbd015fb..6e3f02999e4a62faff58c11f8951e2f250bcae5e 100644 (file)
@@ -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) *~
 
index 0d0ee4d738799865bc3580af11235411db5b79a5..abe70b1438da574b3b55ffc817b5d99a52ece186 100644 (file)
@@ -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))
 
index 4a7fe2a868f8ec64230d964ce888113a43d1bfc2..c256d7018714432d6bad086d3361f76b769c6feb 100644 (file)
@@ -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*))
      "/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*)))
index d24b555b42c0ccd3cab0d123183b68d67fc9e742..48507a61e3c46e4a5203f2138257f07ab5e71683 100644 (file)
@@ -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)