remove extra whitespace at the end of lines
[rrdtool.git] / doc / rrdbuild.pod
1 =head1 NAME
2
3 rrdbuild - Instructions for building RRDtool
4
5 =head1 DESCRIPTION
6
7 =head2 Overview
8
9 If you downloaded the source of rrdtool you have to compile it. This
10 document will give some information on how this is done.
11
12 RRDtool relies on services of thrid part libraries. Some of these libraries
13 may already be installed on your system. You have to compile copies of the other
14 ones before you can build RRDtool.
15
16 This document will tell you about all the necessary steps to get going.
17
18 =head2 Building
19
20 Before you start to build RRDtool, you have to decide two things:
21
22 =over
23
24 =item 1.
25
26 In which directory you want to build the software.
27
28 =item 2.
29
30 Where you want to install the software.
31
32 =back
33
34 Once you have decided. Save the two locations into environment variables.
35 Depending on the shell you are using, you can do either (bash,zsh):
36
37  BUILD_DIR=/tmp/rrdbuild
38  INSTALL_DIR=/usr/local/rrdtool-1.2.8
39
40 Or if you run tcsh:
41
42  set BUILD_DIR=/tmp
43  set INSTALL_DIR=/usr/local/rrdtool-1.2.8
44
45 Now make sure the BUILD_DIR exists and go there:
46
47  mkdir -p $BUILD_DIR
48  cd $BUILD_DIR
49
50 Lets first assume you already have all the necessary libraries
51 per-installed. Note that these instructions assume that your copies of
52 B<tar> and B<make> are actually B<GNU tar> and B<GNU make> respectively. It
53 could be that they are installed as B<gtar> and B<gmake> on your system.
54
55  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/rrdtool-1.2.8.tar.gz
56  tar zxf rrdtool-1.2.8.tar.gz
57  cd rrdtool-1.2.8
58  ./configure --prefix=/path/to/installation && make && make install
59
60 Ok, this was very optimistic. This try will probably have ended with
61 B<configure> complaining about several missing libraries. If you are on a
62 Linux or *bsd system you may want to just install the missing bits from your
63 software repository. When you do that, make sure you also get the B<-dev>
64 package for each library you install. Once you have the missing bits on
65 board, just re-run the last line of the instructions above.
66
67 But again this may have been too optimistic, and you actually have to
68 compile your own copies of the required libraries. Here is how:
69
70 =over
71
72 =item Building cgilib
73
74  cd $BUILD_DIR
75  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/cgilib-0.5.tar.gz
76  tar zxf cgilib-0.5.tar.gz
77  cd cgilib-0.5
78  make CC=gcc CFLAGS="-O3 -fPIC -I."
79  mkdir -p $BUILD_DIR/lb/include
80  cp *.h $BUILD_DIR/lb/include
81  mkdir -p $BUILD_DIR/lb/lib
82  cp libcgi* $BUILD_DIR/lb/lib
83
84 =item Building zlib
85
86  cd $BUILD_DIR
87  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/zlib-1.2.2.tar.gz
88  tar  zxf zlib-1.2.2.tar.gz
89  cd zlib-1.2.2
90  env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
91  make
92  make install
93
94 =item Building libpng
95
96 Libpng itself requires zlib to build, so we need to help a bit. If you
97 already have a copy of zlib on your system (which is very likley) you can
98 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
99 the end of line 4 means that line 4 and line 5 are on one line.
100
101  cd $BUILD_DIR
102  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libpng-1.2.8-config.tar.gz
103  tar zxvf libpng-1.2.8-config.tar.gz
104  cd libpng-1.2.8-config
105  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
106      ./configure --disable-shared --prefix=$BUILD_DIR/lb
107  make
108  make install
109
110 =item Building freetype
111
112  cd $BUILD_DIR
113  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/freetype-2.1.9.tar.gz
114  tar zxvf freetype-2.1.9.tar.gz
115  cd freetype-2.1.9
116  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
117      ./configure --disable-shared --prefix=$BUILD_DIR/lb
118  make
119  make install
120
121
122 =item Building libart_lgpl
123
124  cd $BUILD_DIR
125  wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
126  cd libart_lgpl-2.3.17
127  env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
128  make
129  make install
130
131 =back
132
133 Now all the dependent libraries are built and you can try again. This time
134 you tell configure where it should be looking for libraries and include
135 files. This is done via environment variables. Depending on the shellyou are running, the syntax for setting
136 environment variables is different. Under csh/tcsh you use:
137
138  set IR=-I$BUILD_DIR/lb/include
139  setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
140  setenv LDFLAGS  -L$BUILD_DIR/lb/lib
141  setenv CFLAGS -O3
142
143 If you are running bash/sh/ash/ksh/zsh use this:
144
145  IR=-I$BUILD_DIR/lb/include
146  CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
147  LDFLAGS="-L$BUILD_DIR/lb/lib"
148  CFLAGS=-O3
149  export CPPFLAGS LDFLAGS CFLAGS
150
151 And finally try building again:
152
153  ./configure --prefix=$INSTALL_DIR && make && make install
154
155 Now go to I<$INSTALL_DIR>B</examples> and run them to see if your
156 build has been successful.
157
158 =head1 AUTHOR
159
160 Tobias Oetiker E<lt>oetiker@ee.ethz.chE<gt>
161