libtool
[Top][All Lists]
Advanced

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

Re: Separate CPPFLAGS for static and shared libs


From: Ralf Wildenhues
Subject: Re: Separate CPPFLAGS for static and shared libs
Date: Wed, 4 Jun 2008 19:52:54 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* Vikram Ambrose wrote on Wed, Jun 04, 2008 at 03:54:35PM CEST:
>
> However I need to pass separate CPPFLAGS to the objects destined for the  
> shared library as opposed to the objects destined for the library 
> archive.

As Andreas already replied, just use "#ifdef PIC" for shared and
"#ifndef PIC" for static code.  That usually works.

However.  If you use convenience archives, then be warned that they
by default contain PIC code only, and will happily add that to a static
library as well.

> But for some odd reason, whenever "make install", is  
> invoked, libfile.so is recompiled again (including all the individual  
> objects). Which is a little redundant but harmless nonetheless.

Yes, libtool isn't always strict enough in determining when relinking is
needed.  Generally you can use --enable-fast-install resp.
--disable-fast-install to prefer relinking at install time or at the
first time an uninstalled program is executed.

Cheers,
Ralf




reply via email to

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