automake
[Top][All Lists]
Advanced

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

Re: separating source and install name


From: Ralf Wildenhues
Subject: Re: separating source and install name
Date: Fri, 11 May 2007 17:09:18 +0200
User-agent: Mutt/1.5.15 (2007-05-02)

Hello Perrog,

* Perrog wrote on Fri, May 11, 2007 at 10:36:10AM CEST:
>
> In cases when you make a debug build, or static build, or some other
> architecture build, it may be desirable to rename the installed library. 
> For example, libA_d is the debug version of libA. But this also has
> another aspect... if we build libB_d, it may want to use libA_d, not
> libA.

The easiest way to achieve that with all libraries built by autotools is
to simply use separate (exec_)prefixes for the different sets of
libraries.  If you want to get fancy, you can share data.

That also helps do without changes to packages down the chain (that use
your libraries).  Instead of treating the package with changes like
  s/libB/libB_d/g; s/-lB/-lB_d/g 

all you do is use
  ./configure CPPFLAGS=-I/opt/debug/include LDFLAGS=-L/opt/debug/lib \
     --prefix=/opt/debug

and have fun.  It also scales better to do separation this way.

> I'v observed you may now (gcc 4.0) give linker the "path/to/library.a" or
> "path/to/library.dylib", instead of using "-Lpath/to" and "-lrary" pair.  I
> suppose this is the "right way" to link against specific library, instead 
> of fiddling around with the library's name.

I'd be quite surprised to hear that this were a new thing.  This should
have been possible for a long time.  Using `-Lpath/to -lrary' is more
portable, though.

Cheers,
Ralf




reply via email to

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