Backport from sid to buster
[hcoop/debian/mlton.git] / doc / guide / localhost / CompilingWithSMLNJ
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>CompilingWithSMLNJ</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>CompilingWithSMLNJ</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p>You can compile MLton with <a href="SMLNJ">SML/NJ</a>, however the resulting
32 compiler will run much more slowly than MLton compiled by itself. We
33 don&#8217;t recommend using SML/NJ as a means of
34 <a href="PortingMLton">porting MLton</a> to a new platform or bootstrapping on a
35 new platform.</p></div>
36 <div class="paragraph"><p>If you do want to build MLton with SML/NJ, it is best to have a binary
37 MLton package installed. If you don&#8217;t, here are some issues you may
38 encounter when you run <span class="monospaced">make smlnj-mlton</span>.</p></div>
39 <div class="paragraph"><p>You will get (many copies of) the error messages:</p></div>
40 <div class="listingblock">
41 <div class="content monospaced">
42 <pre>/bin/sh: mlton: command not found</pre>
43 </div></div>
44 <div class="paragraph"><p>and</p></div>
45 <div class="listingblock">
46 <div class="content monospaced">
47 <pre>make[2]: mlton: Command not found</pre>
48 </div></div>
49 <div class="paragraph"><p>The <span class="monospaced">Makefile</span> calls <span class="monospaced">mlton</span> to determine dependencies, and can
50 proceed in spite of this error.</p></div>
51 <div class="paragraph"><p>If you don&#8217;t have an <span class="monospaced">mllex</span> executable, you will get the error
52 message:</p></div>
53 <div class="listingblock">
54 <div class="content monospaced">
55 <pre>mllex: Command not found</pre>
56 </div></div>
57 <div class="paragraph"><p>Building MLton requires <span class="monospaced">mllex</span> and <span class="monospaced">mlyacc</span> executables, which are
58 distributed with a binary package of MLton. The easiest solution is
59 to copy the front-end lexer/parser files from a different machine
60 (<span class="monospaced">ml.grm.sml</span>, <span class="monospaced">ml.grm.sig</span>, <span class="monospaced">ml.lex.sml</span>, <span class="monospaced">mlb.grm.sig</span>,
61 <span class="monospaced">mlb.grm.sml</span>).</p></div>
62 </div>
63 </div>
64 </div>
65 <div id="footnotes"><hr></div>
66 <div id="footer">
67 <div id="footer-text">
68 </div>
69 <div id="footer-badges">
70 </div>
71 </div>
72 </body>
73 </html>