日期:2014-05-16  浏览次数:20634 次

Linux上简单配置安装cacti(四)cacti准备rrdtool
Linux上简单配置安装cacti(四)cacti准备rrdtool

...汗,差这么多动动,参考如下BLOG把这些东东都安装完整,另外我也决定将rrdtool降低到和这个BLOG相同的版本
http://blog.csdn.net/wang01ning/archive/2009/11/22/4852385.aspx
命令:
export BUILD_DIR=/data/tools/postfix_install
export INSTALL_DIR=/usr/local/rrdtool
export CFLAGS="-O3 -fPIC"
export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
export PKG_CONFIG_PATH=/usr/local/rrdtool/lib/pkgconfig

wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
tar xzvf pkg-config-0.23.tar.gz
cd pkg-config-0.23
./configure --prefix=$INSTALL_DIR
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=$INSTALL_DIR --shared
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
tar xzvf libpng-1.2.18.tar.gz
cd libpng-1.2.18
./configure --prefix=$INSTALL_DIR
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
tar xzvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
tar xzvf libxml2-2.6.32.tar.gz
cd libxml2-2.6.32
./configure --prefix=$INSTALL_DIR
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
tar xzvf fontconfig-2.4.2.tar.gz
cd fontconfig-2.4.2
./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config --with-expat-lib=/usr/lib64
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
tar xzvf pixman-0.10.0.tar.gz
cd pixman-0.10.0
./configure --prefix=$INSTALL_DIR
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
tar xzvf cairo-1.6.4.tar.gz
cd cairo-1.6.4
./configure --prefix=$INSTALL_DIR \
    --enable-xlib=no \
    --enable-xlib-render=no \
    --enable-win32=no
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
tar xzvf glib-2.15.4.tar.gz
cd glib-2.15.4
./configure --prefix=$INSTALL_DIR

报错:
configure: error: *** pkg-config too old; version 0.16 or better required
检查版本:
命令:echo $PKG_CONFIG_PATH
返回信息:/usr/local/rrdtool/lib/pkgconfig
命令:pkg-config --version
返回信息:0.15.0
果然不符合要求,看来第一步安装pkg-config没有成功哟。其实不是没有安装成功,而是没有配置对。检查一下pkg-config是调用的哪里的命令:
which pkg-config
返回信息:
/usr/bin/pkg-config
将我们安装目录的pkg-config拷贝过去
cp /usr/local/rrdtool/bin/pkg-config /usr/bin/
再次查看版本,ok,已经正确了:),重新操作
./configure --prefix=$INSTALL_DIR
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
tar jxvf pango-1.21.1.tar.bz2
cd pango-1.21.1
./configure --prefix=$INSTALL_DIR --without-x
make
make install

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.8.tar.gz
tar xzvf rrdtool-1.3.8.tar.gz
cd rrdtool-1.3.8
./configure --prefix=$INSTALL_DIR
出错:
configure: error: Your intltool is too old. You need intltool 0.35.0 or later.
解决办法如下:
wget http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz
tar zxvf intltool-0.40.6.tar.gz
cd intltool-0.40.6
./configure
make
make install
问题解决,安装完成新版,重新编译继续安装,
./configure --prefix=$INSTALL_DIR
make
出错:
tclrrd.c:20:17: tcl.h: 没有那个文件或目录
解决办法:
./configure --prefix=$INSTALL_DIR --disable-tcl
ok,问题解决,然后再继续安装
make
make install

检查安装的rrdtool的版本
/usr/local/rrdtool/b