---
title: "移植fontconfig软件包"
author: "shangjava"
date: "2011-12-07T21:39:00Z"
tags: []
slug: "fontconfig"
draft: false
lastmod: "2012-01-05T09:22:32Z"
id: 1335667
url: "https://shangjava.iteye.com/blog/1335667"
---

移植fontconfig软件包

关于fontconfig的移植，在Ubuntu Server 10.04平台上交叉编译，移植到嵌入式Linux，经过实践，以下是交叉编译的正确步骤，不保证在其他环境中能正确运行，以下是编译环境：

build: Ubuntu Server 10.04  
host: Linux version 2.6.32.15-15-sigma  
cross compiler:mips-linux-gnu-gcc version:4.3.2  
cpu: mips

交叉编译fontconfig，依赖(libxml2,freetype)；

Download Open Sources:

fontconfig-2.8.0.tar.gz  
libxml2-git-snapshot.tar.gz  
freetype-2.4.8.tar.bz2

Building libxml2-git-snapshot.tar.gz:

tar zxvf libxml2-git-snapshot.tar.gz  
cd libxml2-2.7.8/  
./configure --host=mips-linux-gnu CC="mips-linux-gnu-gcc -EL" --with-zlib=/home/gzshun/zlib/ --prefix=/home/gzshun/libxml2 (request cross compile zlib-1.2.3)  
./configure --host=mips-linux-gnu CC="mips-linux-gnu-gcc -EL" --without-zlib --prefix=/home/gzshun/libxml2  
make  
make install

Building freetype-2.4.8.tar.bz2:

tar jxvf freetype-2.4.8.tar.bz2  
cd freetype-2.4.8/  
./configure --host=mips-linux-gnu CC="mips-linux-gnu-gcc -EL" --prefix=/home/gzshun/freetype2  
make  
make install

Building tar zxvf fontconfig-2.8.0.tar.gz:

tar zxvf fontconfig-2.8.0.tar.gz  
cd fontconfig-2.8.0/  
export PKG\_CONFIG\_PATH=/home/gzshun/others/libxml2-2.7.8/:$PKG\_CONFIG\_PATH  
./configure --with-arch=mips --host=mips-linux-gnu CC="mips-linux-gnu-gcc -EL" --enable-libxml2 --with-freetype-config=/home/gzshun/freetype2/bin/freetype-config --includedir="/home/gzshun/libxml2/" --prefix=/home/gzshun/fontconfig  
make  
make install

由于交叉编译开源软件包，不涉及到具体难题，没有逐一解释，只提供编译步骤。