Re: rpath command?
In message <[EMAIL PROTECTED]>, Alexandre Oliva writes: >[linking a library from other libraries with no object files] > >The point is that this just can't be done portably. Since libtool's major purpose is to allow libraries to be built using a portable interface, perhaps it should take care of this for the developer? So on platforms where this doesn't work, perhaps libtool should add a dummy file implicitly, rather than the developer having to implement the bodge themselves? >(ii) automake wouldn't know which compiler/linker to use for the >library you're creating. Specifying one or more source files is >supposed to give automake a clue on which languages are being used in >the sub-libraries. This would be an obstacle to libtool creating the bodge file, but the .la file could be extended to contain information about languages used in a libtool library. Cheers, Olly
Re: rpath command?
On Nov 27, 2000, Steve Robbins <[EMAIL PROTECTED]> wrote: > What I would like to do is: > lib_LTLIBRARIES = libfoo.la > libfoo_la_LIBADD = \ > $(top_builddir)/a/adummy.la \ > $(top_builddir)/b/bdummy.la \ > $(top_builddir)/c/cdummy.la \ > $(top_builddir)/d/ddummy.la The point is that this just can't be done portably. You need at least one object file, for two reasons: (i) libtool may fail if you link only libtool archives into another libtool archive (ii) automake wouldn't know which compiler/linker to use for the library you're creating. Specifying one or more source files is supposed to give automake a clue on which languages are being used in the sub-libraries. > Is it impossible to support building libraries out of ONLY other > libraries? Yes. It isn't portable. Some linkers just fail. -- 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-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
Re: rpath command?
On 27 Nov 2000, Alexandre Oliva wrote: > On Nov 25, 2000, Tom Tromey <[EMAIL PROTECTED]> wrote: > > >>> Do I have to use some macro in configure.in to fill $(LINK) with GNU ld? > Alexandre> automake should define it to `$(LIBTOOL) $(CC/CXX)...'. > Alexandre> Maybe it only does this when there is at least one source > Alexandre> file to compile in the current directory? > > > Yeah, that's how it works. I realize this is less than good. Can you > > suggest how it ought to work? > > I think the current behavior is fine, since it is indeed invalid to > create a library or libtool archive out of no source files. However, > we might output a warning (or even an error) if we find a request to > create a library out of no source files. I'm not so sure about this. Unless the CVS versions of the tools have changed things, the current behaviour makes it impossible to create a library consisting only of sources in subdirectories. What I would like to do is: lib_LTLIBRARIES = libfoo.la libfoo_la_LIBADD = \ $(top_builddir)/a/adummy.la \ $(top_builddir)/b/bdummy.la \ $(top_builddir)/c/cdummy.la \ $(top_builddir)/d/ddummy.la but this fails, so I generally add: libfoo_la_SOURCES = dummy.c dummy.c: touch dummy.c To me, the last bit seems like a workaround for a bug. Is it impossible to support building libraries out of ONLY other libraries? -S
Re: rpath command?
> > Yeah, that's how it works. I realize this is less than good. Can you > > suggest how it ought to work? > > I think the current behavior is fine, since it is indeed invalid to > create a library or libtool archive out of no source files. However, > we might output a warning (or even an error) if we find a request to > create a library out of no source files. It should be made clear, if it is a bug or a feature. And a sentence or two in the .info documentation about this situation would be welcome too - just to prevent that one wastes time trying to achieve something that is not supposed to work that way. Regards, Marc
Re: rpath command?
On Nov 25, 2000, Tom Tromey <[EMAIL PROTECTED]> wrote: >>> Do I have to use some macro in configure.in to fill $(LINK) with GNU ld? Alexandre> automake should define it to `$(LIBTOOL) $(CC/CXX)...'. Alexandre> Maybe it only does this when there is at least one source Alexandre> file to compile in the current directory? > Yeah, that's how it works. I realize this is less than good. Can you > suggest how it ought to work? I think the current behavior is fine, since it is indeed invalid to create a library or libtool archive out of no source files. However, we might output a warning (or even an error) if we find a request to create a library out of no source files. -- 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-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
Re: rpath command?
>> Do I have to use some macro in configure.in to fill $(LINK) with GNU ld? Alexandre> automake should define it to `$(LIBTOOL) $(CC/CXX)...'. Alexandre> Maybe it only does this when there is at least one source Alexandre> file to compile in the current directory? Yeah, that's how it works. I realize this is less than good. Can you suggest how it ought to work? Tom
Re: rpath command?
On Nov 22, 2000, Marc van Woerkom <[EMAIL PROTECTED]> wrote: >> automake should define it to `$(LIBTOOL) $(CC/CXX)...'. Maybe it only >> does this when there is at least one source file to compile in the >> current directory? > Bingo! > Makefile.am: > libSciFacBase_la_SOURCES = \ >buildme.c And you'd be surprised at the number of problems you'd encounter if you didn't link at least one object file into a library. > buildme.c: > /* void do_really_nothing_useful() { } */ This is not a valid C program. A C program must contain at least one valid declaration. Try something like `static int i;' -- 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-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me
Re: rpath command?
> automake should define it to `$(LIBTOOL) $(CC/CXX)...'. Maybe it only > does this when there is at least one source file to compile in the > current directory? Bingo! After introducing this additions Makefile.am: libSciFacBase_la_SOURCES = \ buildme.c buildme.c: /* void do_really_nothing_useful() { } */ it works. Bizarre, I can't believe it. :-) This project now features a source tree with customizable modules, handles module dependencies, builds in separate build tree, installs in seperate build tree.. [mvw@pcserver scifac.build]$ ../scifac/configure --prefix=/home/mvw/work/scifac.install --without-Dataserver --without-Dataserver2 --without-Dataserver3 .. and stumbles over an empty _SOURCES list. ROTFL. Thanks for your remark, Alexandre! Marc
Re: rpath command?
On Nov 22, 2000, Marc van Woerkom <[EMAIL PROTECTED]> wrote: > Do I have to use some macro in configure.in to fill $(LINK) with GNU ld? automake should define it to `$(LIBTOOL) $(CC/CXX)...'. Maybe it only does this when there is at least one source file to compile in the current directory? -- 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-Unicampoliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist*Please* write to mailing lists, not to me