cl: cffi:*foreign-library-directories*
Table of Contents
- It's a special variable that contains a list of directories that cffi will use as a fallback.
- By default, it's empty
Here's an example that shows how to configure that special variable
without loading cffi's system at all. Which is means it can safely be
added to a configuration file (like ~/.sbclrc
).
;; Create a dummy package #-cffi (defpackage #:cffi (:use)) #-cffi ;; We create and export the symbol cffi:*foreign-library-directories* (export ;; This is to make sure the _symbol_ exists before the defvar, ;; otherwise the reader will complain that it doesn't exist. (intern "*FOREIGN-LIBRARY-DIRECTORIES*" '#:cffi) '#:cffi) ;; This is to bind the symbol and proclaim it special. #-cffi (defvar cffi:*foreign-library-directories* '()) ;; Idempotently add a list of paths to ;; cffi:*foreign-library-directories* (progn (map nil (lambda (path) (pushnew path cffi:*foreign-library-directories* :test #'equal)) ;; Generated with: ;; sudo ldconfig -N -v 2>&1 | sed -n 's|^\(/[^:]*\).*$|\1|p' \ ;; | sort -u | sed 's/^/"/; s/$/"/; 1 s/^/\'(/; $ s/$/)/' '("/lib" "/lib/i386-linux-gnu" "/lib/x86_64-linux-gnu" "/lib32" "/sbin/ldconfig.real" "/usr/lib/x86_64-linux-gnu/libfakeroot" "/usr/local/lib")) cffi:*foreign-library-directories*)
1. Backlinks
- Common lisp (common-lisp.org)