libffi's weird packaging

Joshua Root jmr at macports.org
Mon Dec 28 04:20:05 PST 2015


On 2015-12-28 19:54 , Mojca Miklavec wrote:
> Hi,
> 
> I wonder if there is any special reason for this weird packaging of
> libffi (the include files in particular; does it conflicts with other
> libraries?):
> 
> Port libffi contains:
>   /opt/local/lib/libffi-3.2.1/include/ffi.h
>   /opt/local/lib/libffi-3.2.1/include/ffitarget.h
>   /opt/local/lib/libffi.6.dylib
>   /opt/local/lib/libffi.a
>   /opt/local/lib/libffi.dylib
>   /opt/local/lib/libffi.la
>   /opt/local/lib/pkgconfig/libffi.pc
>   /opt/local/share/info/libffi.info
>   /opt/local/share/man/man3/ffi.3.gz
>   /opt/local/share/man/man3/ffi_call.3.gz
>   /opt/local/share/man/man3/ffi_prep_cif.3.gz
>   /opt/local/share/man/man3/ffi_prep_cif_var.3.gz
> 
> When building moarvm which needs ffi.h and apparently doesn't care
> about "libffi.pc" yet, I had to add the following to the Portfile
> which looks like a relatively bad idea to me:
> 
>     configure.cflags-append "-I${prefix}/lib/libffi-3.2.1/include"

I guess you mean it's a bad idea because of the hardcoded version? This
isn't a bad construct in general, apart from that (though normally
cppflags is more appropriate). It's better to use pkgconfig of course.

> Can someone suggest me what to do (other than asking moarvm
> maintainers to fix the libffi detection and use)?

You may need to ask upstream why they install the headers in that
unusual place. I can't think of a problem that could be caused by at
least linking them into ${prefix}/include/libffi, but then I don't know
why they're not somewhere like that in the first place.

- Josh


More information about the macports-dev mailing list