check for os and xcode version

Joshua Root jmr at
Fri Oct 6 01:46:05 UTC 2017

On 2017-10-6 12:09 , Helmut K. C. Tessarek wrote:
> On 2017-10-05 19:15, Joshua Root wrote:
>> Ideally fix the code such that it works with any Xcode version and avoid
>> having to check,
> I think this is rather up to upstream, but fixing something that only
> breaks with Xcode 9 seems the wrong approach anyway.
> IMO Apple has to fix Xcode instead.

Well, it depends on the nature of the problem. Newer versions of Xcode 
routinely break some C++ code by shipping a newer clang++ which complies 
more closely with the C++ standards, for example, and that's not really 
something that Apple should fix, since the code was really incorrect all 

What kind of breakage are we talking about exactly?

>> but if that's not possible, the xcodeversion variable
>> is available in Portfiles. It's not a simple integer like os.major, so
>> make sure you use the vercmp command when comparing versions (as opposed
>> to '<', '>' or '==').
> Well, it's not the first time that I've noticed that Xcode breaks code
> for some weird reason. I hope Apple fixes Xcode in the near future.
> Can you please give me an example how to use vercmp and xcodeversion?

Doing a quick grep of the ports tree, the first few examples I see are 
libgcrypt, lua-md5, libunwind, and apr.

- Josh

More information about the macports-dev mailing list