This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New libffi release? Other misc issues.


On Mon, Feb 4, 2013 at 8:42 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>

Hello,

I'm answering as another libffi user...

[snipping questions about generated code in the respository]

>  4) Is there a reason for libffi to install its headers
>  in /usr/lib/libffi-<version>/include/ ? This is really a non-standard
>  location compared to just /usr/include or /usr/include/libffi.
>  Wouldn't it make sense to use a more standard behavior here?
>

Back in 2010, I asked (subject: Headers installation into libdir?)

I was wondering why libffi 3.0.9 and current master (in GitHub) both
install ffi.h and ffitarget.h into libdir/libffi-X.Y.Z/include
directory?

===

And got this as response:

I think it's because of arch specific headers it installs.

example snippet from ffi.h:

/* Specify which architecture libffi is configured for. */
#define X86_64

So the way it's installed now is in fact correct.

You should use pkg-config in your projects, like:

gcc `pkg-config --cflags libffi` -lffi main.c

$ pkg-config --cflags libffi
-I/usr/lib64/libffi-3.0.9/include
$ pkg-config --libs libffi
-lffi

===

I ended using a patch to deal with native compilation on Windows as
pkg-config is not provided:

https://github.com/luislavena/knapsack-recipes/blob/master/libffi/3.0.11/0001-Includes-should-go-in-includedir-not-libdir.patch

Cheers,
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]