Skip to content

Commit

Permalink
Valgrind.
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Weaver committed Sep 3, 2009
1 parent cfbe9d2 commit 45cdd46
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ext/build_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def which(basename)
end.compact.join(" ")

puts "** Configure"
execute("env #{env} ./configure #{Config::CONFIG['configure_args']}".sub("'--enable-shared'", ""))

args = Config::CONFIG['configure_args']
args.sub("'--enable-shared'", "")
args << " --enable-valgrind" if which("valgrind")
execute("env #{env} ./configure #{args}")

puts "Patch Makefile"
# FIXME Why is this necessary?
Expand Down Expand Up @@ -101,13 +105,9 @@ def which(basename)
ruby_binary = Config::CONFIG["RUBY_INSTALL_NAME"] || "ruby"

puts "** Install binary"
if File.exist? ruby_binary
# Avoid "Text file busy" error
File.delete bleak_binary if File.exist? bleak_binary
exec("cp ./#{ruby_binary} #{bleak_binary}; chmod 755 #{bleak_binary}")
else
raise
end
raise unless File.exist? ruby_binary
File.delete bleak_binary if File.exist? bleak_binary # Avoid "Text file busy" error
exec("cp ./#{ruby_binary} #{bleak_binary}; chmod 755 #{bleak_binary}")
end

end
Expand Down

0 comments on commit 45cdd46

Please sign in to comment.