public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
@ 2014-03-03 12:36 Dominik Vogt
  2014-03-03 12:41 ` Samuli Suominen
  2014-03-12  6:49 ` [PING 1][PATCH] " Dominik Vogt
  0 siblings, 2 replies; 9+ messages in thread
From: Dominik Vogt @ 2014-03-03 12:36 UTC (permalink / raw)
  To: libffi-discuss

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

configure.ac forgets to use $CFLAGS when running

  $CC -print-multi-os-directory

This may result in a bad installation path for the library (on
s390 I get ..../lib/../lib64 instead of just ..../lib" as it should
be).  The attached patch fixes that (configure needs to be
regenerated.)

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-Use-CFLAGS-to-calculate-multi_os_directory-in-config.patch --]
[-- Type: text/x-diff, Size: 812 bytes --]

From 45a31e758b046622b0a7b0678e75c3ff21244494 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@de.ibm.com>
Date: Mon, 3 Mar 2014 13:30:59 +0100
Subject: [PATCH 1/2] Use $CFLAGS to calculate multi_os_directory in
 configure.ac.

---
 configure.ac |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4dd919d..4722b40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -575,7 +575,7 @@ if test "x$GCC" = "xyes"; then
     toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
     toolexeclibdir='$(libdir)'
   fi
-  multi_os_directory=`$CC -print-multi-os-directory`
+  multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
   case $multi_os_directory in
     .) ;; # Avoid trailing /.
     ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-- 
1.7.9.5


[-- Attachment #3: ChangeLog --]
[-- Type: text/plain, Size: 130 bytes --]

2014-03-03  Dominik Vogt  <dominik(dot)vogt(at)gmx(dot)de>

	* configure.ac (multi_os_directory): Use $CFLAGS to get correct dir


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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 12:36 [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac Dominik Vogt
@ 2014-03-03 12:41 ` Samuli Suominen
  2014-03-03 12:43   ` Samuli Suominen
  2014-03-12  6:49 ` [PING 1][PATCH] " Dominik Vogt
  1 sibling, 1 reply; 9+ messages in thread
From: Samuli Suominen @ 2014-03-03 12:41 UTC (permalink / raw)
  To: libffi-discuss


On 03/03/14 14:36, Dominik Vogt wrote:
> configure.ac forgets to use $CFLAGS when running
>
>   $CC -print-multi-os-directory
>
> This may result in a bad installation path for the library (on
> s390 I get ..../lib/../lib64 instead of just ..../lib" as it should
> be).  The attached patch fixes that (configure needs to be
> regenerated.)
>
> Ciao
>
> Dominik ^_^  ^_^
>

Since we are on the /topic of -print-multi-os-directory and it's use in
libffi, I'd like to point out the concept is broken:

http://bugs.gentoo.org/show_bug.cgi?id=462814

It's in direct conflict with the use of --libdir= and is not flexible
enough to be used in packages like this.

What really should be done, is revert the patch that ever introduced the
use of -print-multi-os-directory for determining
the installation directory, or at the very least, force it to respect
--libdir=, not override --libdir=

- Samuli

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 12:41 ` Samuli Suominen
@ 2014-03-03 12:43   ` Samuli Suominen
  2014-03-03 12:56     ` Dominik Vogt
  0 siblings, 1 reply; 9+ messages in thread
From: Samuli Suominen @ 2014-03-03 12:43 UTC (permalink / raw)
  To: libffi-discuss


On 03/03/14 14:38, Samuli Suominen wrote:
> On 03/03/14 14:36, Dominik Vogt wrote:
>> configure.ac forgets to use $CFLAGS when running
>>
>>   $CC -print-multi-os-directory
>>
>> This may result in a bad installation path for the library (on
>> s390 I get ..../lib/../lib64 instead of just ..../lib" as it should
>> be).  The attached patch fixes that (configure needs to be
>> regenerated.)
>>
>> Ciao
>>
>> Dominik ^_^  ^_^
>>
> Since we are on the /topic of -print-multi-os-directory and it's use in
> libffi, I'd like to point out the concept is broken:
>
> http://bugs.gentoo.org/show_bug.cgi?id=462814
>
> It's in direct conflict with the use of --libdir= and is not flexible
> enough to be used in packages like this.
>
> What really should be done, is revert the patch that ever introduced the
> use of -print-multi-os-directory for determining
> the installation directory, or at the very least, force it to respect
> --libdir=, not override --libdir=
>
> - Samuli

So, we ended up using a hack like...

sed -i 's:@toolexeclibdir@:$(libdir):g' Makefile.in

...to package libffi, but I don't agree forcing the use of `sed` is a
good prereq for configuring a package
to respect the users, systems, wishes

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 12:43   ` Samuli Suominen
@ 2014-03-03 12:56     ` Dominik Vogt
  2014-03-03 13:05       ` Samuli Suominen
  0 siblings, 1 reply; 9+ messages in thread
From: Dominik Vogt @ 2014-03-03 12:56 UTC (permalink / raw)
  To: libffi-discuss

While we're talking about installations paths:  "make istall"
should really install ffi.h to <prefix>/include/libffi... and not
to <prefix>/lib/libffi.../include.  It doen't respect --installdir=
either.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 12:56     ` Dominik Vogt
@ 2014-03-03 13:05       ` Samuli Suominen
  2014-03-03 13:34         ` Dominik Vogt
  2014-03-03 14:10         ` Anthony Green
  0 siblings, 2 replies; 9+ messages in thread
From: Samuli Suominen @ 2014-03-03 13:05 UTC (permalink / raw)
  To: libffi-discuss


On 03/03/14 14:56, Dominik Vogt wrote:
> While we're talking about installations paths:  "make istall"
> should really install ffi.h to <prefix>/include/libffi... and not
> to <prefix>/lib/libffi.../include.  It doen't respect --installdir=
> either.
>
> Ciao
>
> Dominik ^_^  ^_^
>

The headers are arch specific and belong to libdir.  The use of
pkg-config is mandatory:

<snip>

$ grep include /usr/lib/pkgconfig/libffi.pc
includedir=${libdir}/libffi-3.0.13/include
Cflags: -I${includedir}

$ pkg-config --cflags-only-I libffi
-I/usr/lib64/libffi-3.0.13/include

$ diff -ur /usr/lib32/libffi-3.0.13 /usr/lib64/libffi-3.0.13
diff -ur /usr/lib32/libffi-3.0.13/include/ffi.h
/usr/lib64/libffi-3.0.13/include/ffi.h
--- /usr/lib32/libffi-3.0.13/include/ffi.h    2013-10-19
16:20:31.091611936 +0300
+++ /usr/lib64/libffi-3.0.13/include/ffi.h    2013-10-19
16:20:31.239611933 +0300
@@ -58,8 +58,8 @@
 #endif
 
 /* Specify which architecture libffi is configured for. */
-#ifndef X86
-#define X86
+#ifndef X86_64
+#define X86_64
 #endif
 
 /* ---- System configuration information
--------------------------------- */

</snip>

I'm sorry but this has been discussed in this very ML many times
already, I'm just pointing
the conclusion.

- Samuli

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 13:05       ` Samuli Suominen
@ 2014-03-03 13:34         ` Dominik Vogt
  2014-03-03 13:44           ` Samuli Suominen
  2014-03-03 14:10         ` Anthony Green
  1 sibling, 1 reply; 9+ messages in thread
From: Dominik Vogt @ 2014-03-03 13:34 UTC (permalink / raw)
  To: libffi-discuss

On Mon, Mar 03, 2014 at 03:02:47PM +0200, Samuli Suominen wrote:
> On 03/03/14 14:56, Dominik Vogt wrote:
> > While we're talking about installations paths:  "make istall"
> > should really install ffi.h to <prefix>/include/libffi... and not
> > to <prefix>/lib/libffi.../include.  It doen't respect --installdir=
> > either.
> 
> The headers are arch specific and belong to libdir.

Still, "./configure --help" claims that --includedir= works, but it
doesn't:

 $ ./configure --help
 ...
 --includedir=DIR        C header files [PREFIX/include]
                         ^^^^^^^^^^^^^^

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 13:34         ` Dominik Vogt
@ 2014-03-03 13:44           ` Samuli Suominen
  0 siblings, 0 replies; 9+ messages in thread
From: Samuli Suominen @ 2014-03-03 13:44 UTC (permalink / raw)
  To: libffi-discuss


On 03/03/14 15:34, Dominik Vogt wrote:
> On Mon, Mar 03, 2014 at 03:02:47PM +0200, Samuli Suominen wrote:
>> On 03/03/14 14:56, Dominik Vogt wrote:
>>> While we're talking about installations paths:  "make istall"
>>> should really install ffi.h to <prefix>/include/libffi... and not
>>> to <prefix>/lib/libffi.../include.  It doen't respect --installdir=
>>> either.
>> The headers are arch specific and belong to libdir.
> Still, "./configure --help" claims that --includedir= works, but it
> doesn't:
>
>  $ ./configure --help
>  ...
>  --includedir=DIR        C header files [PREFIX/include]
>                          ^^^^^^^^^^^^^^
>
> Ciao
>
> Dominik ^_^  ^_^
>

I hear you. Indeed, there should be an ./configure switch to override
the default. But since not everyone
is realizing the headers are arch specific, there should at the very
least be ./configure --help 'information'
about to let people know it's not a good idea.
Possibly it shouldn't be --includedir=, but something like
--with-override-includedir=
Likewise for --with-override-libdir= for the other case of multi os
directory

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

* Re: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 13:05       ` Samuli Suominen
  2014-03-03 13:34         ` Dominik Vogt
@ 2014-03-03 14:10         ` Anthony Green
  1 sibling, 0 replies; 9+ messages in thread
From: Anthony Green @ 2014-03-03 14:10 UTC (permalink / raw)
  To: Samuli Suominen; +Cc: libffi-discuss

Samuli Suominen <ssuominen@gentoo.org> writes:

> On 03/03/14 14:56, Dominik Vogt wrote:
>> While we're talking about installations paths:  "make istall"
>> should really install ffi.h to <prefix>/include/libffi... and not
>> to <prefix>/lib/libffi.../include.  It doen't respect --installdir=
>> either.
>>
>> Ciao
>>
>> Dominik ^_^  ^_^
>>
>
> The headers are arch specific and belong to libdir.  The use of
> pkg-config is mandatory:
>

This is true.  However, I'd like it to change.  We should be able to
install the headers in /usr/include through careful use of compiler
defined macros.  I got most of the way through this change last year
when I hit the Power port.  The Power port is complex thanks to the wide
variety of targets and compilers we support (multiple flavours of AIX,
Darwin and Linux, each with their own compilers).

I can try this again for 3.0.15 (or 4?) on a git branch if I can get
some support on the Power side of things.  Volunteers?

AG

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

* [PING 1][PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.
  2014-03-03 12:36 [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac Dominik Vogt
  2014-03-03 12:41 ` Samuli Suominen
@ 2014-03-12  6:49 ` Dominik Vogt
  1 sibling, 0 replies; 9+ messages in thread
From: Dominik Vogt @ 2014-03-12  6:49 UTC (permalink / raw)
  To: libffi-discuss

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

On Mon, Mar 03, 2014 at 01:36:19PM +0100, Dominik Vogt wrote:
> configure.ac forgets to use $CFLAGS when running
> 
>   $CC -print-multi-os-directory
> 
> This may result in a bad installation path for the library (on
> s390 I get ..../lib/../lib64 instead of just ..../lib" as it should
> be).  The attached patch fixes that (configure needs to be
> regenerated.)

(ChangeLog included in the patch this time.)

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-Use-CFLAGS-to-calculate-multi_os_directory-in-config.patch --]
[-- Type: text/x-diff, Size: 1190 bytes --]

From 27d64a675b84007772c5839dada0c8c0e9b02081 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@de.ibm.com>
Date: Mon, 3 Mar 2014 13:30:59 +0100
Subject: [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac.

---
 ChangeLog    |    4 ++++
 configure.ac |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 03bfdff..8dfa7e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-03-03  Dominik Vogt  <dominik(dot)vogt(at)gmx(dot)de>
+
+	* configure.ac (multi_os_directory): Use $CFLAGS to get correct dir
+
 2014-03-01  Anthony Green  <green@moxielogic.com>
 
 	* Makefile.am (EXTRA_DIST): Replace old scripts with
diff --git a/configure.ac b/configure.ac
index 4dd919d..4722b40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -575,7 +575,7 @@ if test "x$GCC" = "xyes"; then
     toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
     toolexeclibdir='$(libdir)'
   fi
-  multi_os_directory=`$CC -print-multi-os-directory`
+  multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
   case $multi_os_directory in
     .) ;; # Avoid trailing /.
     ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-- 
1.7.9.5


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

end of thread, other threads:[~2014-03-12  6:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03 12:36 [PATCH] Use $CFLAGS to calculate multi_os_directory in configure.ac Dominik Vogt
2014-03-03 12:41 ` Samuli Suominen
2014-03-03 12:43   ` Samuli Suominen
2014-03-03 12:56     ` Dominik Vogt
2014-03-03 13:05       ` Samuli Suominen
2014-03-03 13:34         ` Dominik Vogt
2014-03-03 13:44           ` Samuli Suominen
2014-03-03 14:10         ` Anthony Green
2014-03-12  6:49 ` [PING 1][PATCH] " Dominik Vogt

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).