Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / CompilingWithSMLNJ.adoc
1 CompilingWithSMLNJ
2 ==================
3
4 You can compile MLton with <:SMLNJ:SML/NJ>, however the resulting
5 compiler will run much more slowly than MLton compiled by itself. We
6 don't recommend using SML/NJ as a means of
7 <:PortingMLton:porting MLton> to a new platform or bootstrapping on a
8 new platform.
9
10 If you do want to build MLton with SML/NJ, it is best to have a binary
11 MLton package installed. If you don't, here are some issues you may
12 encounter when you run `make smlnj-mlton`.
13
14 You will get (many copies of) the error messages:
15
16 ----
17 /bin/sh: mlton: command not found
18 ----
19
20 and
21
22 ----
23 make[2]: mlton: Command not found
24 ----
25
26 The `Makefile` calls `mlton` to determine dependencies, and can
27 proceed in spite of this error.
28
29 If you don't have an `mllex` executable, you will get the error
30 message:
31
32 ----
33 mllex: Command not found
34 ----
35
36 Building MLton requires `mllex` and `mlyacc` executables, which are
37 distributed with a binary package of MLton. The easiest solution is
38 to copy the front-end lexer/parser files from a different machine
39 (`ml.grm.sml`, `ml.grm.sig`, `ml.lex.sml`, `mlb.grm.sig`,
40 `mlb.grm.sml`).