转载时请注明出处和作者
作者 :李先静

考虑到交叉编译只是个浪费时间的体力活,FTK提供了一个Makefile来交叉编译FTK本身和其依赖的软件包,在tools/cross-build/README里说明:

1. copy cross.mk and env.sh into the PARENT directory of ftk.
2. edit env.sh to set some variables.
3. source env.sh
4. make -f cross.mk

环境变量文件非常简单。FTK提供了几个样本,通常只能需要拷贝一份,修改一下toolchain所在的位置即可。如:

#broncho 1900 ####################################################### #export ARCH=arm #export HOST_PARAM=--host=arm-linux #export TARGET_CC=arm-linux-gcc #export PATH=/usr/local/arm-linux-4.1.1/bin/:$PATH #jz4740 ####################################################### #export ARCH=mipsel #export HOST_PARAM=--host=mipsel-linux #export TARGET_CC=mipsel-linux-gcc ##export PATH=/work/board/jz/mipseltools-gcc412-glibc261/bin:$PATH #sigma, # maybe you need change the path. ####################################################### cd /home/smp/smp86xx_toolchain_2.8.3.0 && source toolchain-path.env && cd - cd /home/smp/mrua_SMP8634_2.8.3.0_GCC4_dev.mips && source MRUA.env && cd - export ARCH=mipsel export HOST_PARAM=--host=mipsel-linux export TARGET_CC=mipsel-linux-gcc
 
cross.mk会自动下载软件包并做交叉编译。有两个重要目标:

o all 用来编译zlib png jpeg tslib freetype libftk。这个是FTK基于framebuffer的直接运行的。
o all_dfb 用来编译zlib png jpeg tslib freetype directfb libftk。这个是FTK基于directfb运行的,这时libftk的编译选项要做适当的修改。