ENV: use sdk_path_if_needed

This commit is contained in:
Misty De Meo 2018-07-24 09:33:15 -07:00
parent 47ce9e04e3
commit 6361aa72ae
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C
2 changed files with 7 additions and 7 deletions

View File

@ -27,8 +27,8 @@ module Stdenv
append_path "ACLOCAL_PATH", "#{MacOS::X11.share}/aclocal"
if MacOS::XQuartz.provided_by_apple? && MacOS.sdk_path
append_path "CMAKE_PREFIX_PATH", "#{MacOS.sdk_path}/usr/X11"
if MacOS::XQuartz.provided_by_apple? && MacOS.sdk_path_if_needed
append_path "CMAKE_PREFIX_PATH", "#{MacOS.sdk_path_if_needed}/usr/X11"
end
append "CFLAGS", "-I#{MacOS::X11.include}" unless MacOS::CLT.installed?
@ -93,7 +93,7 @@ module Stdenv
delete("CPATH")
remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
return unless (sdk = MacOS.sdk_path(version))
return unless (sdk = MacOS.sdk_path_if_needed(version))
delete("SDKROOT")
remove_from_cflags "-isysroot #{sdk}"
remove "CPPFLAGS", "-isysroot #{sdk}"
@ -115,7 +115,7 @@ module Stdenv
self["CPATH"] = "#{HOMEBREW_PREFIX}/include"
prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
return unless (sdk = MacOS.sdk_path(version))
return unless (sdk = MacOS.sdk_path_if_needed(version))
# Extra setup to support Xcode 4.3+ without CLT.
self["SDKROOT"] = sdk
# Tell clang/gcc where system include's are:
@ -132,7 +132,7 @@ module Stdenv
# Some configure scripts won't find libxml2 without help
def libxml2
if !MacOS.sdk_path
if !MacOS.sdk_path_if_needed
append "CPPFLAGS", "-I/usr/include/libxml2"
else
# Use the includes form the sdk

View File

@ -58,7 +58,7 @@ module Superenv
def homebrew_extra_library_paths
paths = []
if compiler == :llvm_clang
if !MacOS.sdk_path
if !MacOS.sdk_path_if_needed
paths << "/usr/lib"
else
paths << "#{MacOS.sdk_path}/usr/lib"
@ -102,7 +102,7 @@ module Superenv
end
def effective_sysroot
MacOS.sdk_path&.to_s
MacOS.sdk_path_if_needed&.to_s
end
def set_x11_env_if_installed