This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Partially Linked Objects


On Tue, 18 May 1999, Olly Betts wrote:

> Hmm - I've just been trying to use libtool to do the partial link for me,
> but I can't get this to work from within automake.
> 
You are trying too hard.

> Here's my best attempt at a Makefile.am:
> 
> ===========================================================================
>
Try this:
noinst_LTLIBRARIES = liball.la

> all_o_SOURCES = a.cc b.cc
> 
Change to:
liball_la_SOURCES = a.cc b.cc

Warning: Libtool does not currently fully support C++, but it should be
forth comming.

> all.o: $(all_o_SOURCES)
> 	$(LIBTOOL) --mode=link ln -o $@ $(all_o_OBJECTS)
> 
> noinst_LTLIBRARIES = libtest.la
> 
> libtest_la_LIBADD = all.o
> libtest_la_SOURCES =
>
Get rid of all this and use liball.la as you would all.o.  You might be
able to build all.o instead of liball.la, but I'm not sure if that is
valid.  You could try it.

> ===========================================================================
> 
> This doesn't work - I get:
> 
> lib/Makefile.am:1: invalid unused variable name: `all_o_SOURCES'
>
all_o was not declared to be built. (In one of _PROGRAMS, _LIBRARIES,
etc.)
 
> And the Makefile.in doesn't set all_o_OBJECTS.
> 
Same problem.

> (I probably should be using all.lo, but I get the same problem with that
> too).
> 
all.la is more accurate, all.lo would just be a PIC compiled object file,
generally of a single .c file, more or less.

> The other approach I can see is to get automake to tell libtool to do the
> link, but automake moans if the library name doesn't end "la" so I can't
> say:
> 
> noinst_LTLIBRARIES = all.lo
> 
Ok, so right now you can't say all.lo or all.o here, but why do you need
to.  all.la should work fine, it is just a name that you need to be used
to and understand.

> Is there some way to achieve this, or is this a feature of libtool that
> can't easily be used from automake?  Would this work if we just relaxed the
> check in automake to allow .lo as well as .la?
>
I think this has been done in the current development versions.

> Hmm, actually there's a small bug there in the automake code here (looking
> at automake 1.4):
> 
> 1680:           $libname_rx = "^lib.*\.la";
> 1684:           $libname_rx = "\.la";
> 
> The problem here is that the backslashes will be treated as escapes in the
> double-quoted string and will effectively disappear.  This needs to be:
> 
> 1680:           $libname_rx = "^lib.*\\.la";
> 1684:           $libname_rx = "\\.la";
> 
> Hopefully that's clear - I can send a full patch if you prefer.
> 
I don't know for sure about this.

> Cheers,
> Olly
> 

--
Brian Ford
Software Engineer
Vital Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]