> On Sep 16, 2017, at 1:04 PM, Jiří Techet <techet gmail com> wrote:
>
> Just check the backtrace from the first email - there's no C involved. The error message comes from
>
> /System/Library/Frameworks/Python.framework/Versions/2.7/ Jiri,lib/python2.7/distutils/spawn. py
>
> Jiri
>
> On Sat, Sep 16, 2017 at 9:53 PM, John Ralls <jralls ceridwen us> wrote:
>
> > On Sep 16, 2017, at 12:44 PM, Jiří Techet <techet gmail com> wrote:
> >
> > Hi John,
> >
> > at least from the backtrace it doesn't seem to happen when linking libpython but rather when running preprocess() from
> >
> > https://docs.python.org/2/distutils/apiref.html
>
> Huh. That's odd, there's no reason that should care about deployment target. You're sure it's using /usr/bin/python, not linking libpython and calling distutils.preprocess() from C?
Sorry for forgetting about this thread.
We're both wrong, of course. The preprocess function runs cpp, the C preprocessor, on the file. That does everything starting with # in the file: Composes the compilation unit with #include, selects code blocks in #if..#else...#endif, and runs all of the preprocessor macros including MAC_OS_X_MIN_SUPPORTED and MAC_OS_X_MAX_ALLOWED, hence the failure.
But looking through giscanner/ccompiler.py I see that it also has a compile function that does exactly what one would expect. That will also get tripped up by MAC_OS_X_MIN_VERSION/MAX_ALLOWED.
So either work up a generic patch for ccompiler.py that figures out if there's a mismatch between the MACOSX_DEPLOYMENT_TARGET set for building the library and the one used by python or just build python as part of bootstrapping your build environment.
Regards,
John Ralls