1. 首先添加toolchain环境变量
每一个开发平台所需要用到的交叉编译链接工具不一样,添加到系统 /etc/profile即可
su进入root,执行
vi /etc/profile
在最后添加:export PATH=$PATH:/usr/.../bin/
添加完成后执行:source /etc/profile
通过命令:echo /etc/profile查看是否添加成功
2. 添加环境变量OK后,安装gcc
gedit /etc/apt/sources.list
用"#"注释掉有"cdrom"字样的那几行,那几行一般放在开头,意思是优先从dvd光盘安装软件,而非从网上下载
执行:apt-get update
然后分别执行以下:
apt-get install gcc automake autoconf libtool make
apt-get install gcc-multilib
apt-get install gcc-multilib
apt-get install lib32z1 lib32ncurses5 lib32ncurses5-dev
至此,一般情况下,需要的32位lib基本都有了。
补充:如果make menuconfig发现报错
yanghg@yanghg:~/src/×××$ make menuconfig
./tools/custom_cfg_all.sh
Generate ./customer/Kconfig ...
Generate ./customer/sunplus/Kconfig ...
./tools/mconf: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
Makefile:169: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 127
执行 apt-get install lib32ncursesw5 lib32ncursesw5-dev 即可
./tools/custom_cfg_all.sh
Generate ./customer/Kconfig ...
Generate ./customer/sunplus/Kconfig ...
./tools/mconf: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
Makefile:169: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 127
执行 apt-get install lib32ncursesw5 lib32ncursesw5-dev 即可