From 1d7aa1fe0b430a4415cb976a2b2c3041f4269b55 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Thu, 15 Sep 2016 02:24:33 -0700 Subject: [PATCH] superenv: help Autotools with 10.12 SDK on 10.11 The GNU Autotools tests for whether a given symbol is defined are reliably coming to incorrect conclusions on 10.11 with the 10.12 SDK in Xcode 8. This overrides its decisions by forcing the right answer in superenv using ac_cv_func_* environment variables and setting them to "no" on 10.11. The list of problematic symbols is from grep 'weak$os10.11' MacOSX.sdk/usr/lib/system/libsystem_c.tbd --- Library/Homebrew/extend/os/mac/extend/ENV/super.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index ef2855de15c53..84b6622992620 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -94,6 +94,15 @@ def setup_build_environment(formula = nil) self["SDKROOT"] = MacOS.sdk_path end + # Filter out symbols known not to be defined on 10.11 since GNU Autotools + # can't reliably figure this out with Xcode 8 on its own yet. + if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0" + %w[basename_r clock_getres clock_gettime clock_settime dirname_r + getentropy mkostemp mkostemps].each do |s| + ENV["ac_cv_func_#{s}"] = "no" + end + end + # On 10.9, the tools in /usr/bin proxy to the active developer directory. # This means we can use them for any combination of CLT and Xcode. self["HOMEBREW_PREFER_CLT_PROXIES"] = "1" if MacOS.version >= "10.9"