System-installed header files sometimes are in different places depending on the OS and method of installation. In particular, the file ffi.h that FSBV (http://repo.or.cz/w/fsbv.git) uses from libffi seems to be in different places on OS X depending on how it was installed (Apple native, Mac ports, etc.). Not being a user of OS X, it is difficult for me to know all the possible locations where this file might end up. Is it possible to specify that the groveler should "search system-standard locations" for the header files specified in include forms, analogous to load-foreign-library knowing where to look for system libraries, and have it find the file based on its knowledge of the places it might be for the current OS?
Thank you.
Liam
On Thu, 2009-08-20 at 22:37 -0400, Liam Healy wrote:
System-installed header files sometimes are in different places depending on the OS and method of installation. In particular, the file ffi.h that FSBV (http://repo.or.cz/w/fsbv.git) uses from libffi seems to be in different places on OS X depending on how it was installed (Apple native, Mac ports, etc.). Not being a user of OS X, it is difficult for me to know all the possible locations where this file might end up. Is it possible to specify that the groveler should "search system-standard locations" for the header files specified in include forms,
The groveler does not do any kind of searching: it merely invokes the system C compiler which searches for includes in "system-standard locations". what you need is a way to configure the sources; for example, a simple ./configure scripts that looks for libffi and generates a config.lisp would do
analogous to load-foreign-library knowing where to look for system libraries, and have it find the file based on its knowledge of the places it might be for the current OS?
l-f-l does not know where to look for system libraries. it only calls the implementation's loader which in turn calls dlopen(). it's dlopen() that which does the lookup based on OS-dependent configuration
On Fri, Aug 21, 2009 at 3:54 AM, Stelian Ionescusionescu@cddr.org wrote:
On Thu, 2009-08-20 at 22:37 -0400, Liam Healy wrote:
System-installed header files sometimes are in different places depending on the OS and method of installation. In particular, the file ffi.h that FSBV (http://repo.or.cz/w/fsbv.git) uses from libffi seems to be in different places on OS X depending on how it was installed (Apple native, Mac ports, etc.). Not being a user of OS X, it is difficult for me to know all the possible locations where this file might end up. Is it possible to specify that the groveler should "search system-standard locations" for the header files specified in include forms,
The groveler does not do any kind of searching: it merely invokes the system C compiler which searches for includes in "system-standard locations". what you need is a way to configure the sources; for example, a simple ./configure scripts that looks for libffi and generates a config.lisp would do
OK, understood, thanks for the explanation. I *think* I've solved the Mac Ports problem by adding this:
#+darwin (setf cffi-grovel::*cc-flags* (append '("-I" "/opt/local/include/") cffi-grovel::*cc-flags*))
but since I don't use the Mac I will need to wait for reports from Mac users to confirm.
Liam