2014-02-13 20:26:21 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Compcert < Formula
|
|
|
|
homepage "http://compcert.inria.fr"
|
2014-05-26 19:41:23 +00:00
|
|
|
url "http://compcert.inria.fr/release/compcert-2.3pl2.tgz"
|
|
|
|
sha1 "8d7b9d5b18bd52487686db2acd534c978b1e1421"
|
|
|
|
version "2.3pl2"
|
2014-02-13 20:26:21 +00:00
|
|
|
|
|
|
|
depends_on "objective-caml" => :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
|