diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index 5a63ce1330..d4e7d4613f 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -241,7 +241,9 @@ def distutils_fix_stdenv # the needed includes with "-I" here to avoid this err: # building dbm using ndbm # error: /usr/include/zlib.h: No such file or directory - ENV.append "CPPFLAGS", "-I#{MacOS.sdk_path}/usr/include" unless MacOS::CLT.installed? + if OS.mac? + ENV.append "CPPFLAGS", "-I#{MacOS.sdk_path}/usr/include" unless MacOS::CLT.installed? + end # Don't use optimizations other than "-Os" here, because Python's distutils # remembers (hint: `python-config --cflags`) and reuses them for C diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 5d94441053..5dd8b3c27a 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -200,11 +200,15 @@ def macosxsdk version=MacOS.version def minimal_optimization set_cflags "-Os #{SAFE_CFLAGS_FLAGS}" - macosxsdk unless MacOS::CLT.installed? + if OS.mac? + macosxsdk unless MacOS::CLT.installed? + end end def no_optimization set_cflags SAFE_CFLAGS_FLAGS - macosxsdk unless MacOS::CLT.installed? + if OS.mac? + macosxsdk unless MacOS::CLT.installed? + end end # Some configure scripts won't find libxml2 without help