bd9177252f
This patch removes most of the settings for CC, CXX etc. because we are trying to be minimal. Then we force the compiler to Homebrew's choice underneath in superenv. We however leave LD because we prefer that build-systems use the c-compiler for linking, it generally works better (copiously tested), however when the build-system explicitly calls ld, we respect that. This gets around the ocaml bug in question, since somehow clang was crashing during link, but the ld tool itself (which is kind of clang, kind of llvm-gcc) is okay with this. Also moved the setting of O (so that cc-args are refurbished) into a make wrapper. Not sure if this matter much, but seems more consistent.
33 lines
1.1 KiB
Ruby
33 lines
1.1 KiB
Ruby
require 'formula'
|
|
|
|
class ObjectiveCaml < Formula
|
|
homepage 'http://www.ocaml-lang.org'
|
|
url 'http://caml.inria.fr/pub/distrib/ocaml-4.00/ocaml-4.00.0.tar.bz2'
|
|
sha1 '22c0ae84c0049e75ec1577d5c1a26c293bb740b3'
|
|
|
|
head 'http://caml.inria.fr/svn/ocaml/trunk', :using => :svn
|
|
|
|
depends_on :x11
|
|
|
|
# See http://caml.inria.fr/mantis/view.php?id=5700
|
|
def patches
|
|
"http://caml.inria.fr/mantis/file_download.php?file_id=722&type=bug"
|
|
end
|
|
|
|
def install
|
|
system "./configure", "--prefix", HOMEBREW_PREFIX,
|
|
"--mandir", man,
|
|
"-cc", ENV.cc,
|
|
"-aspp", "#{ENV.cc} -c"
|
|
ENV.deparallelize # Builds are not parallel-safe, esp. with many cores
|
|
system "make world"
|
|
system "make opt"
|
|
system "make opt.opt"
|
|
system "make", "PREFIX=#{prefix}", "install"
|
|
(lib/'ocaml/compiler-libs').install 'typing', 'parsing', 'utils'
|
|
|
|
# site-lib in the Cellar will be a symlink to the HOMEBREW_PREFIX location,
|
|
# which is mkpath'd by Keg#link when something installs into it
|
|
ln_s HOMEBREW_PREFIX/"lib/ocaml/site-lib", lib/"ocaml/site-lib"
|
|
end
|
|
end
|