r2261: *** empty log message ***
[clsql.git] / interfaces / clsql-uffi / clsql-uffi-loader.cl
index ea886ef61214f8dd5f4bb5c5662fc599a076a568..a197061a1bbafb7bd7f92b27b575c9397359bf15 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmers:   Kevin M. Rosenberg
 ;;;; Date Started:  Mar 2002
 ;;;;
-;;;; $Id: clsql-uffi-loader.cl,v 1.1 2002/03/27 08:09:25 kevin Exp $
+;;;; $Id: clsql-uffi-loader.cl,v 1.16 2002/07/26 02:47:12 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (in-package :clsql-uffi)
 
 (defvar *clsql-uffi-library-filename* 
-    (translate-logical-pathname 
-     #+(or linux unix) "CLSQL:interfaces;clsql-uffi;clsql-uffi.so"
-     #+(or mswindows win32) "CLSQL:interfaces;clsql-uffi;clsql-uffi.dll"
-     ))
+  (uffi:find-foreign-library
+   "clsql-uffi"
+   `(,(directory-namestring
+       (translate-logical-pathname 
+       "cl-library:clsql;interfaces;clsql-uffi;"))
+     "/usr/lib/clsql/")
+   :drive-letters '("C" "D" "E" "F" "G")))
 
 (defvar *clsql-uffi-supporting-libraries* '("c")
   "Used only by CMU. List of library flags needed to be passed to ld to
@@ -34,11 +37,12 @@ set to the right path before compiling or loading the system.")
   "T if foreign library was able to be loaded successfully")
 
 (defun load-uffi-foreign-library ()
-  (when (uffi:load-foreign-library *clsql-uffi-library-filename* 
-                                 :module "clsql-uffi" 
-                                 :supporting-libraries 
-                                 *clsql-uffi-supporting-libraries*)
-    (setq *uffi-library-loaded* t)))
+  (if (uffi:load-foreign-library *clsql-uffi-library-filename* 
+                                :module "clsql-uffi" 
+                                :supporting-libraries 
+                                *clsql-uffi-supporting-libraries*)
+      (setq *uffi-library-loaded* t)
+    (warn "Unable to load helper library ~A" *clsql-uffi-library-filename*)))
 
 (load-uffi-foreign-library)