-
Notifications
You must be signed in to change notification settings - Fork 4
/
INSTALL
89 lines (53 loc) · 2.74 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
1. [Optional] Install OCaml using Opam. Instructions are here:
http://opam.ocaml.org/doc/Quick_Install.html
Or you could install OCaml using your platform's package manager.
2. Install ocamlfind. In Opam, you run:
$ opam update && opam install ocamlfind
3. Install Cil from source into a base location of your choice.
$ git clone git@github.com:kerneis/cil.git
$ cd git && ./configure --prefix=$INSTALL_BASE && make && make install
[Use gmake on FreeBSD.]
Cil installs some Perl modules that are needed by the CCured
driver script. Set your PERL5LIB envvar to point to them. For
example, if the CilConfig.pm was installed above into
$INSTALL_BASE/lib/perl5/App/Cilly/CilConfig.pm,
then set PERL5LIB to include $INSTALL_BASE/lib/perl5:
$ export PERL5LIB=$PERL5LIB:$INSTALL_BASE/lib/perl5
4. Install and build CCured. Ensure first that you have installed
the Boehm-Weiser GC package for your platform.
$ git clone git@github.com:pmundkur/ccured-hack.git ccured
$ cd ccured && ./configure && make
On FreeBSD, the last two steps might need to be (in order to pick up the Boehm-GC):
CPPFLAGS=-I/usr/local/include CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure && gmake
Currently, FreeBSD will most likely fail at the C header patching
step. Support for the FreeBSD/Clang C headers is coming soon.
FreeBSD-CURRENT Notes:
----------------------
The ports version of ocaml/ocamlfind is too old. Instead, install ocaml
from source using:
$ ./configure -aspp 'cc -c'
which it makes it avoid defaulting to 'gcc -c'.
Then install opam from source:
$ wget https://github.com/ocaml/opam/archive/1.1.0.tar.gz
and then do the usual ./configure && make && make install dance. Opam
does not need root privilege to install, but it does need a command to
configure your environment at every login:
$ eval `opam config env`
You need to do the following _once_ after a fresh install of opam:
$ opam init
Make sure it can see the ocaml you just installed as the system compiler:
$ opam switch
After that, you can follow the above steps, from Step 2.
Cross-compilation:
------------------
When CCured output is to be cross-compiled, then the runtime needs to
be compiled with the same cross-compiler that the ccured script will
use (via CIL). You can override the compiler called by CIL (and hence
the ccured script) using the CILLY_NATIVE_CC environment variable.
In this case, you should
- define CILLY_NATIVE_CC in your environment
- generate the cross-compiled runtime using
$ CILLY_NATIVE_CC=$CILLY_NATIVE_CC gmake runtime
To remove the dependence on a cross-built Boehm-GC, add
-DCCURED_NO_GC to the runtime build.
- call bin/ccured as usual with CILLY_NATIVE_CC in its environment