Add a helper to determine make path on Tiger

This commit is contained in:
Misty De Meo 2015-06-26 20:06:11 -07:00
parent 2d81c6878f
commit 2008c880dd

View File

@ -156,6 +156,19 @@ module FileUtils
system RUBY_BIN/"rake", *args
end
# Run `make` 3.81 or newer.
# Uses the system make on Leopard and newer, and the
# path to the actually-installed make on Tiger or older.
def make(*args)
if Utils.popen_read("/usr/bin/make", "--version").match(/Make (\d\.\d+)/)[1] > "3.80"
system "/usr/bin/make", *args
else
make = Formula["make"].opt_bin/"make"
make_path = make.exist? ? make.to_s : (Formula["make"].opt_bin/"gmake").to_s
system make_path, *args
end
end
if method_defined?(:ruby)
# @private
alias_method :old_ruby, :ruby