Z.前期准备(使用root权限)
一、安装系统补丁
1. 安装更新189个(2012-10-8)
二、网络
1. 安装ssh,apt-get install ssh
远程控制用
2. 安装samba
文件共享用
三、软件环境
安装如下软件(apt-get install)
1. bison
2. flex
3. libncurses5-dev
4. build-essential(g++)
5. gperf
6. texinfo
7. automake
8. libtool
9. gawk
update-alternatives –config awk
10. cvs
11.subversion(svn)
12. zlib1g-dev
13.libexpat-dev(cross-gdb)
Y. 安装crosstool-ng
1.解压缩
# tar jxvf crosstool-ng-1.16.0.tar.bz2
2.配置
# ./configure --prefix=/usr/local/ctng
3.生成
# make
4.安装
# make install
X. 配置crosstool-ng
1. 增加安装路径到系统路径中
export PATH=$PATH:/usr/local/ctng/bin
2. 建立一个临时目录
# cd ~
root@xiaobin-pc:~# mkdir toolchain-build
3. 拷贝预配置文件到临时目录
root@xiaobin-pc:/# cd /usr/local/ctng/lib/ct-ng.1.16.0/samples
root@xiaobin-pc:/usr/local/ctng/lib/ct-ng.1.16.0/samples# cp arm-unknown-linux-gnueabi/* ~/toolchain-build/
# cd ~
root@xiaobin-pc:~# cd crosstool-build
root@xiaobin-pc:~/toolchain-build# mvcrosstool.config .config
4. 执行菜单配置(menuconfig)
此步为修改默认选项,以适应我们的目标板。
(1) 更改shell为bash
如果运行
# ls -la /bin/sh
看到链接的是 dash ,则请运行以下命令
sudo dpkg-reconfigure dash
选择 no 以删除 dash
(2)root@xiaobin-pc:~/toolchain-build#ct-ng menuconfig
a. Paths and misc options
1)crosstool-NG behavior
默认
2)Paths
默认
3)Downloading
默认
4)Extracting
默认
5)Build behavior
(2) Number of parallel jobs
6)Logging
默认
b. Target options
Target Architecture (arm)
1)Generic target options
2)Target optimizations
3)arm other options
c. Toolchain options
1)General toolchain options
2)Tuple completion and aliasing
3)Toolchain type
4)Build system
5)Misc options
d. Operating System
Linux kernel version (2.6.32.59)
1)Common kernel options
2)linux other options
e. Binary utilities
Binuary format: (ELF)
1)GNU binutils
Binutils version (2.19.1a)
2)elf2flt
f. C compiler
C compiler (gcc)
gcc version (4.4.3)
1)Additional supported languages
2)gcc other options
3)Optimisation features
4)Settings for libraries running on target
5)Misc. obscure options
g. C-library
C library (glibc)
glibc version (2.9)
h. Debug facilities
i. Companion libraries
GMP version (4.3.2)
MPFR version (2.4.2)
PPL version (0.10.2)
CLooG/ppl version (0.15.9)
1)libelf version needed to build for target
libelf version (0.8.13)
2)Companion libraries common options
j. Companion tools
k. Test suite
5. 下载文件
此步是为了节省下载时间,我们使用下载工具把文件(bz2)下载下来,然后拷贝到$HOME/src(默认目录)下。
(1) linux-2.6.32.59.tar.bz2
(2) gcc-4.4.3.tar.bz2
(3) binutils-2.19.1a.tar.bz2
(4) mpfr-2.4.2.tar.bz2
(5) gmp-4.3.2.tar.bz2
(7) gdb-6.8a.tar.bz2
(10) cloog-ppl-0.15.9.tar.gz
(11) dmalloc-5.5.2.tgz
(12) libelf-0.8.13
(13) duma-2_5_15
(15)ncurses-5.9.tar.gz
(16) elf2flt-cvs-head.tar.gz
(17)glibc-2.9.tar.bz2
(18)glibc-ports-2.9.tar.bz2
6. 生成交叉编译环境
root@xiaobin-pc:~/toolchain-build# ct-ngbuild