r5496: def-foreign-var support
[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.5 2003/08/14 21:40:13 kevin Exp $
11 ;;;;
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; *************************************************************************
15
16 ;;; For CMUCL, it's necessary to load foreign files separate from their
17 ;;; usage
18
19 (in-package #:uffi-tests)
20
21 (eval-when (:compile-toplevel :load-toplevel :execute)
22 (unless (uffi:load-foreign-library
23          #-(or macosx darwin)
24          (uffi:find-foreign-library
25           "libz"
26           '("/usr/local/lib/" "/usr/lib/" "/zlib/")
27           :types '("so" "a"))
28          #+(or macosx darwin)
29          (uffi:find-foreign-library "z"
30                                     `(,(pathname-directory *load-pathname*)))
31          :module "zlib" 
32          :supporting-libraries '("c"))
33   (warn "Unable to load zlib")))
34   
35 (unless (uffi:load-foreign-library 
36          (uffi:find-foreign-library "uffi-c-test-lib" 
37                                     (list
38                                      (pathname-directory *load-truename*)
39                                      "/usr/lib/uffi/"))
40          :supporting-libraries '("c")
41          :module "uffi_tests")
42   (warn "Unable to load uffi-c-test-lib library"))
43