automake
[Top][All Lists]
Advanced

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

Re: The automake/libtool way to make a dynamic lib from multiple sources


From: Ryan McDougall
Subject: Re: The automake/libtool way to make a dynamic lib from multiple sources
Date: Mon, 02 Oct 2006 10:26:46 +0900

On Thu, 2006-09-28 at 13:06 +0200, Ralf Wildenhues wrote:
> Hello Ryan,
> 
> * Ryan McDougall wrote on Thu, Sep 28, 2006 at 11:30:32AM CEST:
> > On Thu, 2006-09-28 at 18:23 +0900, Ryan McDougall wrote:
> > > 
> > > How can I either
> > > 1. Express to automake the correct dependancy
> 
> By writing
>   libA_la_LIBADD = libfoo.la
> 
> instead of
>   libA_la_LIBADD = -L. -lfoo
>  
> > I just discovered that I can trick automake with this:
> > 
> > zardir=/dev/null
> > zar_LTLIBRARIES=libfoo.la
> > lib_LTLIBRARIES=libA.la
> > 
> > and this will allow libfoo to be built before libA, however this is sort
> > of trickery is bound to bite me in the ass somewhere, right?
> 
> That is wrong, as it causes libfoo to not be a convenience archive, but
> a real, installable library.  It's doomed to failure, as the installed
> libA may depend on it being present.
> 
> Cheers,
> Ralf
> 

Cheers, everything works as I need it to to get the basic build up!

Thanks for all your help Ralf!

For the sake of those that google after me, here is my solution:
In the directory containing the target library directories, and the
dependent library directories I have the following Makefile.am

AUTOMAKE_OPTIONS = subdir-objects

noinst_LTLIBRARIES =
lib_LTLIBRARIES =

include libfoo/Makefile.am
include libbar/Makefile.am
include libA/Makefile.am

within the dependent library directories I have the following
Makefile.am

noinst_LTLIBRARIES += libfoo.la
libfoo_la_CPPFLAGS = -Ilibfoo/include
libfoo_la_SOURCES = libfoo/src/libfoo.cpp

within the target library directories I have the following Makefile.am

lib_LTLIBRARIES += libA.la
libA_la_LIBADD = libfoo.la
libA_la_CPPFLAGS = -DIMPORTANT_COMPILE_TIME_SWITCHES \
                     -IlibA/include \
                     -Ilibfoo/include
libA_la_SOURCES = libA/src/libA.cpp





reply via email to

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