How to reliable detect a MacPorts-ported compiler?

Ryan Schmidt ryandesign at macports.org
Tue Sep 8 20:29:18 PDT 2015


On Sep 8, 2015, at 7:57 PM, Jeffrey Walton wrote:

>>> What strings or bits is MacPorts providing?
>> 
>> If you want to know if gcc is FSF GCC compiled by MacPOrts, you could inspect the version string:
>> 
>> $ gcc-mp-6 --version
>> gcc-mp-6 (MacPorts gcc6 6-20150830_0+universal) 6.0.0 20150830 (experimental)
>> Copyright (C) 2015 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>> 
>> Note that this inclues the string "MacPorts".
>> 
>> However, I reiterate what Rainer said: the issue being discussed here is not (we believe) specific to MacPorts, but rather would occur anytime you compile FSF GCC on OS X.
> 
> Thanks again Ryan.
> 
> Is there a #define so we can detect it in the source code?

Not that I'm aware of. As I said, MacPorts GCC is meant to be the same as FSF GCC, the same as if a user would compile it manually.

> If we can't detect it in the source, the we have to detect it in the
> make file and pass it as a defined with -DXXX. That pollutes the
> command line.



More information about the macports-users mailing list