From 8427e7136878241f96b04a67ee73f9e548d731da Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 6 Oct 2013 17:00:30 -0700 Subject: [PATCH] Track the OS's default C++ stdlib --- Library/Homebrew/build.rb | 7 +++++-- Library/Homebrew/macos.rb | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 6cb903efd2..d9f4fa43b9 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -141,12 +141,15 @@ class Build end end - # We only support libstdc++ right now - stdlib_in_use = CxxStdlib.new(:libstdcxx, ENV.compiler) + # TODO Track user-selected stdlibs, such as boost in C++11 mode + stdlib = ENV.compiler == :clang ? MacOS.default_cxx_stdib : :libstdcxx + stdlib_in_use = CxxStdlib.new(stdlib, ENV.compiler) # This is a bad place for this check, but we don't have access to # compiler selection within the formula installer, only inside the # build instance. + # This is also awkward because we don't actually know yet if this package + # will link against a C++ stdlib, but we don't want to test after the build. stdlib_in_use.check_dependencies(f, deps) f.brew do diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index 19cbbe4218..b3e4b6452b 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -110,6 +110,10 @@ module MacOS extend self end end + def default_cxx_stdlib + version >= :mavericks ? :libcxx : :libstdcxx + end + def gcc_40_build_version @gcc_40_build_version ||= if (path = locate("gcc-4.0"))