Skip to content
Snippets Groups Projects
Unverified Commit 16053498 authored by Misty De Meo's avatar Misty De Meo
Browse files

Allow setting sysroots to a CLT SDK

parent 8450ffa8
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ module Stdenv ...@@ -27,7 +27,7 @@ module Stdenv
append_path "ACLOCAL_PATH", "#{MacOS::X11.share}/aclocal" append_path "ACLOCAL_PATH", "#{MacOS::X11.share}/aclocal"
if MacOS::XQuartz.provided_by_apple? && !MacOS::CLT.installed? if MacOS::XQuartz.provided_by_apple? && MacOS.sdk_path
append_path "CMAKE_PREFIX_PATH", "#{MacOS.sdk_path}/usr/X11" append_path "CMAKE_PREFIX_PATH", "#{MacOS.sdk_path}/usr/X11"
end end
...@@ -93,7 +93,7 @@ module Stdenv ...@@ -93,7 +93,7 @@ module Stdenv
delete("CPATH") delete("CPATH")
remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
return unless (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed? return unless (sdk = MacOS.sdk_path(version))
delete("SDKROOT") delete("SDKROOT")
remove_from_cflags "-isysroot #{sdk}" remove_from_cflags "-isysroot #{sdk}"
remove "CPPFLAGS", "-isysroot #{sdk}" remove "CPPFLAGS", "-isysroot #{sdk}"
...@@ -115,7 +115,7 @@ module Stdenv ...@@ -115,7 +115,7 @@ module Stdenv
self["CPATH"] = "#{HOMEBREW_PREFIX}/include" self["CPATH"] = "#{HOMEBREW_PREFIX}/include"
prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" prepend "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
return unless (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed? return unless (sdk = MacOS.sdk_path(version))
# Extra setup to support Xcode 4.3+ without CLT. # Extra setup to support Xcode 4.3+ without CLT.
self["SDKROOT"] = sdk self["SDKROOT"] = sdk
# Tell clang/gcc where system include's are: # Tell clang/gcc where system include's are:
...@@ -132,7 +132,7 @@ module Stdenv ...@@ -132,7 +132,7 @@ module Stdenv
# Some configure scripts won't find libxml2 without help # Some configure scripts won't find libxml2 without help
def libxml2 def libxml2
if MacOS::CLT.installed? if !MacOS.sdk_path
append "CPPFLAGS", "-I/usr/include/libxml2" append "CPPFLAGS", "-I/usr/include/libxml2"
else else
# Use the includes form the sdk # Use the includes form the sdk
......
...@@ -58,7 +58,7 @@ module Superenv ...@@ -58,7 +58,7 @@ module Superenv
def homebrew_extra_library_paths def homebrew_extra_library_paths
paths = [] paths = []
if compiler == :llvm_clang if compiler == :llvm_clang
if MacOS::CLT.installed? if !MacOS.sdk_path
paths << "/usr/lib" paths << "/usr/lib"
else else
paths << "#{MacOS.sdk_path}/usr/lib" paths << "#{MacOS.sdk_path}/usr/lib"
...@@ -102,7 +102,7 @@ module Superenv ...@@ -102,7 +102,7 @@ module Superenv
end end
def effective_sysroot def effective_sysroot
MacOS.sdk_path.to_s if MacOS::Xcode.without_clt? MacOS.sdk_path&.to_s
end end
def set_x11_env_if_installed def set_x11_env_if_installed
...@@ -113,7 +113,7 @@ module Superenv ...@@ -113,7 +113,7 @@ module Superenv
def setup_build_environment(formula = nil) def setup_build_environment(formula = nil)
generic_setup_build_environment(formula) generic_setup_build_environment(formula)
self["HOMEBREW_SDKROOT"] = effective_sysroot self["HOMEBREW_SDKROOT"] = effective_sysroot
self["SDKROOT"] = MacOS.sdk_path if MacOS::Xcode.without_clt? self["SDKROOT"] = MacOS.sdk_path if MacOS.sdk_path
# Filter out symbols known not to be defined since GNU Autotools can't # Filter out symbols known not to be defined since GNU Autotools can't
# reliably figure this out with Xcode 8 and above. # reliably figure this out with Xcode 8 and above.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment