[Top][All Lists]

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

Re: Individual install targets with libtool

From: Marc Rossi
Subject: Re: Individual install targets with libtool
Date: Fri, 16 Sep 2005 07:29:34 -0700 (PDT)

Thanks for the reply Ralf.  Let me see if I can
explain my reasoning for this request clearly.

I have a utility library I build with libtool called  In its base form it has no external
dependencies and can be used on any of my machines.  I
also build, from the same, an "enhanced"
version of this library that uses the same codebase
but enables some features that are dependent on an
external library (I enable these using
libutil2_la_CXXFLAGS defines).  

This external library does NOT exist on all machines,
so a 'make install' on those machines will fail as it
attempts to build & install ALL targets.

With my current setup, I have to hack the
prior to doing my 'make install'.   With my current
setup, you can choose which one to build when doing a
make (such as 'make'), but you cannot
choose which to install, it's all or nothing.

Thanks again for the help, I'm open to any alternative
suggestions you might have.

--- Ralf Wildenhues <address@hidden> wrote:

> Hi Marc,
> * Marc Rossi wrote on Thu, Sep 15, 2005 at
> 05:50:47PM CEST:
> > I have a Makefile with multiple libtool targets:
> > 
> > lib_LTLIBRARIES = libx.a liby.a libz.a
> (By the way, LTLIBRARIES are supposed to end with
> .la.  See the
> documentation.)
> > I would like to do a make install for a liby.a
> ONLY. 
> > When I look through the generated Makefile I only
> see
> > the ability to make install all 3 at once.
> I'm not quite sure what you want to achieve, so I'll
> give a couple of
> hints:
> If you are developing a package and want to allow
> the user to install
> only a subset of the libraries built, which she
> chooses at configure
> time, you could use Automake conditionals, like:
> # in something like (after making sure
> libx_wanted
> # is somehow set to something sensible)
> AM_CONDITIONAL([WANT_LIBX], [test "$libx_wanted" =
> true])
> # in 
> endif
> If instead you insist on `make install' time choice,
> you could work
> around the limitation somehow like this:
> libydir = $(libdir)
> libzdir = $(libdir)
> This approach does not scale very well, and I you
> might have to tweak
> the order they are given for `make install' to
> install them in the
> correct order (given they depend upon each other). 
> Oh, I forgot: you
> may install each of them now by using an
> undocumented feature of
> Automake: it will produce different targets for each
> of the directories.
> (Can't remember the exact name, so I'm not writing
> it here, it's
> an implementation detail anyway; will
> show you :)
> But I have a much more general question: why do you
> want to do this
> anyway?  The answer might lead to a much better
> solution for your actual
> problem.
> Cheers,
> Ralf

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

reply via email to

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