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 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Feb 2002
10 ;;;; $Id: libraries.cl,v 1.2 2002/04/05 04:10:38 desoi Exp $
12 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
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 ;;;; *************************************************************************
19 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
22 (defvar *loaded-libraries* nil
23 "List of foreign libraries loaded. Used to prevent reloading a library")
25 ;in MCL calling this more than once for the same library does not do anything
26 (defmacro load-foreign-library (filename &key module supporting-libraries)
27 (declare (ignore module supporting-libraries))
28 `(eval-when (:compile-toplevel :load-toplevel :execute)
29 (when (ccl:add-to-shared-library-search-path ,filename t)
30 (pushnew ,filename *loaded-libraries*))))
32 (defun convert-supporting-libraries-to-string (libs)
35 (push (format nil "-l~A" lib) lib-load-list))
36 (nreverse lib-load-list)))