编译环境: Ubuntu 7.10
交叉编译工具: CROSS-3.3.2 (cross-3.3.2.tar.bz2)
内核包: Linux-2.6.8.1 (gec2410-Linux-2.6.8.1.tar.bz2)
1.交叉编译工具安装的路径: /usr/local/arm2410/
内核包放在某个地方,自己决定吧!
解压 file.tar.bz2的命令: tar jxvf file.tar.bz2
2.把交叉编译器路径添加到系统的路径中:
#vi /root/.bashrc
在alias l='ls -CF'后的空白处填上:
PATH=$PATH:/usr/local/arm2410/3.3.2/bin
export PATH
启动新系统路径:
#source /root/.bashrc
显示新系统路径:
# echo $PATH
查看交叉编译器版本号
# arm-Linux-gcc -v
3.修改 Linux-2.6.8的根目录下的 makfile 文件:
注释掉以下内容:
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?=
增加如下内容:
ARCH : = arm
CROSS_COMPILE =/usr/local/arm2410/3.3.2/bin/arm-Linux-
4.运行 #make menuconfig
出错:scripts/kconfig/mconf.c:91: error: static declaration of ‘current_menu’ follows non-static declaration
scripts/kconfig/lkc.h:63: error: previous declaration of ‘current_menu’ was here
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2
解决办法:
修改 scripts/kconfig/mconf.c文件 ,通过注释相关代码行问题解决:
static struct termios ios_org;
static int rows = 0, cols = 0;
static struct menu *current_menu; //********修改之前
//struct menu *current_menu; //********
static int child_count;
注释粗体行并取消其下行代码注释,结果如下
static struct termios ios_org;
static int rows = 0, cols = 0;
//static struct menu *current_menu; //********修改之后
struct menu *current_menu; //********
static int child_count;