The Git configuration value ocaml.configure-cache can be used to specify
a directory to keep autoconf cache files in, relative to the worktree
root (so `git config ocaml.configure-cache .` enables the feature, and
`git config --global ocaml.configure-cache ..` enables it for all
worktrees, assuming they're at the same level).
autoconf's --cache-file option speeds up future runs of configure by
caching the results of previous tests. The cache is invalidated if any
environment variables differ (e.g. LDFLAGS) or if the build-host-target
triplet differs. This is a nuisance on Windows, where configure is both
very slow and it's also common to build with multiple different --host
values.
This PR allows a tree to be quickly reconfigured from one Windows port
to another.
The Git configuration value ocaml.configure is now passed to the
configure script's arguments before $@ if (and only if) OCaml is being
configured from a Git clone.
This allows, for example:
- Developer-specific preferences (e.g. `--disable-ocamldoc` or
`--disable-debug-runtime`)
- Automatic use of autoconf cach files (-C option)
It is implemented by inserting a test at the top of `configure`, which
is bypassed if `.git` doesn't exist.
This commit makes it possible to build the OCaml compiler according to
its configuration by simply runnning make. There is no need to specify
neither world nor world.opt explicitly, although the two targets
remain available.
This commit also introduces (and starts making use of) the
NATIVE_COMPILER build variable whosse value is true when the native
compiler is enabled and false otherwise.
Makefile.dev is only included if a Git clone is detected.
make evaluates macros in target specifications when the Makefile is
read, which meant that the build-all-asts target caused `git ls-files`
to be called on every invocation of make. This tweaks it to be a
recursive call to make which puts the $(AST_FILES) macro in the recipe
where it is only evaluated when the target is requested.
This subdirectory was used to store experimental patches on some older
version-control system where branching (or discussing branches?) was
inconvenient. It doesn't make much sense anymore now, and getting rid
of it simplifies a couple places that had to grow around it.
Suggested-by: Nicolás Ojeda Bär
(no change entry needed)
* Remove the now obsolete comments at the beginning of the main Makefile
* Move and fix documentation of the bootstrap from INSTALL to
HACKING-bootstrap.adoc
* Update install instructions
In the interest of keeping HACKING.adoc not-too-long and
general-purpose, advice on modifying specific sub-systems of the
compiler distribution should be moved to the directory of this
sub-system.
This PR also clarifies the relations between the README, INSTALL,
HACKING and CONTRIBUTING documents.