File: foreign-loader.lisp

package info (click to toggle)
cl-uffi 2.1.2-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,028 kB
  • sloc: lisp: 3,854; xml: 2,990; makefile: 238; ansic: 169; sh: 35
file content (47 lines) | stat: -rw-r--r-- 1,665 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name:          foreign-loader.lisp
;;;; Purpose:       Loads foreign libraries
;;;; Author:        Kevin M. Rosenberg
;;;; Date Started:  Feb 2002
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
;;;;
;;;; *************************************************************************

;;; For CMUCL, it's necessary to load foreign files separate from their
;;; usage

(in-package uffi-tests)

#+clisp (uffi:load-foreign-library "/usr/lib/libz.so" :module "z")
#-clisp
(unless (uffi:load-foreign-library
         (uffi:find-foreign-library
          #-(or macosx darwin)
          "libz"
          #+(or macosx darwin)
          "z"
          (list (pathname-directory *load-pathname*)
                "/usr/local/lib/" #+(or 64bit x86-64) "/usr/lib64/"
                "/usr/lib32/"
                "/opt/local/lib/"
                "/usr/lib/" "/zlib/"))
         :module "zlib"
         :supporting-libraries '("c"))
  (warn "Unable to load zlib"))

#+clisp (uffi:load-foreign-library "/home/kevin/debian/src/uffi/tests/uffi-c-test.so" :module "uffi_tests")
#-clisp
(unless (uffi:load-foreign-library
         (uffi:find-foreign-library
          '(#+(or 64bit x86-64) "uffi-c-test64" "uffi-c-test")
          (list (pathname-directory *load-truename*)
                "/usr/lib/uffi/"
                "/home/kevin/debian/src/uffi/tests/"))
         :supporting-libraries '("c")
         :module "uffi_tests")
  (warn "Unable to load uffi-c-test library"))