diff --git a/Formula/valgrind.rb b/Formula/valgrind.rb index 6331f6d9682..895db6b68f4 100644 --- a/Formula/valgrind.rb +++ b/Formula/valgrind.rb @@ -1,20 +1,43 @@ require 'formula' +class Autoconf267 "11255" + + depends_on 'pkg-config' + depends_on 'boost' def install - opoo "Valgrind 3.5.0 doesn't support Snow Leopard; see caveats." if MACOS_VERSION > 10.5 - system "./configure", "--prefix=#{prefix}", "--mandir=#{man}" + args = ["--prefix=#{prefix}", "--mandir=#{man}"] + + if MACOS_VERSION >= 10.6 + # OS X comes with 2.61, which is too old + ac_prefix = Pathname.pwd+'ac267' + Autoconf267.new.brew do |f| + system "./configure", "--prefix=#{ac_prefix}" + system "make install" + end + + ENV.prepend "PATH", ac_prefix+'bin', ":" + + system "./autogen.sh" if File.exists? "autogen.sh" + args << "--enable-only64bit" << "--build=amd64-darwin" + end + + system "./configure", *args system "make install" end - - def caveats - if MACOS_VERSION > 10.5 - "Valgrind does not work on Snow Leopard / 64-bit mode. See:\n"+ - " http://bugs.kde.org/show_bug.cgi?id=205241" - end - end end