Skip to content
Snippets Groups Projects
Commit 85187bf6 authored by William Woodruff's avatar William Woodruff Committed by Misty De Meo
Browse files

MacOS: update locate_cctool

This becomes MacOS.{install_name_tool,otool}, only do check_xcode if
xcode is installed, otherwise emit a warning
parent 8aad5230
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,12 @@ module Homebrew
def perform_preinstall_checks
check_ppc
check_writable_install_location
check_xcode
if MacOS::Xcode.installed?
check_xcode
else
opoo "You have not installed Xcode."
puts "Bottles may install correctly, but builds will fail!"
end
check_cellar
end
......
......@@ -98,8 +98,8 @@ class Keg
end
def install_name_tool(*args)
tool = MacOS.locate("install_name_tool")
system(tool, *args) || raise(ErrorDuringExecution.new(tool, args))
tool = MacOS.install_name_tool
system(tool, *args) || raise ErrorDuringExecution.new(tool, args)
end
# If file is a dylib or bundle itself, look for the dylib named by
......
......@@ -154,9 +154,9 @@ module MachO
def parse_otool_L_output
ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s
libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
libs = `#{MacOS.otool} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
unless $?.success?
raise ErrorDuringExecution.new(MacOS.locate("otool"),
raise ErrorDuringExecution.new(MacOS.otool,
["-L", ENV["HOMEBREW_MACH_O_FILE"]])
end
......
......@@ -36,6 +36,22 @@ module OS
end
end
def install_name_tool
if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/install_name_tool")
Pathname.new(path)
else
locate("install_name_tool")
end
end
def otool
if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/otool")
Pathname.new(path)
else
locate("otool")
end
end
def active_developer_dir
@active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip
end
......
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