Chosing the C and C++ compilers

Akim Demaille akim at lrde.epita.fr
Thu Nov 6 11:21:08 PST 2008


Le 6 nov. 08 à 18:44, Anders F Björklund a écrit :

> Akim Demaille wrote:

Hi Anders,

>> Thank you, but there seems to be some misunderstanding here: I am  
>> not asking for help on how I should talk to GCC, but rather how I  
>> should tell macports to use the compiler in a more useful way.  I  
>> do think that rather than leaving gcc-4.0 what's to be done,  
>> macports should use its knowledge about the variants asked by the  
>> user to decide what flags to pass to the compiler, in which case  
>> distcc comes for free.
>
> Just meant that those are rather straightforwardly mapped from  
> configure.march and configure.mtune along with configure.m32 and  
> configure.m64 to make up the configure.cflags, and the settings for  
> configure.universal_archs (when cross-compiling)
>
> "GNU style" cross-compiling uses host-prefixed binaries, where as  
> "Mac style" cross-compiling normally just uses -arch... or Xcode :-)

I'm a bit confused here.  I understand from your answer that the ports  
should pass arch specific flags to the compiler.  But apparently it  
does not.

And the variables you mention are for portfiles, right?  They're not  
meant for the end user.

>> That would be the ideal.
>>
>> Meanwhile, I'm asking how I can educate macports to stop using a  
>> hard coded path for gcc and let *me* do what I know I want to do.
>
> I assume it's reasonable to expect being able to set configure. 
> {cc,cxx} from the configuration and not have MacPorts clobber those  
> with the platform setting guessed with configure.compiler. So it's  
> probably a missing feature (a.k.a. bug) and should be fixed in base.

That would be nice.  But then again, *if* the arch specific flags were  
passed explicitly to the compiler (i.e., cflags), then I would not  
even need to override the default compilers: distcc would just pass  
these flags to the remote compiler which would output what I need  
whatever its architecture, mine, *and* the one I want to compile for  
(including universal).  This is much better than specifying an arch- 
specific compiler globally.

> Guess you need to just override it on the command line for now ?  
> It's all doable, just falls a bit outside the numbered paint fields.

Yes, I can definitely do that.  Thanks for the help on this!



More information about the macports-users mailing list