Closed jordwalke closed 8 years ago
A relocatable OCaml depends on the "OCAMLLIB" environment variable being set. If you don't want to set this environment variable, then you need to recompile OCaml on your machine with a "--prefix" flag passed to ./configure
. Then, assuming OCaml is installed in the directory FOO
you've passed to ./configure --prefix=FOO
, OCaml will find the right cmx and cmi's. You still need, however, to have the other bits of the toolchain (x86_64-w64-mingw32-gcc, flexlink) in the PATH. I don't know how things would work otherwise. You'd probably have to patch OCaml to hardcode some directories then recompile.
Thanks for the detailed explanation, @msprotz!
Suppose I simply wanted the simplest possible OCaml setup on Windows, and I was willing to give up the ability to use all the existing tooling such as findlib, ocamlbuild, etc. Suppose, someone on windows just wants to learn how to use OCaml and execute raw
ocamlopt/ocamldep
commands. It would be best in this case, if all the compiler binaries, and standard lib existed in a sandboxed directory such as./myDir/bin/
,./myDir/lib
.Is it possible or easy to generate a precompiled distribution such as I've described - without requiring that path variables be changed in a particular way? I don't necessarily care if the size is huge. How much of the
ocaml-installer
and the resulting compiler toolchain relies on being in some special directory in the windows special directories (or requires that compiled libraries are installed in some special location)? What can be done to create a fully self-contained, portable directory as I've described? Any help is greatly appreciated.