libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regarding convenience libraries as aliases for objects


From: Ed Sweetman
Subject: Regarding convenience libraries as aliases for objects
Date: Fri, 25 May 2007 19:49:54 -0400
User-agent: Icedove 1.5.0.10 (X11/20070328)

In the various tutorials and documentation I've read, convenience libraries are said to be like aliases for object files that can be generated to either static or shared libs. I want to use that idea literally.

My project has multiple targets that share various groups of source files. The source files are currently compiled as libtool libraries (static) and are not to be installed with the program. My intention was to use libtool to alias the object files and then link them directly (as if it was a .a) rather than pointlessly generating the .a and then linking. Mostly this is done to save space and time, since the "libs" are just a way to get around compiling duplicate copies of the objects for each bin_PROGRAM target. Of course, creating a .a duplicates the space, thus nullifying that half of the benefit for using libs during compilation.

I really dont see why libtool generates .a files when they're not going to be installed. Since libtool knows the list of objects related to a ".a" lib, the generation of the .a is a waste of disk space and time. Is it possible to have my makefile retrieve a list of the objects in a given libtool library so that i can just use that variable in the LDADD of the target? Or is there a way to tell libtool to link a .la such that it directly links the .o's associated with it directly to the executable and skips the intermediate and useless generation of the .a file?


my makefile.am generally looks like this:

mylib_la_SOURCES = \
   lots of sources

mylib2_la_SOURCES = \
   lots of sources

mylib3_la_LIBADD = \
   mylib2.la
mylib3_la_SOURCES = \
   lots of sources

bin_PROGRAMS = \
   program1 \
   program2

noinst_LTLIBRARIES = \
   mylib.la \
   mylib2.la \
   mylib3.la

program1_LDADD = \
   mylib1.la \
   mylib3.la

program1_DEPENDENCIES = \
   mylib1.la \
   mylib3.la

program2_LDADD = \
   mylib1.la \
   mylib2.la

program2_DEPENDENCIES = \
   mylib1.la \
   mylib2.la








reply via email to

[Prev in Thread] Current Thread [Next in Thread]