forked from alavrik/piqi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
147 lines (81 loc) · 3.43 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
This file contains instructions for building "piqi" command-line executable from
source code.
Pre-built binaries can be downloaded from http://piqi.org/downloads/
SUPPORTED PLATFORMS
===================
Piqi has been tested on Linux (i386 and amd64 architectures), Mac OS X and
FreeBSD. It is also known to work on Windows and Solaris.
Piqi is written in OCaml so, in theory, it should work on platforms and hardware
architectures supported by OCaml. See the list of supported platforms at
http://caml.inria.fr/ocaml/portability.en.html
PREREQUISITES
=============
On Debian and Ubuntu:
apt-get install ocaml camlp4-extra ocaml-findlib gcc make sed
On Mac OS X (using Homebrew):
brew install objective-caml opam
opam init
eval `opam config env`
opam install ocamlfind
(Here, we used [OPAM](http://opam.ocamlpro.com/) to build and install
ocamlfind).
On Windows:
For building native Windows binaries, download and install OCaml for
Windows from here:
http://protz.github.io/ocaml-installer/
For building under Cygwin, follow the steps from the next section.
See the "CROSS-COMPILATION" section below for instructions on building a
Windows executable on Linux.
On other Unix systems:
* OCaml (>= 3.12)
OCaml is available in most Linux distributions. It can also be
downloaded from here:
http://caml.inria.fr/download.en.html
* CamlP4 -- Caml Preprocessor and Pretty Printer
It comes as a part of OCaml source distribution. It should be
prepackaged in major Linux distributions as well.
* Ocamlfind/Findlib -- library manager for OCaml
If installed separately form prepackaged OCaml distribution, it
is recommended to build it from sources after you build/install
OCaml. It can be downloaded from here:
http://projects.camlcity.org/projects/findlib.html
* C compiler
GCC works. Other compilers should work if they are able to build
OCaml.
* GNU make, sed and probably some other tools.
INSTALLATION INSTRUCTIONS
=========================
1. Run ./configure
Run "./configure --help" for the list of available options.
2. Build third-party dependencies
make deps
3. Build Piqi
make
4. Install the "piqi" binary along with the "piqi.1" man page
make install
5. (Optional) build HTML documentation -- see doc/README.md for more details
make doc
RUNNING TESTS
=============
1. Prepare the environment
. setenv.sh
2. Run the tests
cd tests; make
See tests/README for further information.
CROSS-COMPILATION
=================
To build a Windows (win32) executable on Linux:
1. Install mingw-w64 cross-compiler
For example, on Debian:
apt-get install gcc-mingw-w64-i686
Homepage: http://sourceforge.net/projects/mingw-w64/
2. Install OCaml cross-compiler
opam switch 4.00.1
opam repo add win https://github.com/vouillon/opam-windows-repository.git
opam install win32-ocaml win32-ocamlfind
See up-to-date instructions at https://github.com/vouillon/opam-windows-repository
3. Build
./configure --host=i686-w64-mingw32
make deps
make
make strip # optional