Windows Drive Patch
authorKevin Rosenberg <kevin@rosenberg.net>
Wed, 2 Sep 2009 12:51:38 +0000 (2 06:51 -0600)
committerKevin Rosenberg <kevin@rosenberg.net>
Wed, 2 Sep 2009 12:51:38 +0000 (2 06:51 -0600)
Commit patch from Andreas Franke to honor windows drive letter
when loading clsql_mysql C library.

ChangeLog
clsql-mysql.asd
db-mysql/mysql-loader.lisp

index e1f8b63..1e9678c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 31 Aug 2009  Kevin Rosenberg <kevin@rosenberg.net>
        * sql/db-interface.lisp: Fix spelling error (thanks to 
        David Thompson)
+       * clsql-mysql.asd/db-mysql/mysql-loader.lisp: Commit
+       patch from Andreas Franke to honor windows drive letter
+       when loading clsql_mysql C library.
        
 31 Aug 2009  Kevin Rosenberg <kevin@rosenberg.net>
        * Version 4.1.0
index 2247697..e8d89a8 100644 (file)
   (unless (find-package 'uffi)
     (asdf:operate 'asdf:load-op 'uffi)))
 
-(defvar *library-file-dir* (append (pathname-directory *load-truename*)
-                                  (list "db-mysql")))
+(defvar *library-file-dir* 
+  (merge-pathnames "db-mysql/" 
+                   (make-pathname :name nil :type nil 
+                                  :defaults *load-truename*)))
 
 (defclass clsql-mysql-source-file (c-source-file)
   ())
@@ -42,7 +44,7 @@
              found
              (make-pathname :name (component-name c)
                             :type library-file-type
-                            :directory *library-file-dir*)))))
+                            :defaults *library-file-dir*)))))
 
 (defmethod perform ((o load-op) (c clsql-mysql-source-file))
   t)
@@ -58,9 +60,7 @@
     (unless (zerop (run-shell-command
                    #-freebsd "cd ~A; make"
                    #+freebsd "cd ~A; gmake"
-                   (namestring (make-pathname :name nil
-                                              :type nil
-                                              :directory *library-file-dir*))))
+                   (namestring *library-file-dir*)))
       (error 'operation-error :component c :operation o))))
 
 (defmethod operation-done-p ((o compile-op) (c clsql-mysql-source-file))
index 43189cf..3395e71 100644 (file)
@@ -38,8 +38,7 @@ set to the right path before compiling or loading the system.")
   *mysql-library-loaded*)
 
 (defmethod clsql-sys:database-type-load-foreign ((database-type (eql :mysql)))
-  (clsql:push-library-path
-   (make-pathname :directory clsql-mysql-system::*library-file-dir*))
+  (clsql:push-library-path clsql-mysql-system::*library-file-dir*)
 
   (clsql-uffi:find-and-load-foreign-library *mysql-library-candidate-names*
                                             :module "mysql"