Package: cffi
Variable *foreign-library-directories*
Value Type
A list, in which each element is a string, a pathname, or a simple Lisp
expression. Initial ValueThe empty list. Details You should not have to use this variable. Most, if not all, Lisps supported by CFFI have a reasonable default search algorithm for foreign libraries. For example, Lisps for Unix usually call dlopen(3), which in turn looks in the system library directories. Only if that fails does CFFI look for the named library file in these directories, and load it from there if found. Thus, this is intended to be a CFFI-only fallback to the library search configuration provided by your operating system. For example, if you distribute a foreign library with your Lisp package, you can add the library's containing directory to this list and portably expect CFFI to find it. A simple Lisp expression is intended to provide functionality commonly used in search paths such as ASDF's (see footnote [13]), and is defined recursively as follows (see footnote [14]):
Examples$ ls -| liblibli.so libli.lispIn libli.lisp: (pushnew #P"/home/sirian/lisp/libli/" *foreign-library-directories* :test #'equal)The following example would achieve the same effect: (pushnew '(merge-pathnames #p"lisp/libli/" (user-homedir-pathname)) *foreign-library-directories* :test #'equal) => ((MERGE-PATHNAMES #P"lisp/libli/" (USER-HOMEDIR-PATHNAME))) | See also |