2014-02-13 20:26:21 +00:00
|
|
|
class Compcert < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "CompCert C verified compiler"
|
2014-02-13 20:26:21 +00:00
|
|
|
homepage "http://compcert.inria.fr"
|
2015-08-12 23:14:10 +00:00
|
|
|
url "https://github.com/AbsInt/CompCert/archive/v2.5.tar.gz"
|
|
|
|
sha256 "36847b00fa5436ac8e052489b728adef2bc68064fe22dbdc18bf22256856fd95"
|
2014-02-13 20:26:21 +00:00
|
|
|
|
2015-08-12 23:44:57 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "c5868acdb43b5c467e4e969b665b8775b8065454c339ef98e56034230b24750f" => :yosemite
|
|
|
|
sha256 "eb646e83d7be1cc4e0b5e426c9247a45d26906de3f06c39e2e0451c4849b59ba" => :mavericks
|
|
|
|
sha256 "7ce52bcd1e488829d71481741f49abd3489b9b86e2f400825de439a730d3ba2b" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-09-02 23:43:23 +00:00
|
|
|
depends_on "ocaml" => :build
|
2014-05-26 19:41:23 +00:00
|
|
|
depends_on "coq" => :build
|
|
|
|
depends_on "menhir" => :build
|
2014-02-13 20:26:21 +00:00
|
|
|
|
|
|
|
def install
|
2014-05-26 19:37:59 +00:00
|
|
|
ENV.permit_arch_flags
|
|
|
|
|
2014-02-13 20:26:21 +00:00
|
|
|
# Compcert's configure script hard-codes gcc. On Lion and under, this
|
|
|
|
# creates problems since XCode's gcc does not support CFI,
|
|
|
|
# but superenv will trick it into using clang which does. This
|
|
|
|
# causes problems with the compcert compiler at runtime.
|
2014-05-26 19:41:23 +00:00
|
|
|
inreplace "configure", "${toolprefix}gcc", "${toolprefix}#{ENV.cc}"
|
2014-02-13 20:26:21 +00:00
|
|
|
|
|
|
|
system "./configure", "-prefix", prefix, "ia32-macosx"
|
|
|
|
system "make", "all"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
2014-05-26 23:55:34 +00:00
|
|
|
int printf(const char *fmt, ...);
|
2014-02-13 20:26:21 +00:00
|
|
|
int main(int argc, char** argv) {
|
2014-05-26 23:32:48 +00:00
|
|
|
printf("Hello, world!\\n");
|
2014-02-13 20:26:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/ccomp", "test.c", "-o", "test"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|