[Ecls-list] passing compiler and linker options through'compile-file'

Goffioul Michael goffioul at imec.be
Mon Sep 3 07:32:00 UTC 2007

> Greetings,
> Is there a way to pass compiler and linker options to the 
> gcc/dllwrap invocation that ECL spawns for 'compile-file'?  
> My intention is to use ECL's static FFI to construct an 
> interface to a native library, so that the functionality that 
> it provides is available to an ECL image (by loading a compiled fasl).
> To get this to work I need to be able to pass the location of 
> the header files during the compile phase, and the library 
> path and name during the link phase, but I couldn't find 
> anything in the documentation that shows how this might be done.
> I  got it working (under MinGW) by adding 3 new keyword 
> arguments to 'compile-file' (:cc-flags, :ld-path, :ld-libs).  
> The value of 'cc-flags' is passed to 'compiler-cc', and 
> 'ld-path' and 'ld-libs' to 'bundle-cc'.
> Since I'm not sure, though, if this the best (or even 
> correct) approach.  Any comments or suggestions would be appreciated.

Use the existing variables c::*cc-flags* and c::*ld-flags* to
achieve the same result.

For instance

(let ((c::*cc-flags* (concatenate 'string c::*cc-flags* " -I/my/dir")))
  (compile-file ...))


More information about the ecl-devel mailing list