r2914: rename .cl files
[clsql.git] / uffi / clsql-uffi-loader.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          clsql-uffi-loader.sql
6 ;;;; Purpose:       library loader using CLSQL UFFI helper library
7 ;;;; Programmers:   Kevin M. Rosenberg
8 ;;;; Date Started:  Mar 2002
9 ;;;;
10 ;;;; $Id: clsql-uffi-loader.lisp,v 1.1 2002/09/30 10:19:24 kevin Exp $
11 ;;;;
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; CLSQL users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
18
19 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
20 (in-package :clsql-uffi)
21
22 (defvar *clsql-uffi-library-filename* 
23   (uffi:find-foreign-library
24    "clsql-uffi"
25    `("/usr/lib/clsql/"
26      "/opt/lisp/clsql/uffi/"
27      "/home/kevin/debian/src/clsql/uffi/")
28    :drive-letters '("C" "D" "E" "F" "G")))
29
30 (defvar *clsql-uffi-supporting-libraries* '("c")
31   "Used only by CMU. List of library flags needed to be passed to ld to
32 load the MySQL client library succesfully.  If this differs at your site,
33 set to the right path before compiling or loading the system.")
34
35 (defvar *uffi-library-loaded* nil
36   "T if foreign library was able to be loaded successfully")
37
38 (defun load-uffi-foreign-library ()
39   (if (uffi:load-foreign-library *clsql-uffi-library-filename* 
40                                  :module "clsql-uffi" 
41                                  :supporting-libraries 
42                                  *clsql-uffi-supporting-libraries*)
43       (setq *uffi-library-loaded* t)
44     (warn "Unable to load helper library ~A" *clsql-uffi-library-filename*)))
45
46 (load-uffi-foreign-library)
47
48
49