r5209: Auto commit for Debian build
[uffi.git] / tests / foreign-loader.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          foreign-loader.lisp
6 ;;;; Purpose:       Loads foreign libraries
7 ;;;; Author:        Kevin M. Rosenberg
8 ;;;; Date Started:  Feb 2002
9 ;;;;
10 ;;;; $Id: foreign-loader.lisp,v 1.3 2003/06/26 18:02:08 kevin Exp $
11 ;;;;
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; UFFI 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 ;;; For CMUCL, it's necessary to load foreign files separate from their
20 ;;; usage
21
22 (in-package :uffi-tests)
23
24 (eval-when (:compile-toplevel :load-toplevel :execute)
25 (unless (uffi:load-foreign-library
26          #-(or macosx darwin)
27          (uffi:find-foreign-library
28           "libz"
29           '("/usr/local/lib/" "/usr/lib/" "/zlib/")
30           :types '("so" "a"))
31          #+(or macosx darwin)
32          (uffi:find-foreign-library "z"
33                                     `(,(pathname-directory *load-pathname*)))
34          :module "zlib" 
35          :supporting-libraries '("c"))
36   (warn "Unable to load zlib")))
37   
38 (unless (uffi:load-foreign-library 
39          (uffi:find-foreign-library "uffi-c-test-lib" 
40                                     (list
41                                      (pathname-directory *load-truename*)
42                                      "/usr/lib/uffi/"))
43          :supporting-libraries '("c"))
44   (warn "Unable to load uffi-c-test-lib library"))
45