安装基本开发包
root@ubuntu:~# apt-get update && apt-get install -y build-essential bison flex manpages-dev
root@ubuntu:~# echo $?
0
安装 arm-linux-gcc
解压 arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 来自韦东山教学光盘
tar xf arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2
安装 sudo apt-get install lsb-core
否则可能出现No such file or directory
root@ubuntu:~/leds# arm-linux-objcopy
bash: /home/username/gcc-3.4.5-glibc-2.3.6/bin/arm-linux-objcopy: No such file or directory
更改系统PATH
username@ubuntu:~
sudovim/home/username/.bashrcexportPATH=
PATH::/home/username/gcc-3.4.5-glibc-2.3.6/bin/
看看我的系统 编译环境搭建好了
username@ubuntu:~$ arm-linux-gcc -v
Reading specs from /home/username/gcc-3.4.5-glibc-2.3.6/bin/../lib/gcc/arm-linux/3.4.5/specs
Configured with: /work/tools/create_crosstools/crosstool-0.43/build/arm-linux/gcc-3.4.5-glibc-2.3.6/gcc-3.4.5/configure –target=arm-linux –host=i686-host_pc-linux-gnu –prefix=/work/tools/gcc-3.4.5-glibc-2.3.6 –with-float=soft –with-headers=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include –with-local-prefix=/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux –disable-nls –enable-threads=posix –enable-symvers=gnu –enable-__cxa_atexit –enable-languages=c,c++ –enable-shared –enable-c99 –enable-long-long
Thread model: posix
gcc version 3.4.5