交叉编译环境搭建教程
在/usr/local/下建立交叉编译器的安装目录arm
sudo mkdir /usr/local/arm
将下载的交叉编译器包解压到/usr/local/arm目录下
sudo tar jxvf cross-4.2.2-eabi.tar.bz2 -C /usr/local/arm/
解压成功后,修改PATH环境变量
sudo vim /etc/profile
export PATH=$PATH:/usr/local/arm/4.2.2-eabi/usr/bin
Special for me:
sudo vim /etc/profile
export PATH=$PATH:/usr/local/arm/current_compiler/bin
sudo ln -sb 编译器文件夹 /usr/local/arm/current_compiler/
- 更新一下配置文件/etc/profile
source /etc/profile
创建软链接到指定的编译器
build.sh
#/bin/bash
if [ $# != 1 ] ; then
echo "USAGE: $0 cross_compiler_dir_name"
exit 1;
fi
cross_compiler=$1
rm ./current_compiler
ln -s ${cross_compiler} current_compiler
echo link current_compiler to ${cross_compiler}