[Development] About the presence of /System/Library/Frameworks/Carbon.framework
René J. V. Bertin
rjvbertin at gmail.com
Mon Jan 8 11:17:36 CET 2018
Konstantin Tokarev wrote:
>> It does sound like we're a little too enthusiastic about jumping to a
>> conclusion here - is there a better way to decide what we're compiling
>> for ? Surely we should ignore uname if configure has options that
>> explicitly ask for cross-compilation; but it's a reasonable thing to
>> consult otherwise, when auto-detecting in the absence of explicit
>> instructions - in particular, more to be trusted than the existence of
>> (possibly non-native) frameworks,
> Note that in opening letter different question was asked, namely how to
> detect if script is running on Mac or not, presumably to avoid asking Linux
> users to install Xcode.
I think Edward is raising the same question, but yes, the reason I raised my
question was that I was prompted to install Xcode AND that that was all the
script would do. The former is ... pittoresque, the latter is more annoying.
A combination of tests might be the way to go. I noticed the same check for
Carbon.framework in the MacPorts sources (also to distinguish PureDarwin). But
in their case they check the result from `tcl_platform(os)` first. If memory
serves me well that variable is initialised from uname. I.e. something like
if [ $UNAME_SYSTEM = Darwin -a -d /System/Library/Frameworks/Carbon.framework ];
The only situation in which this test could fail validly would be on PureDarwin
or similar OS ("true and false"). That's exactly what is required here, no?
Alternatively, there's `sysctl hw.model` which can probably be used as the
And of course there's the possibility to add a way to force the script to
continue in an unforeseen situation (but that seems more work).
More information about the Development