在安装rrdtool时需要cairo包的支持,而cairo又需要pkg-config、glib、pixman、pang、freetype、fontconfig包的支持
pkg-config
http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
tar zxvf pkg-config-0.23.tar.gz
cd pkg-config-0.23
./configure
make
make install
其它的安装包
http://oss.oetiker.ch/rrdtool/pub/libs/
pango-1.21.1.tar.bz2
pixman-0.10.0.tar.gz
libxml2-2.6.32.tar.gz
glib-2.15.4.tar.gz
cairo-1.6.4.tar.gz
libpng-1.2.18.tar.gz
freetype-2.3.5.tar.gz
cairo-1.4.10.tar.gz
fontconfig-2.4.2.tar.gz
libart_lgpl-2.3.17.tar.gz
zlib-1.2.3.tar.gz
其中系统中已安装的是(参见http://blog.c1gstudio.com/archives/152)
zlib-1.2.3.tar.gz
freetype-2.3.5.tar.gz
libpng-1.2.31.tar.gz
libxml2-2.6.32.tar.gz
fontconfig-2.6.0.tar.gz
tar zxvf glib-2.15.4.tar.gz
cd glib-2.15.4
./configure –with-libiconv
make
Nothing to be done for `all’.
mv /install-prefix/include/glib.h /install-prefix/include/glib.h.del
mv /install-prefix/include/gmodule.h /install-prefix/include/gmodule.h.del
make clean
make uninstall
./configure –with-libiconv
make
还是不行
make clean
./configure –with-libiconv –prefix=/usr
make clean
make
make install
pkg-config –cflags glib-2.0
pkg-config –libs glib-2.0
ldconfig
wget -c http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
tar zxvf pixman-0.10.0.tar.gz
cd pixman-0.10.0
./configure
make
make install
wget -c http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
tar zxvf cairo-1.6.4.tar.gz
cd cairo-1.6.4
./configure
configure: error: Cairo requires at least one native font backend. Please install FreeType and fontconfig and try again
make clean
cp /usr/local/freetype/include/ft2build.h /usr/local/freetype/include/freetype2/
./configure FREETYPE_LIBS=/usr/local/freetype/lib/libfreetype.so FREETYPE_CFLAGS=”-I/usr/local/freetype/include/freetype2″ FONTCONFIG_CFLAGS=”-I/usr/local/fontconfig/include” FONTCONFIG_LIBS=/usr/local/fontconfig/lib/libfontconfig.so
cairo (version 1.8.6 [release]) will be compiled with:
make
make install
The following surface backends:
Image: yes (always builtin)
Xlib: no (requires X development libraries)
Xlib Xrender: no (requires –enable-xlib)
Quartz: no (requires CoreGraphics framework)
Quartz-image: no (disabled, use –enable-quartz-image to enable)
XCB: no (disabled, use –enable-xcb to enable)
Win32: no (requires a Win32 platform)
OS2: no (disabled, use –enable-os2 to enable)
PostScript: yes
PDF: yes
SVG: yes
glitz: no (disabled, use –enable-glitz to enable)
BeOS: no (disabled, use –enable-beos to enable)
DirectFB: no (disabled, use –enable-directfb to enable)
The following font backends:
User: yes (always builtin)
FreeType: yes
Win32: no (requires a Win32 platform)
Quartz: no (requires CoreGraphics framework)
The following functions:
PNG functions: yes
And the following internal features:
gcov support: no
test surfaces: no (disabled, use –enable-test-surfaces to enable)
ps testing: yes
pdf testing: no (requires poppler-glib >= 0.9.2)
svg testing: no (requires librsvg-2.0 >= 2.15.0)
*** It is strictly recommended that you enable the native surface backend
*** feature for your platform.
make clean
./configure –prefix=/usr/local/cairo
echo ‘/usr/local/cairo/lib’ >> /etc/ld.so.conf
ldconfig -v
pkg-config –list-all
会报某些库找不到,
设置链接库路径
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/local/freetype/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/local/fontconfig/lib/pkgconfig:$PKG_CONFIG_PATH
每次退出后以上变量需重新设置,可以保存成一个文件如:set_pkg_path.sh,然后source set_pkg_path.sh
如果想避免使用 GTK+ 库之前上述设置的麻烦,可以把上面环境变量的设置在系统的配置文件中(如 /etc/profile)或者自己的用户配置文件中(如 ~/.bash_profile)
wget -c 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 –enable-cairo –prefix=/usr
make
make install
wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
tar zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
make
make install
wget -c http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz
cp /usr/local/cairo/lib/pkgconfig/* /usr/lib/pkgconfig/
export PKG_CONFIG_PATH=/usr/local/cairo/lib/pkgconfig:$PKG_CONFIG_PATH
CPPFLAGS=”-I/usr/local/lib/pkgconfig/ -I/usr/local/include/libart-2.0/ -I/usr/local/freetype/ -I/usr/local/lib/” ./configure –prefix=/usr/local/rrdtool –disable-tcl –disable-python
make clean
make
make install
安装失败,找不到cairo-png,应该是动态链接库路径问题.
`-rddtool
|
+-cairo
| |
| `-pixman
|
`-pango
|
`-glib-2.4.0
软件做成这样, 程序员可以去死了