This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: New libffi release? Other misc issues.
- From: Luis Lavena <luislavena at gmail dot com>
- To: Thomas Petazzoni <thomas dot petazzoni at free-electrons dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Mon, 4 Feb 2013 21:45:11 -0300
- Subject: Re: New libffi release? Other misc issues.
- References: <20130205004232.579026ed@skate>
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