1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10; Package: UFFI -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: libraries.cl
6 ;;;; Purpose: UFFI source to load foreign libraries
7 ;;;; Programmers: Kevin M. Rosenberg and John DeSoi
8 ;;;; Date Started: Feb 2002
10 ;;;; $Id: libraries.cl,v 1.3 2002/04/06 19:11:15 kevin Exp $
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
15 ;;;; UFFI users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
20 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
23 (defvar *loaded-libraries* nil
24 "List of foreign libraries loaded. Used to prevent reloading a library")
26 ;in MCL calling this more than once for the same library does not do anything
27 (defmacro load-foreign-library (filename &key module supporting-libraries)
28 (declare (ignore module supporting-libraries))
29 `(eval-when (:compile-toplevel :load-toplevel :execute)
30 (when (ccl:add-to-shared-library-search-path ,filename t)
31 (pushnew ,filename *loaded-libraries*))))
33 (defun convert-supporting-libraries-to-string (libs)
36 (push (format nil "-l~A" lib) lib-load-list))
37 (nreverse lib-load-list)))