Fixing for 110.46
[bpt/mlt.git] / BUILDING
... / ...
CommitLineData
1===================
2System requirements
3===================
4
5Compiling the mlt tool requires a "working version" of SML/NJ. It's
6best to use version 110.46 or later. You may have problems with any
7version whatsoever, though, since this stuff uses some SML/NJ compiler
8internals, and they may change often.
9
10If you're using a pre-110.46 version, you'll need to, at a minimum,
11get the SML/NJ source, make the following patches, and build it. Of
12course, there are no promises that everything will then work with that
13particular version. (Especially problematic are the changes in the
14Basis library spec that aren't backwards compatible.) The patch
15involves modifying some of the included .cm files to make a few
16additional internal structures visible. The necessary changes to make
17are described below, with paths given relative to your base SML/NJ
18directory. The lines listed for each file should be added right before
19the "is" keyword at the end of the exports list for a library. The
20"is" is on the first non-indented line after the initial "Library"
21line in each of these files.
22
23The following lines to src/compiler/core.cm:
24 structure Types
25 structure EntityEnv
26 structure Modules
27 structure Stamps
28 structure Bindings
29 structure TypesUtil
30 structure VarCon
31 structure ModuleUtil
32 structure II
33 structure BasicTypes
34 structure PPType
35 structure Access
36
37The following lines to both src/system/smlnj/compiler/current.cm
38and src/system/smlnj/compiler/x86.cm:
39 structure Types
40 structure EntityEnv
41 structure Modules
42 structure Stamps
43 structure Bindings
44 structure TypesUtil
45 structure VarCon
46 structure ModuleUtil
47 structure II
48 structure BasicTypes
49 structure PPType
50 structure Access
51 structure Unify
52
53The following line to src/compiler/Elaborator/elaborate.cm:
54 structure Unify
55
56Finally, add the following line somewhere _below_ the "is" in
57src/system/smlnj/compiler/x86.cm:
58 $smlnj/viscomp/elaborate.cm
59
60After making these changes, you can rebuild and install the compiler
61with the following sequence of commands:
62
63cd $smlnjdir/src/system
64sml
65CM.autoload "$smlnj/cmb.cm";
66CMB.make ();
67<exit from sml by typing the end-of-file sequence>
68./makeml
69./installml
70
71
72=============
73Configuration
74=============
75
76If it is possible for you to modify a file /etc/mlt.conf, then you
77can edit this file to set various options related to locations of
78important files on your file system. In particular, you may want to
79set the 'compiler', 'lib', and 'sml' options (documented in the
80manual) if you have SML/NJ installed somewhere besides /usr/local/sml
81or the mlt src directory somewhere besides /usr/local/share/mlt/src.
82If you can't modify /etc/mlt.conf, then you can change the first
83variable definition in src/config.sml to a different path, or you can
84leave it as is and provide all configuration in the local mlt.conf
85file for each project.
86
87You should also edit the paths in the simple install script in this
88directory if you want to install system-wide binaries and scripts to
89somewhere besides /usr/local/bin.
90
91These changes may be made for you by a fancy configuration program in
92a future release.
93
94
95========
96Building
97========
98
99All sources may be built by running the build script in this
100directory. It does a clean re-build of all source files and stabilizes
101all libraries produced. The build script is not appropriate for use
102during development. Use the standard SML/NJ CM mechanisms if you are
103changing the code and don't want to recompile everything each time.
104
105[There is probably a better way to do this, but I haven't figured one
106out yet.]