summaryrefslogtreecommitdiff
path: root/doc/install.md
blob: d1c21a8fe5c442f080ade7f9dc97d2de5590807f (plain)
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
# Installing librsync {#page_install}

## Requirements

To build librsync you will need:

* A C compiler and appropriate headers and libraries

* [CMake]

* Some build tool supported by CMake: [Make] is most common,
  [Ninja] is nicer.

* [popt] command line parsing library

* [Doxygen] - optional, to build docs

[popt]: http://rpm5.org/files/popt/
[CMake]: http://cmake.org/
[Doxygen]: https://www.stack.nl/~dimitri/doxygen
[Ninja]: http://build-ninja.org
[Make]: https://www.gnu.org/software/make/

## Building

Generate the Makefile by running

    $ cmake .

After building you can install `rdiff` and `librsync` for system-wide use.

    $ make
    
To build and run the tests:

    $ make check

To install:

    $ sudo make install
    
To build the documentation:

    $ make doc

librsync should be widely portable. Patches to fix portability bugs are
welcome.

If you are using GNU libc, you might like to use

    MALLOC_CHECK_=2 ./rdiff

to detect some allocation bugs.

librsync has annotations for the SPLINT static checking tool.


## Ninja builds

CMake generates input files for an underlying build tool that will actually do
the build. Typically this is Make, but others are supported. In particular
[Ninja] is a nice alternative. To use it:

    $ cmake -G Ninja .
    $ ninja check


## Cygwin

With Cygwin you can build using gcc as under a normal unix system. It
is also possible to compile under Cygwin using MSVC++. You must have
environment variables needed by MSVC set using the Vcvars32.bat
script.