[Top][All Lists]

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

Re: -DPIC - redundant?

From: Ralf Corsepius
Subject: Re: -DPIC - redundant?
Date: Thu, 27 Jan 2005 08:28:40 +0100

On Wed, 2005-01-26 at 08:21 -0600, Bob Friesenhahn wrote:
> On Wed, 26 Jan 2005, Gary V. Vaughan wrote:
> > Kevin F. Quinn wrote:
> >> Apologies if this is a stupid question, but please could someone 
> >> explain to me why libtool sets '-DPIC' for shared libraries, while 
> >> gcc reliably defines '__PIC__' when it generates PIC code? 
> >> Setting '-DPIC' encourages people to do '#ifdef PIC' when surely 
> >> '#ifdef __PIC__' would be more reliable.
> >
> > Libtool supports plenty more compilers than just gcc.
> I recall from discussions a couple of years ago that this define is 
> even used from within some Fortran code.
IIRC, -DPIC predates -D__PIC__.

So I'd guess older code had used "#ifdef PIC", while __PIC__ has been to
add to gcc. I don't know how other compilers handle this issue.


reply via email to

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