cd zlib #cd 到zlib包目录
./configure --prefix=/home/build_cairo_library/BuildCairo/zlib_install #prefix指定编译后的文件存放位置
make && make install
cd libpng #d到libpng源码目录
./configure --prefix=/home/build_cairo_library/BuildCairo/libpng_install
make && make install
cd pixman
./configure --prefix=/home/build_cairo_library/BuildCairo/pixman_install LIBS='/home/build_cairo_library/BuildCairo/zlib_install/lib/ -lz' CPPFLAGS='-I/home/build_cairo_library/BuildCairo/zlib_install/include' PNG_CFLAGS='-I/home/build_cairo_library/BuildCairo/libpng_install/include' PNG_LIBS='-L/home/build_cairo_library/BuildCairo/libpng_install/lib/ -lpng16'
make && make install
cd cairo
./configure --prefix=/home/build_cairo_library/BuildCairo/cairo_install --host=mipsel-linux --with-x --enable-pdf --enable-ps --disable-svg --enable-png LIBS='-L/home/build_cairo_library/BuildCairo/zlib_install/lib/ -lz' CPPFLAGS='-I/home/build_cairo_library/BuildCairo/zlib_install/include/' png_CFLAGS='-I/home/build_cairo_library/BuildCairo/libpng_install/include' png_LIBS='-L/home/build_cairo_library/BuildCairo/libpng_install/lib' pixman_CFLAGS='-I/home/build_cairo_library/BuildCairo/pixman_install/include/pixman-1' pixman_LIBS='-L/home/build_cairo_library/BuildCairo/pixman_install/lib -lpixman-1'
make && make install
在执行./configure时遇到问题:
checking for cairo's PNG functions feature...
configure: WARNING: Could not find libpng in the pkg-config search path
checking whether cairo's PNG functions feature could be enabled... no
configure: error: recommended PNG functions feature could not be enabled
解决方法:执行./configure之前 export png_REQUIRES="libpng16"