public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* bfd.h installation location
@ 2002-05-10 17:15 Brendan Conoboy
  2002-05-11  0:59 ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Brendan Conoboy @ 2002-05-10 17:15 UTC (permalink / raw)
  To: binutils

Hiya,

Today I noticed that bfd.h gets installed under $prefix/include instead
of $exec-prefix/include (or maybe $exec-prefix/target-prefix/include),
but includes some host/target-specific data.  In particular, the
default word size:

/* The word size used by BFD on the host.  This may be 64 with a 32
   bit target if the host is 64 bit, or if other 64 bit targets have
   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
#define BFD_ARCH_SIZE 64

/* The word size of the default bfd target.  */
#define BFD_DEFAULT_TARGET_SIZE 64

This creates a bit of a conflict when there's two different hosts (a
32 bit and a 64 bit) sharing the same include directory.  Whichever
installs last gets its bfd.h and the other loses.  I don't know how
harmful this may be, but sure would like to know.  Can anybody comment?

-- 
-Brendan (blc@redhat.com)

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

* Re: bfd.h installation location
  2002-05-10 17:15 bfd.h installation location Brendan Conoboy
@ 2002-05-11  0:59 ` Alan Modra
  2002-05-11  1:04   ` Alexandre Oliva
                     ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Alan Modra @ 2002-05-11  0:59 UTC (permalink / raw)
  To: Brendan Conoboy; +Cc: binutils

On Fri, May 10, 2002 at 05:15:38PM -0700, Brendan Conoboy wrote:
> Today I noticed that bfd.h gets installed under $prefix/include instead

I question whether we should be installing any of these files by
default.  Which projects using libbfd don't provide their own
copy of bfd?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-11  0:59 ` Alan Modra
@ 2002-05-11  1:04   ` Alexandre Oliva
  2002-05-11  6:54   ` M. R. Brown
  2002-05-11  9:50   ` H . J . Lu
  2 siblings, 0 replies; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-11  1:04 UTC (permalink / raw)
  To: Alan Modra; +Cc: Brendan Conoboy, binutils

On May 11, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> On Fri, May 10, 2002 at 05:15:38PM -0700, Brendan Conoboy wrote:
>> Today I noticed that bfd.h gets installed under $prefix/include instead

> I question whether we should be installing any of these files by
> default.

My thought exactly.

However, even if we don't install them by default, an explicitly
requested install should still install them in an appropriate place.

> Which projects using libbfd don't provide their own copy of bfd?

None I'm aware of.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-11  0:59 ` Alan Modra
  2002-05-11  1:04   ` Alexandre Oliva
@ 2002-05-11  6:54   ` M. R. Brown
  2002-05-11  9:58     ` H . J . Lu
  2002-05-11  9:50   ` H . J . Lu
  2 siblings, 1 reply; 41+ messages in thread
From: M. R. Brown @ 2002-05-11  6:54 UTC (permalink / raw)
  To: Brendan Conoboy, binutils

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

* Alan Modra <amodra@bigpond.net.au> on Sat, May 11, 2002:

> On Fri, May 10, 2002 at 05:15:38PM -0700, Brendan Conoboy wrote:
> > Today I noticed that bfd.h gets installed under $prefix/include instead
> 
> I question whether we should be installing any of these files by
> default.  Which projects using libbfd don't provide their own
> copy of bfd?
> 

A lot of smaller, "single-target" applications do, mostly loader utilities
for embedded platforms.  Also a few disassemblers.  I don't see why the
installed libbfd should be removed if it's currently not breaking anything.
Including bfd in these projects would be overkill.

M. R.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: bfd.h installation location
  2002-05-11  0:59 ` Alan Modra
  2002-05-11  1:04   ` Alexandre Oliva
  2002-05-11  6:54   ` M. R. Brown
@ 2002-05-11  9:50   ` H . J . Lu
  2 siblings, 0 replies; 41+ messages in thread
From: H . J . Lu @ 2002-05-11  9:50 UTC (permalink / raw)
  To: Brendan Conoboy, binutils

On Sat, May 11, 2002 at 05:29:00PM +0930, Alan Modra wrote:
> On Fri, May 10, 2002 at 05:15:38PM -0700, Brendan Conoboy wrote:
> > Today I noticed that bfd.h gets installed under $prefix/include instead
> 
> I question whether we should be installing any of these files by
> default.  Which projects using libbfd don't provide their own
> copy of bfd?
> 

There are quite a few. I think, oprofile, modutils and ksymoops are
among them. I rememeber that because I had to add

-Wl,-Bstatic -lbfd, -Wl,-Bdynamic


H.J.


H.J.

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

* Re: bfd.h installation location
  2002-05-11  6:54   ` M. R. Brown
@ 2002-05-11  9:58     ` H . J . Lu
  2002-05-11 12:47       ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-11  9:58 UTC (permalink / raw)
  To: M. R. Brown; +Cc: Brendan Conoboy, binutils

On Sat, May 11, 2002 at 08:54:11AM -0500, M. R. Brown wrote:
> * Alan Modra <amodra@bigpond.net.au> on Sat, May 11, 2002:
> 
> > On Fri, May 10, 2002 at 05:15:38PM -0700, Brendan Conoboy wrote:
> > > Today I noticed that bfd.h gets installed under $prefix/include instead
> > 
> > I question whether we should be installing any of these files by
> > default.  Which projects using libbfd don't provide their own
> > copy of bfd?
> > 
> 
> A lot of smaller, "single-target" applications do, mostly loader utilities
> for embedded platforms.  Also a few disassemblers.  I don't see why the
> installed libbfd should be removed if it's currently not breaking anything.
> Including bfd in these projects would be overkill.
> 

People who override bfd.h must have some something wrong. I have

/export/tools/include/bfd.h
/export/tools/mipsel-linux/include/bfd.h
/usr/include/bfd.h

and

/export/tools/lib/libbfd-2.12.90.0.7.so
/export/tools/mipsel-linux/lib/libbfd-2.12.90.0.7.so
/usr/lib/libbfd-2.12.90.0.7.so

They are different. But I have no problems.


H.J.

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

* Re: bfd.h installation location
  2002-05-11  9:58     ` H . J . Lu
@ 2002-05-11 12:47       ` Alexandre Oliva
  2002-05-12 17:57         ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-11 12:47 UTC (permalink / raw)
  To: H . J . Lu; +Cc: M. R. Brown, Brendan Conoboy, binutils

On May 11, 2002, "H . J . Lu" <hjl@lucon.org> wrote:

> People who override bfd.h must have some something wrong.

You appear to be simply using different prefixes for each pair
(host,target).

The GNU Coding Standards say that files in $(prefix) should be common
for all hosts (and presumably to all targets), whereas files in
$(exec_prefix) may differ from one host to another.

Since bfd.h may differ from one host to another, it must not be
installed in $(prefix), but rather in $(exec_prefix).

You're free to keep exec_prefix = prefix, as long as you use different
prefixes for different hosts, but this should not be required, since
it's in direct conflict with the GNU Coding Standards.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-11 12:47       ` Alexandre Oliva
@ 2002-05-12 17:57         ` Alan Modra
  2002-05-12 22:18           ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-12 17:57 UTC (permalink / raw)
  To: binutils

On Sat, May 11, 2002 at 04:47:26PM -0300, Alexandre Oliva wrote:
> Since bfd.h may differ from one host to another, it must not be
> installed in $(prefix), but rather in $(exec_prefix).
> 
> You're free to keep exec_prefix = prefix, as long as you use different
> prefixes for different hosts, but this should not be required, since
> it's in direct conflict with the GNU Coding Standards.

OK, seems like enough projects want bfd.h installed.  I'm installing
this to mainline.

bfd/ChangeLog
	* Makefile.am (install-data-local): Install headers to
	$(exec_prefix)/include.
	* Makefile.in: Regenerate.

Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.81
diff -u -p -r1.81 Makefile.am
--- bfd/Makefile.am	4 Apr 2002 14:04:38 -0000	1.81
+++ bfd/Makefile.am	13 May 2002 00:51:49 -0000
@@ -675,11 +675,11 @@ $(BFD32_LIBS) \
 # Install BFD include file, and others that it needs.
 install-data-local: $(BFD_H)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(includedir)
-	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
-	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
-	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
-	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
+	$(mkinstalldirs) $(DESTDIR)$(exec_prefix)/include
+	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(exec_prefix)/include/bfd.h
+	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(exec_prefix)/include/ansidecl.h
+	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(exec_prefix)/include/symcat.h
+	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(exec_prefix)/include/bfdlink.h
 
 Makefile: $(srcdir)/configure.in
 
-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-12 17:57         ` Alan Modra
@ 2002-05-12 22:18           ` Alexandre Oliva
  2002-05-12 23:02             ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-12 22:18 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On May 12, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> bfd/ChangeLog
> 	* Makefile.am (install-data-local): Install headers to
> 	$(exec_prefix)/include.
> 	* Makefile.in: Regenerate.

I'm afraid this is not enough.  exec_prefix/include may still be
shared by compilers for different targets.  We should install bfd.h in
$(toolexecdir)/include or so.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-12 22:18           ` Alexandre Oliva
@ 2002-05-12 23:02             ` Alan Modra
  2002-05-12 23:20               ` H . J . Lu
  2002-05-12 23:46               ` Alexandre Oliva
  0 siblings, 2 replies; 41+ messages in thread
From: Alan Modra @ 2002-05-12 23:02 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Mon, May 13, 2002 at 02:18:26AM -0300, Alexandre Oliva wrote:
> On May 12, 2002, Alan Modra <amodra@bigpond.net.au> wrote:
> > bfd/ChangeLog
> > 	* Makefile.am (install-data-local): Install headers to
> > 	$(exec_prefix)/include.
> > 	* Makefile.in: Regenerate.
> 
> I'm afraid this is not enough.  exec_prefix/include may still be
> shared by compilers for different targets.  We should install bfd.h in
> $(toolexecdir)/include or so.

Yes, you're right.  Hmm, all this fussing over headers applies equally
to libbfd.a.  I think I need to copy some of the trickery in
libiberty/Makefile.in.  ie. install headers and libbfd to $libdir when
native, and to tooldir ($(exec_prefix)/$(target_alias)) for cross
targets.

Hey!  $with_cross_host never seems to be set for libiberty/  :-(

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-12 23:02             ` Alan Modra
@ 2002-05-12 23:20               ` H . J . Lu
  2002-05-12 23:46               ` Alexandre Oliva
  1 sibling, 0 replies; 41+ messages in thread
From: H . J . Lu @ 2002-05-12 23:20 UTC (permalink / raw)
  To: Alexandre Oliva, binutils

On Mon, May 13, 2002 at 03:32:02PM +0930, Alan Modra wrote:
> On Mon, May 13, 2002 at 02:18:26AM -0300, Alexandre Oliva wrote:
> > On May 12, 2002, Alan Modra <amodra@bigpond.net.au> wrote:
> > > bfd/ChangeLog
> > > 	* Makefile.am (install-data-local): Install headers to
> > > 	$(exec_prefix)/include.
> > > 	* Makefile.in: Regenerate.
> > 
> > I'm afraid this is not enough.  exec_prefix/include may still be
> > shared by compilers for different targets.  We should install bfd.h in
> > $(toolexecdir)/include or so.
> 
> Yes, you're right.  Hmm, all this fussing over headers applies equally
> to libbfd.a.  I think I need to copy some of the trickery in
> libiberty/Makefile.in.  ie. install headers and libbfd to $libdir when
> native, and to tooldir ($(exec_prefix)/$(target_alias)) for cross
> targets.

Are you sure this is ok? As far as I know, $(exec_prefix)/$(target_alias)
is for the cross target, not the host machine. That is on x86 host,
/export/tools/mipsel-linux/lib and /export/tools/mipsel-linux/include
are for mipsel-linux.


H.J.

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

* Re: bfd.h installation location
  2002-05-12 23:02             ` Alan Modra
  2002-05-12 23:20               ` H . J . Lu
@ 2002-05-12 23:46               ` Alexandre Oliva
  2002-05-13  0:13                 ` H . J . Lu
  1 sibling, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-12 23:46 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On May 13, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> Yes, you're right.  Hmm, all this fussing over headers applies equally
> to libbfd.a.

Hmm...  Indeed.

But then, as H.J.Lu says, $(toolexecdir), which I have proposed, is
not correct, as it contains libraries in the target format, not
libraries for the host with information about the target.

> tooldir ($(exec_prefix)/$(target_alias)) for cross targets.

How about $(exec_prefix)/x-$(target_alias)?

> Hey!  $with_cross_host never seems to be set for libiberty/  :-(

It's supposed to be passed from the top-level Makefile when
configuring libiberty with --host=$target, such that target libraries
can tell the actual host, should they care.  Choosing installation
directories is one of the cases in which they would care.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-12 23:46               ` Alexandre Oliva
@ 2002-05-13  0:13                 ` H . J . Lu
  2002-05-13  1:44                   ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-13  0:13 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Alan Modra, binutils

On Mon, May 13, 2002 at 03:46:02AM -0300, Alexandre Oliva wrote:
> > Yes, you're right.  Hmm, all this fussing over headers applies equally
> > to libbfd.a.
> 
> Hmm...  Indeed.
> 
> But then, as H.J.Lu says, $(toolexecdir), which I have proposed, is
> not correct, as it contains libraries in the target format, not
> libraries for the host with information about the target.

It is hardly a new problem. In my setup, all my cross binutils share
the same libbfd with the same prefix. I even use shared libbfd. Just
enable all bfd targets you want to use. It should work.


H.J.

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

* Re: bfd.h installation location
  2002-05-13  0:13                 ` H . J . Lu
@ 2002-05-13  1:44                   ` Alexandre Oliva
  2002-05-14 23:53                     ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-13  1:44 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Alan Modra, binutils

On May 13, 2002, "H . J . Lu" <hjl@lucon.org> wrote:

> On Mon, May 13, 2002 at 03:46:02AM -0300, Alexandre Oliva wrote:
>> > Yes, you're right.  Hmm, all this fussing over headers applies equally
>> > to libbfd.a.
>> 
>> Hmm...  Indeed.
>> 
>> But then, as H.J.Lu says, $(toolexecdir), which I have proposed, is
>> not correct, as it contains libraries in the target format, not
>> libraries for the host with information about the target.

> It is hardly a new problem.

Nobody said it was new.  It is just wrong.  Even if
--enable-targets=all is in use, you still have a different default in
place.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-13  1:44                   ` Alexandre Oliva
@ 2002-05-14 23:53                     ` Alan Modra
  2002-05-15  1:26                       ` Alexandre Oliva
                                         ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Alan Modra @ 2002-05-14 23:53 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: H . J . Lu, binutils

On Mon, May 13, 2002 at 05:44:03AM -0300, Alexandre Oliva wrote:
> On May 13, 2002, "H . J . Lu" <hjl@lucon.org> wrote:
> 
> > On Mon, May 13, 2002 at 03:46:02AM -0300, Alexandre Oliva wrote:
> >> > Yes, you're right.  Hmm, all this fussing over headers applies equally
> >> > to libbfd.a.
> >> 
> >> Hmm...  Indeed.
> >> 
> >> But then, as H.J.Lu says, $(toolexecdir), which I have proposed, is
> >> not correct, as it contains libraries in the target format, not
> >> libraries for the host with information about the target.
> 
> > It is hardly a new problem.
> 
> Nobody said it was new.  It is just wrong.  Even if
> --enable-targets=all is in use, you still have a different default in
> place.

OK, getting back to this problem.  The only reasonable solutions I see
are to a) only install libbfd.a and headers when host == target, or
b) install normally when host == target, and install as
$target_alias-libbfd.a and $target_alias-bfd.h etc. otherwise.
Case b) is similar to the way we install tools like objdump.

Otherwise you need to supply different prefixes or you'll overwrite
libbfd.a and headers when compiling for different targets.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-14 23:53                     ` Alan Modra
@ 2002-05-15  1:26                       ` Alexandre Oliva
  2002-05-15  8:52                         ` H . J . Lu
  2002-05-15  8:58                       ` H . J . Lu
  2002-05-16  6:18                       ` Maciej W. Rozycki
  2 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-15  1:26 UTC (permalink / raw)
  To: Alan Modra; +Cc: H . J . Lu, binutils

On May 15, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> b) install normally when host == target, and install as
> $target_alias-libbfd.a and $target_alias-bfd.h etc. otherwise.

I like it, but I'd rather have target_alias in directories, instead of
modifying the filenames, for two reasons:

i) when you include <bfd.h>, tweaking that to include <target-bfd.h>
conditionally would be painful, and

ii) getting SONAMEs and whatnot right when renaming libbfd at install
time would be insane, and we don't want to rename libbfd in the build
tree.

So, I'd rather install libbfd in $(libdir)/x-$(target_alias) and bfd.h
in $(includedir)/x-$(target_alias).

Then, it's always safe to add -I$(includedir)/x-$(target_alias)
-L$(libdir)/x-$(target_alias) to the build flags of packages that
assume a pre-installed bfd; even if they link with a host-x-host
toolchain, they'll find the right files (assuming it also has
-I$(includedir) and -L$(libdir)).

That said, I'm not sure cross bfd headers and libraries would be of
much use, so perhaps we could safely go with (a) and see whether
anyone complains before introducing the x-$(target_alias) precedent.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-15  1:26                       ` Alexandre Oliva
@ 2002-05-15  8:52                         ` H . J . Lu
  2002-05-15 14:56                           ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-15  8:52 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Alan Modra, binutils

On Wed, May 15, 2002 at 05:25:56AM -0300, Alexandre Oliva wrote:
> On May 15, 2002, Alan Modra <amodra@bigpond.net.au> wrote:
> 
> > b) install normally when host == target, and install as
> > $target_alias-libbfd.a and $target_alias-bfd.h etc. otherwise.
> 
> I like it, but I'd rather have target_alias in directories, instead of
> modifying the filenames, for two reasons:

No. When host == target, as far as installation goes, it is the same
as the native build.

> 
> i) when you include <bfd.h>, tweaking that to include <target-bfd.h>
> conditionally would be painful, and
> 
> ii) getting SONAMEs and whatnot right when renaming libbfd at install
> time would be insane, and we don't want to rename libbfd in the build
> tree.
> 
> So, I'd rather install libbfd in $(libdir)/x-$(target_alias) and bfd.h
> in $(includedir)/x-$(target_alias).
> 
> Then, it's always safe to add -I$(includedir)/x-$(target_alias)
> -L$(libdir)/x-$(target_alias) to the build flags of packages that
> assume a pre-installed bfd; even if they link with a host-x-host
> toolchain, they'll find the right files (assuming it also has
> -I$(includedir) and -L$(libdir)).
> 
> That said, I'm not sure cross bfd headers and libraries would be of
> much use, so perhaps we could safely go with (a) and see whether
> anyone complains before introducing the x-$(target_alias) precedent.
> 

What do you mean by "cross bfd headers and libraries"? Under my prefix.
/export/tools, I don't use anything under include and lib to compile
anything. I don't mind the idea to change names under

/export/tools/lib
/export/tools/include

That is when host != target.

But please don't change anything under /usr/lib, /usr/include,
/export/tools/mipsel-linux/include, /export/tools/mipsel-linux/lib,
where host == target.

BTW, I have been cross-compiling RedHat 7.1/7.3 rpms from Linux/x86
and Linux/mips. The only issue for me is libbfd and bfd.h under
/export/tools/lib and /export/tools/include.


H.J.

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

* Re: bfd.h installation location
  2002-05-14 23:53                     ` Alan Modra
  2002-05-15  1:26                       ` Alexandre Oliva
@ 2002-05-15  8:58                       ` H . J . Lu
  2002-05-15  9:23                         ` Andrew Cagney
  2002-05-16  6:18                       ` Maciej W. Rozycki
  2 siblings, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-15  8:58 UTC (permalink / raw)
  To: Alexandre Oliva, binutils

On Wed, May 15, 2002 at 04:22:57PM +0930, Alan Modra wrote:
> On Mon, May 13, 2002 at 05:44:03AM -0300, Alexandre Oliva wrote:
> > On May 13, 2002, "H . J . Lu" <hjl@lucon.org> wrote:
> > 
> > > On Mon, May 13, 2002 at 03:46:02AM -0300, Alexandre Oliva wrote:
> > >> > Yes, you're right.  Hmm, all this fussing over headers applies equally
> > >> > to libbfd.a.
> > >> 
> > >> Hmm...  Indeed.
> > >> 
> > >> But then, as H.J.Lu says, $(toolexecdir), which I have proposed, is
> > >> not correct, as it contains libraries in the target format, not
> > >> libraries for the host with information about the target.
> > 
> > > It is hardly a new problem.
> > 
> > Nobody said it was new.  It is just wrong.  Even if
> > --enable-targets=all is in use, you still have a different default in
> > place.
> 
> OK, getting back to this problem.  The only reasonable solutions I see
> are to a) only install libbfd.a and headers when host == target, or
> b) install normally when host == target, and install as
> $target_alias-libbfd.a and $target_alias-bfd.h etc. otherwise.
> Case b) is similar to the way we install tools like objdump.
> 
> Otherwise you need to supply different prefixes or you'll overwrite
> libbfd.a and headers when compiling for different targets.

You will overwrite libbfd.a and headers for different targets only
when host != target. I don't know any problems when host == target.

Under /export/tools, the host machine, Linux/x86, shares the same
set of libbfd and bfd.h with 3 different targets, i386-linux, 
mipsel-linux and mips-linux. But each target has its own libbfd
and bfd.h under /export/tools/i386-linux /export/tools/mipsel-linux
and /export/tools/mips-linux, respectively.

Please don't introduce any new problems.


H.J.

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

* Re: bfd.h installation location
  2002-05-15  8:58                       ` H . J . Lu
@ 2002-05-15  9:23                         ` Andrew Cagney
  2002-05-15  9:39                           ` H . J . Lu
  0 siblings, 1 reply; 41+ messages in thread
From: Andrew Cagney @ 2002-05-15  9:23 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Alexandre Oliva, binutils

> 
> You will overwrite libbfd.a and headers for different targets only
> when host != target. I don't know any problems when host == target.

./configure --enable-targets=LIST

> Under /export/tools, the host machine, Linux/x86, shares the same
> set of libbfd and bfd.h with 3 different targets, i386-linux, 
> mipsel-linux and mips-linux. But each target has its own libbfd
> and bfd.h under /export/tools/i386-linux /export/tools/mipsel-linux
> and /export/tools/mips-linux, respectively.

Um, could you clarify this a little.  What do the latter `libbfd.a's 
contain?

> Please don't introduce any new problems.

enjoy,
Andrew


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

* Re: bfd.h installation location
  2002-05-15  9:23                         ` Andrew Cagney
@ 2002-05-15  9:39                           ` H . J . Lu
  0 siblings, 0 replies; 41+ messages in thread
From: H . J . Lu @ 2002-05-15  9:39 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Alexandre Oliva, binutils

On Wed, May 15, 2002 at 12:23:09PM -0400, Andrew Cagney wrote:
> > 
> > You will overwrite libbfd.a and headers for different targets only
> > when host != target. I don't know any problems when host == target.
> 
> ./configure --enable-targets=LIST

The easy work around is make sure LIST has all targets you wants. On
my machine, I have

# /usr/bin/ld -V

GNU ld version 2.12.90.0.7 20020423
  Supported emulations:
   elf_i386
   i386linux
   elf64alpha
   alpha
   armelf_linux
   armelf
   criself
   crisaout
   crislinux
   hppalinux
   elf64_ia64
   m68kelf
   m68klinux
   elf32btsmip
   elf32ltsmip
   elf64btsmip
   elf64ltsmip
   elf32ppclinux
   elf32ppc
   elf32ppcsim
   elf_s390
   elf64_s390
   shlelf_linux
   shelf_linux
   elf32_sparc
   sparclinux
   elf64_sparc
   sun4
   i386pe

> 
> > Under /export/tools, the host machine, Linux/x86, shares the same
> > set of libbfd and bfd.h with 3 different targets, i386-linux, 
> > mipsel-linux and mips-linux. But each target has its own libbfd
> > and bfd.h under /export/tools/i386-linux /export/tools/mipsel-linux
> > and /export/tools/mips-linux, respectively.
> 
> Um, could you clarify this a little.  What do the latter `libbfd.a's 
> contain?
> 

libbfd.a under /export/tools/mipsel-linux is the same as the one on
Linux/mipself.


H.J.

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

* Re: bfd.h installation location
  2002-05-15  8:52                         ` H . J . Lu
@ 2002-05-15 14:56                           ` Alan Modra
  2002-05-15 16:54                             ` H . J . Lu
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-15 14:56 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Alexandre Oliva, binutils

On Wed, May 15, 2002 at 08:52:06AM -0700, H . J . Lu wrote:
> 
> But please don't change anything under /usr/lib, /usr/include,
> /export/tools/mipsel-linux/include, /export/tools/mipsel-linux/lib,
> where host == target.

If you re-read the proposal, you'll see that no one is suggesting
a change when host == target.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-15 14:56                           ` Alan Modra
@ 2002-05-15 16:54                             ` H . J . Lu
  2002-05-15 17:15                               ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-15 16:54 UTC (permalink / raw)
  To: Alexandre Oliva, binutils

On Thu, May 16, 2002 at 07:26:50AM +0930, Alan Modra wrote:
> On Wed, May 15, 2002 at 08:52:06AM -0700, H . J . Lu wrote:
> > 
> > But please don't change anything under /usr/lib, /usr/include,
> > /export/tools/mipsel-linux/include, /export/tools/mipsel-linux/lib,
> > where host == target.
> 
> If you re-read the proposal, you'll see that no one is suggesting
> a change when host == target.
> 

What is b) in

http://sources.redhat.com/ml/binutils/2002-05/msg00334.html

I assume you want to keep libbfd and bfd.h. If it is true, I don't have
a big problem. However, it still doesn't solve the problem with the
shared libbfd. Personally, I don't think fixing it completly is worth
the time. I solved it by enabling all targets I want to support in
bfd.



H.J.

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

* Re: bfd.h installation location
  2002-05-15 16:54                             ` H . J . Lu
@ 2002-05-15 17:15                               ` Alan Modra
  2002-05-15 17:50                                 ` H . J . Lu
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-15 17:15 UTC (permalink / raw)
  To: H . J . Lu; +Cc: binutils

On Wed, May 15, 2002 at 04:54:15PM -0700, H . J . Lu wrote:
> On Thu, May 16, 2002 at 07:26:50AM +0930, Alan Modra wrote:
> > On Wed, May 15, 2002 at 08:52:06AM -0700, H . J . Lu wrote:
> > > 
> > > But please don't change anything under /usr/lib, /usr/include,
> > > /export/tools/mipsel-linux/include, /export/tools/mipsel-linux/lib,
> > > where host == target.
> > 
> > If you re-read the proposal, you'll see that no one is suggesting
> > a change when host == target.
> > 
> 
> What is b) in
> 
> http://sources.redhat.com/ml/binutils/2002-05/msg00334.html

b) install normally when host == target ...

Hmm, I guess "install normally" isn't particularly clear.  I mean
install as we currently do, that is, libbfd.a, bfd.h etc. continue to
be installed to their current locations, without any name changes. 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-15 17:15                               ` Alan Modra
@ 2002-05-15 17:50                                 ` H . J . Lu
  2002-05-15 19:19                                   ` Alexandre Oliva
  2002-05-15 22:48                                   ` Alan Modra
  0 siblings, 2 replies; 41+ messages in thread
From: H . J . Lu @ 2002-05-15 17:50 UTC (permalink / raw)
  To: binutils

On Thu, May 16, 2002 at 09:45:44AM +0930, Alan Modra wrote:
> On Wed, May 15, 2002 at 04:54:15PM -0700, H . J . Lu wrote:
> > On Thu, May 16, 2002 at 07:26:50AM +0930, Alan Modra wrote:
> > > On Wed, May 15, 2002 at 08:52:06AM -0700, H . J . Lu wrote:
> > > > 
> > > > But please don't change anything under /usr/lib, /usr/include,
> > > > /export/tools/mipsel-linux/include, /export/tools/mipsel-linux/lib,
> > > > where host == target.
> > > 
> > > If you re-read the proposal, you'll see that no one is suggesting
> > > a change when host == target.
> > > 
> > 
> > What is b) in
> > 
> > http://sources.redhat.com/ml/binutils/2002-05/msg00334.html
> 
> b) install normally when host == target ...
> 
> Hmm, I guess "install normally" isn't particularly clear.  I mean
> install as we currently do, that is, libbfd.a, bfd.h etc. continue to
> be installed to their current locations, without any name changes. 

It doesn't help when --enable-shared is used. I don't mind
libbfd-target-version.so myself.


H.J.

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

* Re: bfd.h installation location
  2002-05-15 17:50                                 ` H . J . Lu
@ 2002-05-15 19:19                                   ` Alexandre Oliva
  2002-05-16  6:22                                     ` Maciej W. Rozycki
  2002-05-15 22:48                                   ` Alan Modra
  1 sibling, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-15 19:19 UTC (permalink / raw)
  To: H . J . Lu; +Cc: binutils

On May 15, 2002, "H . J . Lu" <hjl@lucon.org> wrote:

> It doesn't help when --enable-shared is used. I don't mind
> libbfd-target-version.so myself.

Hmm...  Good point, we can't just refrain from installing libbfd.la,
in case it is built as a shared library and other installed programs
are linked with it.

So...  I think the best alternative is to install in a subdir.  Using
a different SONAME would be fine, if there was an easy way to do it,
but I can't think of any that automake would grasp :-(

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-15 17:50                                 ` H . J . Lu
  2002-05-15 19:19                                   ` Alexandre Oliva
@ 2002-05-15 22:48                                   ` Alan Modra
  2002-05-16  8:36                                     ` H . J . Lu
  1 sibling, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-15 22:48 UTC (permalink / raw)
  To: binutils

On Wed, May 15, 2002 at 05:50:31PM -0700, H . J . Lu wrote:
> It doesn't help when --enable-shared is used. I don't mind
> libbfd-target-version.so myself.

Yes, that would be nice.  Here's the first step towards cleaning
up libbfd installation, installing libbfd and headers only when
native or --enable-shared.  I'm not familiar enough with libtool
to tackle renaming shared libs for the non-native shared case.

Comments and improvements welcome.  I'll install this in a day or
so, assuming it's not revised by some libtool guru.

bfd/ChangeLog
	* acinclude.m4 (AM_INSTALL_LIBBFD): New.
	* configure.in: Invoke AM_INSTALL_LIBBFD.
	* Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
	(install_libbfd): .. New target.
	(uninstall_libbfd): Likewise.
	(install-libLTLIBRARIES): Likewise.
	(uninstall-libLTLIBRARIES): Likewise.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

Index: bfd/acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.5
diff -u -p -r1.5 acinclude.m4
--- bfd/acinclude.m4	31 Aug 2000 09:35:50 -0000	1.5
+++ bfd/acinclude.m4	16 May 2002 04:40:33 -0000
@@ -123,3 +123,18 @@ ifelse(yes,no,[
 AC_DEFUN([CY_WITH_NLS],)
 AC_SUBST(INTLLIBS)
 ])
+
+AC_DEFUN([AM_INSTALL_LIBBFD],
+[AC_MSG_CHECKING([whether to install libbfd])
+  AC_ARG_ENABLE(install-libbfd,
+[  --install-libbfd controls installation of libbfd and related headers],
+      INSTALL_LIBBFD_P=$enableval,
+      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
+        INSTALL_LIBBFD_P=yes
+      else
+        INSTALL_LIBBFD_P=no
+      fi)
+  AC_MSG_RESULT($INSTALL_LIBBFD_P)
+  AM_CONDITIONAL(INSTALL_LIBBFD, test $INSTALL_LIBBFD_P = yes)
+]
+)
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.94
diff -u -p -r1.94 configure.in
--- bfd/configure.in	13 May 2002 13:33:29 -0000	1.94
+++ bfd/configure.in	16 May 2002 04:40:39 -0000
@@ -98,6 +98,7 @@ if test -z "$target" ; then
 fi
 
 AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
 AC_EXEEXT
 
 host64=false
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.82
diff -u -p -r1.82 Makefile.am
--- bfd/Makefile.am	13 May 2002 00:58:40 -0000	1.82
+++ bfd/Makefile.am	16 May 2002 04:40:32 -0000
@@ -672,14 +672,35 @@ $(BFD32_LIBS) \
  $(BFD64_BACKENDS) \
  $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
 
-# Install BFD include file, and others that it needs.
-install-data-local: $(BFD_H)
+install-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ install_libbfd
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(exec_prefix)/include
-	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(exec_prefix)/include/bfd.h
-	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(exec_prefix)/include/ansidecl.h
-	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(exec_prefix)/include/symcat.h
-	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(exec_prefix)/include/bfdlink.h
+
+uninstall-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ uninstall_libbfd
+	@$(NORMAL_UNINSTALL)
+
+.PHONY: install_libbfd uninstall_libbfd
+install_libbfd: $(lib_LTLIBRARIES) $(BFD_H)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(includedir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
+	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
+	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
+	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
+	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
+
+uninstall_libbfd:
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+	rm -f $(DESTDIR)$(includedir)/bfd.h
+	rm -f $(DESTDIR)$(includedir)/ansidecl.h
+	rm -f $(DESTDIR)$(includedir)/symcat.h
+	rm -f $(DESTDIR)$(includedir)/bfdlink.h
 
 Makefile: $(srcdir)/configure.in
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-14 23:53                     ` Alan Modra
  2002-05-15  1:26                       ` Alexandre Oliva
  2002-05-15  8:58                       ` H . J . Lu
@ 2002-05-16  6:18                       ` Maciej W. Rozycki
  2 siblings, 0 replies; 41+ messages in thread
From: Maciej W. Rozycki @ 2002-05-16  6:18 UTC (permalink / raw)
  To: Alan Modra; +Cc: Alexandre Oliva, H . J . Lu, binutils

On Wed, 15 May 2002, Alan Modra wrote:

> OK, getting back to this problem.  The only reasonable solutions I see
> are to a) only install libbfd.a and headers when host == target, or
> b) install normally when host == target, and install as
> $target_alias-libbfd.a and $target_alias-bfd.h etc. otherwise.
> Case b) is similar to the way we install tools like objdump.

 How about c) use ${prefix} when host == target, otherwise
${prefix}/${target_alias}/${host_alias}?  It seems to work fine for me for
over two years now.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

* Re: bfd.h installation location
  2002-05-15 19:19                                   ` Alexandre Oliva
@ 2002-05-16  6:22                                     ` Maciej W. Rozycki
  2002-05-16 14:45                                       ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: Maciej W. Rozycki @ 2002-05-16  6:22 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: H . J . Lu, binutils

On 15 May 2002, Alexandre Oliva wrote:

> > It doesn't help when --enable-shared is used. I don't mind
> > libbfd-target-version.so myself.
> 
> Hmm...  Good point, we can't just refrain from installing libbfd.la,
> in case it is built as a shared library and other installed programs
> are linked with it.

 RPATH works just fine out of the box:

$ readelf -d /usr/mipsel-linux/bin/ld | head

Dynamic segment at offset 0x47a08 contains 22 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libbfd-2.12.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000f (RPATH)                      Library rpath: [/usr/mipsel-linux/i386-linux/lib]
 0x0000000c (INIT)                       0x8049e40
 0x0000000d (FINI)                       0x80705d0
 0x00000004 (HASH)                       0x8048128
 0x00000005 (STRTAB)                     0x8048f6c

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

* Re: bfd.h installation location
  2002-05-15 22:48                                   ` Alan Modra
@ 2002-05-16  8:36                                     ` H . J . Lu
  0 siblings, 0 replies; 41+ messages in thread
From: H . J . Lu @ 2002-05-16  8:36 UTC (permalink / raw)
  To: binutils

On Thu, May 16, 2002 at 03:18:54PM +0930, Alan Modra wrote:
> On Wed, May 15, 2002 at 05:50:31PM -0700, H . J . Lu wrote:
> > It doesn't help when --enable-shared is used. I don't mind
> > libbfd-target-version.so myself.
> 
> Yes, that would be nice.  Here's the first step towards cleaning
> up libbfd installation, installing libbfd and headers only when
> native or --enable-shared.  I'm not familiar enough with libtool
> to tackle renaming shared libs for the non-native shared case.
> 
> Comments and improvements welcome.  I'll install this in a day or
> so, assuming it's not revised by some libtool guru.
> 

Please try at least 2 cross targets with --enable-shared.


H.J.

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

* Re: bfd.h installation location
  2002-05-16  6:22                                     ` Maciej W. Rozycki
@ 2002-05-16 14:45                                       ` Alexandre Oliva
  2002-05-16 19:28                                         ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-16 14:45 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: H . J . Lu, binutils

On May 16, 2002, "Maciej W. Rozycki" <macro@ds2.pg.gda.pl> wrote:

> On 15 May 2002, Alexandre Oliva wrote:
>> > It doesn't help when --enable-shared is used. I don't mind
>> > libbfd-target-version.so myself.
>> 
>> Hmm...  Good point, we can't just refrain from installing libbfd.la,
>> in case it is built as a shared library and other installed programs
>> are linked with it.

>  RPATH works just fine out of the box:

*If* libbfd.so is installed.  If it wasn't, as I had thought was a
good idea t first, it can't possibly help.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-16 14:45                                       ` Alexandre Oliva
@ 2002-05-16 19:28                                         ` Alan Modra
  2002-05-16 19:45                                           ` Alexandre Oliva
  2002-05-16 19:58                                           ` H . J . Lu
  0 siblings, 2 replies; 41+ messages in thread
From: Alan Modra @ 2002-05-16 19:28 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Maciej W. Rozycki, H . J . Lu, binutils

On Thu, May 16, 2002 at 06:45:02PM -0300, Alexandre Oliva wrote:
> *If* libbfd.so is installed.  If it wasn't, as I had thought was a
> good idea t first, it can't possibly help.

Certainly libbfd.so needs to be installed when --enable-shared.  HJ's
comment alerted me to that wrinkle before I posted my first fix.
Here's a revision of my fix incorporating Maciej's suggestion regarding
install paths.

bfd/ChangeLog
	* acinclude.m4 (AM_INSTALL_LIBBFD): New.
	* configure.in: Invoke AM_INSTALL_LIBBFD.
	* Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
	(install_libbfd): .. New target.
	(uninstall_libbfd): Likewise.
	(install-libLTLIBRARIES): Likewise.
	(uninstall-libLTLIBRARIES): Likewise.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

Index: bfd/acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.5
diff -u -p -r1.5 acinclude.m4
--- bfd/acinclude.m4	31 Aug 2000 09:35:50 -0000	1.5
+++ bfd/acinclude.m4	17 May 2002 02:17:05 -0000
@@ -123,3 +123,27 @@ ifelse(yes,no,[
 AC_DEFUN([CY_WITH_NLS],)
 AC_SUBST(INTLLIBS)
 ])
+
+AC_DEFUN([AM_INSTALL_LIBBFD],
+[AC_MSG_CHECKING([whether to install libbfd])
+  AC_ARG_ENABLE(install-libbfd,
+[  --install-libbfd controls installation of libbfd and related headers],
+      INSTALL_LIBBFD_P=$enableval,
+      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
+        INSTALL_LIBBFD_P=yes
+      else
+        INSTALL_LIBBFD_P=no
+      fi)
+  AC_MSG_RESULT($INSTALL_LIBBFD_P)
+  AM_CONDITIONAL(INSTALL_LIBBFD, test $INSTALL_LIBBFD_P = yes)
+  # libbfd.a is a host library containing target dependent code
+  if test "${host}" != "${target}"; then
+    if test x"${libdir}" = x'${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/${target_alias}/${host_alias}/lib'
+    fi
+    if test x"${includedir}" = x'${prefix}/include'; then
+      includedir='${exec_prefix}/${target_alias}/${host_alias}/include'
+    fi
+  fi
+]
+)
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.94
diff -u -p -r1.94 configure.in
--- bfd/configure.in	13 May 2002 13:33:29 -0000	1.94
+++ bfd/configure.in	17 May 2002 02:17:10 -0000
@@ -98,6 +98,7 @@ if test -z "$target" ; then
 fi
 
 AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
 AC_EXEEXT
 
 host64=false
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.82
diff -u -p -r1.82 Makefile.am
--- bfd/Makefile.am	13 May 2002 00:58:40 -0000	1.82
+++ bfd/Makefile.am	17 May 2002 02:17:04 -0000
@@ -672,14 +672,35 @@ $(BFD32_LIBS) \
  $(BFD64_BACKENDS) \
  $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
 
-# Install BFD include file, and others that it needs.
-install-data-local: $(BFD_H)
+install-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ install_libbfd
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(exec_prefix)/include
-	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(exec_prefix)/include/bfd.h
-	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(exec_prefix)/include/ansidecl.h
-	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(exec_prefix)/include/symcat.h
-	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(exec_prefix)/include/bfdlink.h
+
+uninstall-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ uninstall_libbfd
+	@$(NORMAL_UNINSTALL)
+
+.PHONY: install_libbfd uninstall_libbfd
+install_libbfd: $(lib_LTLIBRARIES) $(BFD_H)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	$(mkinstalldirs) $(DESTDIR)$(includedir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
+	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
+	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
+	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
+	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
+
+uninstall_libbfd:
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+	rm -f $(DESTDIR)$(includedir)/bfd.h
+	rm -f $(DESTDIR)$(includedir)/ansidecl.h
+	rm -f $(DESTDIR)$(includedir)/symcat.h
+	rm -f $(DESTDIR)$(includedir)/bfdlink.h
 
 Makefile: $(srcdir)/configure.in
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-16 19:28                                         ` Alan Modra
@ 2002-05-16 19:45                                           ` Alexandre Oliva
  2002-05-16 20:52                                             ` Alan Modra
  2002-05-16 19:58                                           ` H . J . Lu
  1 sibling, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-16 19:45 UTC (permalink / raw)
  To: Alan Modra; +Cc: Maciej W. Rozycki, H . J . Lu, binutils

Thanks again for looking into this.

On May 16, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> +      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then

Just a nit: $enable_shared = yes is not enough.
--enable-shared=foo,bar,bfd,baz would build a shared libbfd too.

Consider `${CONFIG_SHELL} ${LIBTOOL} --features | grep "enable shared"
> /dev/null' instead.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-16 19:28                                         ` Alan Modra
  2002-05-16 19:45                                           ` Alexandre Oliva
@ 2002-05-16 19:58                                           ` H . J . Lu
  2002-05-16 21:13                                             ` Alan Modra
  1 sibling, 1 reply; 41+ messages in thread
From: H . J . Lu @ 2002-05-16 19:58 UTC (permalink / raw)
  To: Alexandre Oliva, Maciej W. Rozycki, binutils

On Fri, May 17, 2002 at 11:58:09AM +0930, Alan Modra wrote:
> On Thu, May 16, 2002 at 06:45:02PM -0300, Alexandre Oliva wrote:
> > *If* libbfd.so is installed.  If it wasn't, as I had thought was a
> > good idea t first, it can't possibly help.
> 
> Certainly libbfd.so needs to be installed when --enable-shared.  HJ's
> comment alerted me to that wrinkle before I posted my first fix.
> Here's a revision of my fix incorporating Maciej's suggestion regarding
> install paths.

You also need to change libopcodes.so.


H.J.

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

* Re: bfd.h installation location
  2002-05-16 19:45                                           ` Alexandre Oliva
@ 2002-05-16 20:52                                             ` Alan Modra
  2002-05-17  0:24                                               ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-16 20:52 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Maciej W. Rozycki, H . J . Lu, binutils

On Thu, May 16, 2002 at 11:44:46PM -0300, Alexandre Oliva wrote:
> > +      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
> 
> Just a nit: $enable_shared = yes is not enough.
> --enable-shared=foo,bar,bfd,baz would build a shared libbfd too.

Actually, enable_shared has been tested against the package name,
and turned into "yes" or "no" before this check is done.
I fluked it right for once.  ;-)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-16 19:58                                           ` H . J . Lu
@ 2002-05-16 21:13                                             ` Alan Modra
  2002-05-16 21:34                                               ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-16 21:13 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Alexandre Oliva, Maciej W. Rozycki, binutils

On Thu, May 16, 2002 at 07:58:26PM -0700, H . J . Lu wrote:
> You also need to change libopcodes.so.

Thanks for the prod.  :)

opcodes/ChangeLog
	* acinclude.m4 (AM_INSTALL_LIBBFD): Fake to fool autotools.
	* configure.in: Invoke AM_INSTALL_LIBBFD.
	* Makefile.am (install-data-local): Move to..
	(install_libopcodes): .. New target.
	(uninstall_libopcodes): Likewise.
	(install-libLTLIBRARIES): Likewise.
	(uninstall-libLTLIBRARIES): Likewise.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

Index: opcodes/acinclude.m4
===================================================================
RCS file: /cvs/src/src/opcodes/acinclude.m4,v
retrieving revision 1.2
diff -u -p -r1.2 acinclude.m4
--- opcodes/acinclude.m4	31 Aug 2000 09:37:59 -0000	1.2
+++ opcodes/acinclude.m4	17 May 2002 04:08:56 -0000
@@ -15,3 +15,8 @@ ifelse(yes,no,[
 AC_DEFUN([CY_WITH_NLS],)
 AC_SUBST(INTLLIBS)
 ])
+
+dnl AM_INSTALL_LIBBFD already included in bfd/acinclude.m4
+ifelse(yes,no,[
+AC_DEFUN([AM_INSTALL_LIBBFD],)
+])
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.35
diff -u -p -r1.35 configure.in
--- opcodes/configure.in	13 May 2002 15:39:44 -0000	1.35
+++ opcodes/configure.in	17 May 2002 04:09:00 -0000
@@ -71,6 +71,7 @@ if test -z "$target" ; then
 fi
 
 AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
 AC_EXEEXT
 
 # host-specific stuff:
Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile.am
--- opcodes/Makefile.am	4 Apr 2002 14:05:44 -0000	1.47
+++ opcodes/Makefile.am	17 May 2002 04:08:55 -0000
@@ -271,11 +271,29 @@ po/POTFILES.in: @MAINT@ Makefile
 config.status: $(srcdir)/configure $(srcdir)/../bfd/configure.in
 	$(SHELL) ./config.status --recheck
 
-# Install libopcodes include file.
-install-data-local: 
+install-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ install_libopcodes
 	@$(NORMAL_INSTALL)
+
+uninstall-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ uninstall_libopcodes
+	@$(NORMAL_UNINSTALL)
+
+.PHONY: install_libopcodes uninstall_libopcodes
+install_libopcodes: $(lib_LTLIBRARIES)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
 	$(mkinstalldirs) $(DESTDIR)$(includedir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
 	$(INSTALL_DATA) $(INCDIR)/dis-asm.h $(DESTDIR)$(includedir)/dis-asm.h
+
+uninstall_libopcodes:
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+	rm -f $(DESTDIR)$(includedir)/dis-asm.h
 
 CLEANFILES = \
 	stamp-m32r stamp-fr30 stamp-openrisc \


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-16 21:13                                             ` Alan Modra
@ 2002-05-16 21:34                                               ` Alan Modra
  2002-05-17  0:29                                                 ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-16 21:34 UTC (permalink / raw)
  To: H . J . Lu, Alexandre Oliva, Maciej W. Rozycki, binutils

Oh woe!  This all works ok when make is run in bfd/ and opcodes/,
but the toplevel Makefile passes $libdir and $includedir down
to subdirs.

"override VAR = VALUE" isn't sufficiently portable, is it?  I
suppose that means hacking the toplevel Makefile.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-16 20:52                                             ` Alan Modra
@ 2002-05-17  0:24                                               ` Alexandre Oliva
  0 siblings, 0 replies; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-17  0:24 UTC (permalink / raw)
  To: Alan Modra; +Cc: Maciej W. Rozycki, H . J . Lu, binutils

On May 17, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> On Thu, May 16, 2002 at 11:44:46PM -0300, Alexandre Oliva wrote:
>> > +      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
>> 
>> Just a nit: $enable_shared = yes is not enough.
>> --enable-shared=foo,bar,bfd,baz would build a shared libbfd too.

> Actually, enable_shared has been tested against the package name,
> and turned into "yes" or "no" before this check is done.
> I fluked it right for once.  ;-)

:-)

I stand corrected.  Thanks for checking.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-16 21:34                                               ` Alan Modra
@ 2002-05-17  0:29                                                 ` Alexandre Oliva
  2002-05-17  2:46                                                   ` Alan Modra
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-17  0:29 UTC (permalink / raw)
  To: Alan Modra; +Cc: H . J . Lu, Maciej W. Rozycki, binutils

On May 17, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> Oh woe!  This all works ok when make is run in bfd/ and opcodes/,
> but the toplevel Makefile passes $libdir and $includedir down
> to subdirs.

Ouch!  I had missed the fact that you were tweaking libdir and
includedir :-(

> "override VAR = VALUE" isn't sufficiently portable, is it?  I
> suppose that means hacking the toplevel Makefile.

Better set and AC_SUBST bfdlibdir and bfdincludedir in
AM_INSTALL_LIBBFD, then change include_HEADERS (if used at all) and
lib_LTLIBRARIES to bfdinclude_HEADERS and bfdlib_LTLIBRARIES.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-17  0:29                                                 ` Alexandre Oliva
@ 2002-05-17  2:46                                                   ` Alan Modra
  2002-05-18 22:47                                                     ` Alexandre Oliva
  0 siblings, 1 reply; 41+ messages in thread
From: Alan Modra @ 2002-05-17  2:46 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: H . J . Lu, Maciej W. Rozycki, binutils

On Fri, May 17, 2002 at 04:28:41AM -0300, Alexandre Oliva wrote:
> 
> Better set and AC_SUBST bfdlibdir and bfdincludedir in
> AM_INSTALL_LIBBFD, then change include_HEADERS (if used at all) and
> lib_LTLIBRARIES to bfdinclude_HEADERS and bfdlib_LTLIBRARIES.

This seems to work OK.  Besides implementing your suggestion, I've
changed the non-native install location from that in the last patch
$(exec_prefix)/$(target_alias)/$(host_alias)/{lib,include} to
$(exec_prefix)/$(host_alias)/$(target_alias)/{lib,include} as that
seems more natural to me.  $(exec_prefix)/blah has libs for blah in
it..

bfd/ChangeLog
	* acinclude.m4 (AM_INSTALL_LIBBFD): New.
	* configure.in: Invoke AM_INSTALL_LIBBFD.
	* Makefile.am (install-data-local): Revert 2002-05-13.  Move to..
	(install_libbfd): .. New target.
	(uninstall_libbfd): Likewise.
	(install-bfdlibLTLIBRARIES): Likewise.
	(uninstall-bfdlibLTLIBRARIES): Likewise.
	(bfdlibdir): New.
	(bfdincludedir): New.
	(lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

opcodes/ChangeLog
	* acinclude.m4 (AM_INSTALL_LIBBFD): Fake to fool autotools.
	* configure.in: Invoke AM_INSTALL_LIBBFD.
	* Makefile.am (install-data-local): Move to..
	(install_libopcodes): .. New target.
	(uninstall_libopcodes): Likewise.
	(install-bfdlibLTLIBRARIES): Likewise.
	(uninstall-bfdlibLTLIBRARIES): Likewise.
	(bfdlibdir): New.
	(bfdincludedir): New.
	(lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.

Index: bfd/acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.5
diff -u -p -r1.5 acinclude.m4
--- bfd/acinclude.m4	31 Aug 2000 09:35:50 -0000	1.5
+++ bfd/acinclude.m4	17 May 2002 08:50:20 -0000
@@ -123,3 +123,27 @@ ifelse(yes,no,[
 AC_DEFUN([CY_WITH_NLS],)
 AC_SUBST(INTLLIBS)
 ])
+
+AC_DEFUN([AM_INSTALL_LIBBFD],
+[AC_MSG_CHECKING([whether to install libbfd])
+  AC_ARG_ENABLE(install-libbfd,
+[  --install-libbfd controls installation of libbfd and related headers],
+      install_libbfd_p=$enableval,
+      if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
+        install_libbfd_p=yes
+      else
+        install_libbfd_p=no
+      fi)
+  AC_MSG_RESULT($install_libbfd_p)
+  AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
+  # libbfd.a is a host library containing target dependent code
+  bfdlibdir='$(libdir)'
+  bfdincludedir='$(includedir)'
+  if test "${host}" != "${target}"; then
+    bfdlibdir='$(exec_prefix)/$(host_alias)/$(target_alias)/lib'
+    bfdincludedir='$(exec_prefix)/$(host_alias)/$(target_alias)/include'
+  fi
+  AC_SUBST(bfdlibdir)
+  AC_SUBST(bfdincludedir)
+]
+)
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.94
diff -u -p -r1.94 configure.in
--- bfd/configure.in	13 May 2002 13:33:29 -0000	1.94
+++ bfd/configure.in	17 May 2002 08:50:25 -0000
@@ -98,6 +98,7 @@ if test -z "$target" ; then
 fi
 
 AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
 AC_EXEEXT
 
 host64=false
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.82
diff -u -p -r1.82 Makefile.am
--- bfd/Makefile.am	13 May 2002 00:58:40 -0000	1.82
+++ bfd/Makefile.am	17 May 2002 08:50:18 -0000
@@ -9,8 +9,10 @@ MKDEP = gcc -MM
 SUBDIRS = doc po
 
 docdir = doc
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
 
-lib_LTLIBRARIES = libbfd.la
+bfdlib_LTLIBRARIES = libbfd.la
 
 WARN_CFLAGS = @WARN_CFLAGS@
 AM_CFLAGS = $(WARN_CFLAGS)
@@ -672,14 +674,35 @@ $(BFD32_LIBS) \
  $(BFD64_BACKENDS) \
  $(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
 
-# Install BFD include file, and others that it needs.
-install-data-local: $(BFD_H)
+install-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@install_libbfd
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(exec_prefix)/include
-	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(exec_prefix)/include/bfd.h
-	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(exec_prefix)/include/ansidecl.h
-	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(exec_prefix)/include/symcat.h
-	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(exec_prefix)/include/bfdlink.h
+
+uninstall-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@uninstall_libbfd
+	@$(NORMAL_UNINSTALL)
+
+.PHONY: install_libbfd uninstall_libbfd
+install_libbfd: $(bfdlib_LTLIBRARIES) $(BFD_H)
+	$(mkinstalldirs) $(DESTDIR)$(bfdlibdir)
+	$(mkinstalldirs) $(DESTDIR)$(bfdincludedir)
+	@list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(bfdlibdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(bfdlibdir)/$$p; \
+	  else :; fi; \
+	done
+	$(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(bfdincludedir)/bfd.h
+	$(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(bfdincludedir)/ansidecl.h
+	$(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(bfdincludedir)/symcat.h
+	$(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(bfdincludedir)/bfdlink.h
+
+uninstall_libbfd:
+	list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(bfdlibdir)/$$p; \
+	done
+	rm -f $(DESTDIR)$(bfdincludedir)/bfd.h
+	rm -f $(DESTDIR)$(bfdincludedir)/ansidecl.h
+	rm -f $(DESTDIR)$(bfdincludedir)/symcat.h
+	rm -f $(DESTDIR)$(bfdincludedir)/bfdlink.h
 
 Makefile: $(srcdir)/configure.in
 
Index: opcodes/acinclude.m4
===================================================================
RCS file: /cvs/src/src/opcodes/acinclude.m4,v
retrieving revision 1.2
diff -u -p -r1.2 acinclude.m4
--- opcodes/acinclude.m4	31 Aug 2000 09:37:59 -0000	1.2
+++ opcodes/acinclude.m4	17 May 2002 08:50:32 -0000
@@ -15,3 +15,10 @@ ifelse(yes,no,[
 AC_DEFUN([CY_WITH_NLS],)
 AC_SUBST(INTLLIBS)
 ])
+
+dnl AM_INSTALL_LIBBFD already included in bfd/acinclude.m4
+ifelse(yes,no,[
+AC_DEFUN([AM_INSTALL_LIBBFD],)
+AC_SUBST(bfdlibdir)
+AC_SUBST(bfdincludedir)
+])
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.35
diff -u -p -r1.35 configure.in
--- opcodes/configure.in	13 May 2002 15:39:44 -0000	1.35
+++ opcodes/configure.in	17 May 2002 08:50:35 -0000
@@ -71,6 +71,7 @@ if test -z "$target" ; then
 fi
 
 AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
 AC_EXEEXT
 
 # host-specific stuff:
Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile.am
--- opcodes/Makefile.am	4 Apr 2002 14:05:44 -0000	1.47
+++ opcodes/Makefile.am	17 May 2002 08:50:32 -0000
@@ -11,7 +11,10 @@ MKDEP = gcc -MM
 WARN_CFLAGS = @WARN_CFLAGS@
 AM_CFLAGS = $(WARN_CFLAGS)
 
-lib_LTLIBRARIES = libopcodes.la
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
+
+bfdlib_LTLIBRARIES = libopcodes.la
 
 # This is where bfd.h lives.
 BFD_H = ../bfd/bfd.h
@@ -271,11 +274,29 @@ po/POTFILES.in: @MAINT@ Makefile
 config.status: $(srcdir)/configure $(srcdir)/../bfd/configure.in
 	$(SHELL) ./config.status --recheck
 
-# Install libopcodes include file.
-install-data-local: 
+install-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@install_libopcodes
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(includedir)
-	$(INSTALL_DATA) $(INCDIR)/dis-asm.h $(DESTDIR)$(includedir)/dis-asm.h
+
+uninstall-bfdlibLTLIBRARIES: @INSTALL_LIBBFD_TRUE@uninstall_libopcodes
+	@$(NORMAL_UNINSTALL)
+
+.PHONY: install_libopcodes uninstall_libopcodes
+install_libopcodes: $(bfdlib_LTLIBRARIES)
+	$(mkinstalldirs) $(DESTDIR)$(bfdlibdir)
+	$(mkinstalldirs) $(DESTDIR)$(bfdincludedir)
+	@list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(bfdlibdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(bfdlibdir)/$$p; \
+	  else :; fi; \
+	done
+	$(INSTALL_DATA) $(INCDIR)/dis-asm.h $(DESTDIR)$(bfdincludedir)/dis-asm.h
+
+uninstall_libopcodes:
+	list='$(bfdlib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(bfdlibdir)/$$p; \
+	done
+	rm -f $(DESTDIR)$(bfdincludedir)/dis-asm.h
 
 CLEANFILES = \
 	stamp-m32r stamp-fr30 stamp-openrisc \


-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: bfd.h installation location
  2002-05-17  2:46                                                   ` Alan Modra
@ 2002-05-18 22:47                                                     ` Alexandre Oliva
  2002-05-20  3:35                                                       ` Maciej W. Rozycki
  0 siblings, 1 reply; 41+ messages in thread
From: Alexandre Oliva @ 2002-05-18 22:47 UTC (permalink / raw)
  To: Alan Modra; +Cc: H . J . Lu, Maciej W. Rozycki, binutils

On May 17, 2002, Alan Modra <amodra@bigpond.net.au> wrote:

> This seems to work OK.  Besides implementing your suggestion, I've
> changed the non-native install location from that in the last patch
> $(exec_prefix)/$(target_alias)/$(host_alias)/{lib,include} to
> $(exec_prefix)/$(host_alias)/$(target_alias)/{lib,include} as that
> seems more natural to me.  $(exec_prefix)/blah has libs for blah in
> it..

Thanks, that makes sense.  I find it a bit confusing because
exec_prefix already carries the host type with it, either implicitly
(in that you shouldn't use the same exec-prefix for different host
types) or explicitly (in our builds,
--exec-prefix=${prefix}/H-${host_alias}), but your new implementation
definitely makes more sense than the earlier version.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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

* Re: bfd.h installation location
  2002-05-18 22:47                                                     ` Alexandre Oliva
@ 2002-05-20  3:35                                                       ` Maciej W. Rozycki
  0 siblings, 0 replies; 41+ messages in thread
From: Maciej W. Rozycki @ 2002-05-20  3:35 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Alan Modra, H . J . Lu, binutils

On 19 May 2002, Alexandre Oliva wrote:

> > This seems to work OK.  Besides implementing your suggestion, I've
> > changed the non-native install location from that in the last patch
> > $(exec_prefix)/$(target_alias)/$(host_alias)/{lib,include} to
> > $(exec_prefix)/$(host_alias)/$(target_alias)/{lib,include} as that
> > seems more natural to me.  $(exec_prefix)/blah has libs for blah in
> > it..
> 
> Thanks, that makes sense.  I find it a bit confusing because
> exec_prefix already carries the host type with it, either implicitly
> (in that you shouldn't use the same exec-prefix for different host
> types) or explicitly (in our builds,

 You have $(exec_prefix)/$(host_alias) for $(tooldir) anyway, even though
$(host_alias) is somehow implied. 

> --exec-prefix=${prefix}/H-${host_alias}), but your new implementation
> definitely makes more sense than the earlier version.

 I wouldn't tell it makes more sense either way.  For the former approach,
you get all target-related objects grouped below
$(exec_prefix)/$(target_alias).  For the latter -- you get host-related
objects below $(exec_prefix)/$(host_alias).  The difference is marginal. 
I chose the former one as it makes cross-binutils files more tightly
grouped. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

end of thread, other threads:[~2002-05-20 10:35 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-10 17:15 bfd.h installation location Brendan Conoboy
2002-05-11  0:59 ` Alan Modra
2002-05-11  1:04   ` Alexandre Oliva
2002-05-11  6:54   ` M. R. Brown
2002-05-11  9:58     ` H . J . Lu
2002-05-11 12:47       ` Alexandre Oliva
2002-05-12 17:57         ` Alan Modra
2002-05-12 22:18           ` Alexandre Oliva
2002-05-12 23:02             ` Alan Modra
2002-05-12 23:20               ` H . J . Lu
2002-05-12 23:46               ` Alexandre Oliva
2002-05-13  0:13                 ` H . J . Lu
2002-05-13  1:44                   ` Alexandre Oliva
2002-05-14 23:53                     ` Alan Modra
2002-05-15  1:26                       ` Alexandre Oliva
2002-05-15  8:52                         ` H . J . Lu
2002-05-15 14:56                           ` Alan Modra
2002-05-15 16:54                             ` H . J . Lu
2002-05-15 17:15                               ` Alan Modra
2002-05-15 17:50                                 ` H . J . Lu
2002-05-15 19:19                                   ` Alexandre Oliva
2002-05-16  6:22                                     ` Maciej W. Rozycki
2002-05-16 14:45                                       ` Alexandre Oliva
2002-05-16 19:28                                         ` Alan Modra
2002-05-16 19:45                                           ` Alexandre Oliva
2002-05-16 20:52                                             ` Alan Modra
2002-05-17  0:24                                               ` Alexandre Oliva
2002-05-16 19:58                                           ` H . J . Lu
2002-05-16 21:13                                             ` Alan Modra
2002-05-16 21:34                                               ` Alan Modra
2002-05-17  0:29                                                 ` Alexandre Oliva
2002-05-17  2:46                                                   ` Alan Modra
2002-05-18 22:47                                                     ` Alexandre Oliva
2002-05-20  3:35                                                       ` Maciej W. Rozycki
2002-05-15 22:48                                   ` Alan Modra
2002-05-16  8:36                                     ` H . J . Lu
2002-05-15  8:58                       ` H . J . Lu
2002-05-15  9:23                         ` Andrew Cagney
2002-05-15  9:39                           ` H . J . Lu
2002-05-16  6:18                       ` Maciej W. Rozycki
2002-05-11  9:50   ` H . J . Lu

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