2011-03-10 05:11:03 +00:00
|
|
|
class GooglePerftools < Formula
|
2015-01-15 06:32:44 +00:00
|
|
|
homepage "https://code.google.com/p/gperftools/"
|
2015-01-14 19:13:45 +00:00
|
|
|
url "https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-2.4.tar.gz"
|
|
|
|
sha1 "13b904d0d1f220e43e4495f3403ee280c6da26ea"
|
2009-10-10 22:39:59 +00:00
|
|
|
|
2014-11-08 15:46:51 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-01-15 06:51:05 +00:00
|
|
|
sha1 "182f0141d4d35e0d674ac65e92942beddef19579" => :yosemite
|
|
|
|
sha1 "c07c8decd4323cfcc8bd96a6c94076a044ab9b6d" => :mavericks
|
|
|
|
sha1 "5511c9311f6882df6fc70433818647fb77d59188" => :mountain_lion
|
2014-11-08 15:46:51 +00:00
|
|
|
end
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2326
|
|
|
|
cause "Segfault during linking"
|
|
|
|
end
|
2011-01-22 21:45:20 +00:00
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
def install
|
2015-01-14 19:13:45 +00:00
|
|
|
ENV.append_to_cflags "-D_XOPEN_SOURCE"
|
2011-12-03 17:03:10 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2010-02-27 07:12:53 +00:00
|
|
|
"--prefix=#{prefix}"
|
2009-10-10 22:39:59 +00:00
|
|
|
system "make"
|
2015-01-15 06:32:44 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <assert.h>
|
|
|
|
#include <gperftools/tcmalloc.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
void *p1 = tc_malloc(10);
|
|
|
|
assert(p1 != NULL);
|
|
|
|
|
|
|
|
tc_free(p1);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "test.c", "-ltcmalloc", "-o", "test"
|
|
|
|
system "./test"
|
2009-10-10 22:39:59 +00:00
|
|
|
end
|
|
|
|
end
|