public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Headers installation into libdir?
@ 2010-07-03 16:26 Luis Lavena
       [not found] ` <4C2F67FF.80706@gentoo.org>
  2010-07-03 16:49 ` Samuli Suominen
  0 siblings, 2 replies; 4+ messages in thread
From: Luis Lavena @ 2010-07-03 16:26 UTC (permalink / raw)
  To: libffi-discuss

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

Hello,

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?

I believe that specific behavior is not good for packagers or users
trying to install libffi for normal usage.

Please find attached a patch against master that corrects this behavior.

Thank you.
-- 
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

[-- Attachment #2: 0001-Includes-should-go-in-includedir-not-libdir.patch --]
[-- Type: application/octet-stream, Size: 1395 bytes --]

From b1184c2c41de4efc26866e6fb93cb9c694f14f8f Mon Sep 17 00:00:00 2001
From: Luis Lavena <luislavena@gmail.com>
Date: Sat, 3 Jul 2010 12:48:20 -0300
Subject: [PATCH] Includes should go in includedir, not libdir.

This patch corrects the installation of ffi.h and ffitarget.h
to properly put in $(includedir) instead of $(libdir)

It also avoids prepending package name and version to it, causing
issues by development tools trying to find it.
---
 include/Makefile.am |    2 +-
 include/Makefile.in |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index fd28024..15301d6 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,5 +5,5 @@ AUTOMAKE_OPTIONS=foreign
 DISTCLEANFILES=ffitarget.h
 EXTRA_DIST=ffi.h.in ffi_common.h
 
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includesdir = $(includedir)
 nodist_includes_HEADERS = ffi.h ffitarget.h
diff --git a/include/Makefile.in b/include/Makefile.in
index f370697..c62d6c4 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -204,7 +204,7 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 DISTCLEANFILES = ffitarget.h
 EXTRA_DIST = ffi.h.in ffi_common.h
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includesdir = $(includedir)
 nodist_includes_HEADERS = ffi.h ffitarget.h
 all: all-am
 
-- 
1.7.1.msysgit.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Headers installation into libdir?
       [not found] ` <4C2F67FF.80706@gentoo.org>
@ 2010-07-03 16:47   ` Luis Lavena
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Lavena @ 2010-07-03 16:47 UTC (permalink / raw)
  To: ssuominen, libffi-discuss

On Sat, Jul 3, 2010 at 1:40 PM, Samuli Suominen <ssuominen@gentoo.org> wrote:
> On 07/03/2010 07:26 PM, Luis Lavena wrote:
>> Hello,
>>
>> 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?
>>
>> I believe that specific behavior is not good for packagers or users
>> trying to install libffi for normal usage.
>>
>> Please find attached a patch against master that corrects this behavior.
>>
>> Thank you.
>
> 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

The problem is MinGW where there is no working, out of the box
pkg-config utility.

That you for your answer, I couldn't find any reference of other
library doing the same.
-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Headers installation into libdir?
  2010-07-03 16:26 Headers installation into libdir? Luis Lavena
       [not found] ` <4C2F67FF.80706@gentoo.org>
@ 2010-07-03 16:49 ` Samuli Suominen
  2010-07-05 14:02   ` Luis Lavena
  1 sibling, 1 reply; 4+ messages in thread
From: Samuli Suominen @ 2010-07-03 16:49 UTC (permalink / raw)
  To: libffi-discuss

On 07/03/2010 07:26 PM, Luis Lavena wrote:
> Hello,
> 
> 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?
> 
> I believe that specific behavior is not good for packagers or users
> trying to install libffi for normal usage.
> 
> Please find attached a patch against master that corrects this behavior.
> 
> Thank you.

It's because the headers are archtype specific, libdir is the correct
place for them, use pkg-config in your projects, like `pkg-config
--cflags libffi` to get the include dir

(btw, I also replied to you off-list before this reply by accident)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Headers installation into libdir?
  2010-07-03 16:49 ` Samuli Suominen
@ 2010-07-05 14:02   ` Luis Lavena
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Lavena @ 2010-07-05 14:02 UTC (permalink / raw)
  To: Samuli Suominen; +Cc: libffi-discuss

On Sat, Jul 3, 2010 at 1:50 PM, Samuli Suominen <ssuominen@gentoo.org> wrote:
> On 07/03/2010 07:26 PM, Luis Lavena wrote:
>> Hello,
>>
>> 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?
>>
>> I believe that specific behavior is not good for packagers or users
>> trying to install libffi for normal usage.
>>
>> Please find attached a patch against master that corrects this behavior.
>>
>> Thank you.
>
> It's because the headers are archtype specific, libdir is the correct
> place for them, use pkg-config in your projects, like `pkg-config
> --cflags libffi` to get the include dir
>
> (btw, I also replied to you off-list before this reply by accident)
>

Thank you.

However, I see this as a problem. For example, when installing libffi
uisng macports, the include files are available directly without the
explicit need of pkg-config

Also, the lack of fully working/functional pkg-config will complicate
libffi usage on Windows platform using GCC for compilation.

How these package managers make the include file directly available?

Thank you.
-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-05 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-03 16:26 Headers installation into libdir? Luis Lavena
     [not found] ` <4C2F67FF.80706@gentoo.org>
2010-07-03 16:47   ` Luis Lavena
2010-07-03 16:49 ` Samuli Suominen
2010-07-05 14:02   ` Luis Lavena

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).