Re: switching to `ocamlc -where` = /usr/lib/ocaml/
On Mon, Feb 09, 2009 at 10:07:24AM +0100, Stefano Zacchiroli wrote:
> The proposal is to switch from having `ocamlc -where` =
> /usr/lib/ocaml/<ABI>/ to plain /usr/lib/ocaml/.
I'll put my two cent(ime)s in here:
Fedora uses $libdir/ocaml (ie. no versioned directory) for the same
reason you mention. So we can only support installing one version of
OCaml at a time.
_However_ when it comes to installing the cross-compiler, we use a
separate library directory and separate binaries:
$libdir/$target-ocaml # The OCaml library, cross-compiled
$bindir/$target-ocamlopt # The cross-compiler
where $target is something like "i686-pc-mingw32", but we expect to
have other cross-compilers in future.
Note that if you use AC_CHECK_TOOL([ocamlopt]) in autoconf, and you
are cross-compiling, then autoconf automatically picks
/usr/bin/$target-ocamlopt over /usr/bin/ocamlopt.
Now the way we chose to select between ordinary compilation and
cross-compilation is elegant and works even without autoconf. We
have two ocamlfind.conf files:
/etc/ocamlfind.conf # Selects ordinary compilation
/etc/i686-pc-mingw32-ocamlfind.conf # Selects cross-compilation
and to switch between the two, just set OCAMLFIND_CONF environment
variable to point to the correct configuration file (actually, to
select ordinary compilation, you just leave this undefined). Ordinary
ocamlfind commands just work, but pick the correct compiler:
ocamlfind ocamlopt -package ......