>From 60254ebd11b37ac3481d65bb720f43c81c77cd6f Mon Sep 17 00:00:00 2001
From: Karl Heinrichmeyer <karl.heinrichmeyer@gmail.com>
Date: Wed, 30 Nov 2011 21:50:30 +0100
Subject: [PATCH] I applied some changes to grovel.lisp that seem to fix the problem with the groveler. The problem was that (directory-namestring ...) doesn't include the device name that is used for the drive letter (this is at least true for ccl and ecl on windows 7 64bit). That is the drive letter is missing in the namestring and neither the cffi install directory nor the lib is found by the compiler and so on. This patch may be a little improvisational but thats due to the little time i spend with lisp programming yet.

---
 grovel/grovel.lisp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/grovel/grovel.lisp b/grovel/grovel.lisp
index 40bcdbe..39f6f87 100644
--- a/grovel/grovel.lisp
+++ b/grovel/grovel.lisp
@@ -36,6 +36,12 @@
   (loop for s in strings
         collect (string-trim '(#\Space #\Tab) s)))
 
+
+(defun directory-namestring-with-device (pathname)
+  (namestring
+   (make-pathname :device (pathname-device pathname)
+                  :directory (pathname-directory pathname))))
+
 ;;;# Error Conditions
 
 ;;; This warning is signalled when cffi-grovel can't find some macro.
@@ -265,9 +271,8 @@ int main(int argc, char**argv) {
            ,@*cc-flags*
            ;; add the cffi directory to the include path to make common.h visible
            ,(format nil "-I~A"
-                    (directory-namestring
-                     (truename
-                      (asdf:system-definition-pathname :cffi-grovel))))
+                    (directory-namestring-with-device
+                     (truename(asdf:system-definition-pathname :cffi-grovel))))
            ,@(when library *platform-library-flags*)
            "-o" ,(native-namestring output-file)
            ,(native-namestring input-file))))
@@ -715,7 +720,7 @@ int main(int argc, char**argv) {
                    (cffi:define-foreign-library
                        (,named-library-name
                         :type :grovel-wrapper
-                        :search-path ,(directory-namestring lib-file))
+                        :search-path ,(directory-namestring-with-device lib-file))
                      (t ,(namestring (lib-filename lib-soname))))
                    (cffi:use-foreign-library ,named-library-name))
                 out)
-- 
1.7.3.1.msysgit.0


