Version 1.8.2: Test suite and more functions for foreign string encoding
[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 ;;;; This file, part of UFFI, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
11 ;;;;
12 ;;;; *************************************************************************
13
14 ;;; For CMUCL, it's necessary to load foreign files separate from their
15 ;;; usage
16
17 (in-package uffi-tests)
18
19 #+clisp (uffi:load-foreign-library "/usr/lib/libz.so" :module "z")
20 #-clisp
21 (unless (uffi:load-foreign-library
22          (uffi:find-foreign-library
23           #-(or macosx darwin)
24           "libz"
25           #+(or macosx darwin)
26           "z"
27           (list (pathname-directory *load-pathname*)
28                 "/usr/local/lib/" #+(or 64bit x86-64) "/usr/lib64/"
29                 "/usr/lib32/"
30                 "/opt/local/lib/"
31                 "/usr/lib/" "/zlib/"))
32          :module "zlib"
33          :supporting-libraries '("c"))
34   (warn "Unable to load zlib"))
35
36 #+clisp (uffi:load-foreign-library "/home/kevin/debian/src/uffi/tests/uffi-c-test.so" :module "uffi_tests")
37 #-clisp
38 (unless (uffi:load-foreign-library
39          (uffi:find-foreign-library
40           '(#+(or 64bit x86-64) "uffi-c-test64" "uffi-c-test")
41           (list (pathname-directory *load-truename*)
42                 "/usr/lib/uffi/"
43                 "/home/kevin/debian/src/uffi/tests/"))
44          :supporting-libraries '("c")
45          :module "uffi_tests")
46   (warn "Unable to load uffi-c-test library"))
47