在执行make menuconfig 命令进行内核配置时,输出下面的出错信息:
yyh:~/clfs/sources/linux-2.6.17.13$ make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/kxgettext.o
HOSTCC scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to `_libintl_
gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1011): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x116c): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x11a1): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x11c1): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x11f5): more undefined references to `_l
ibintl_gettext' follow
scripts/kconfig/mconf.o:mconf.c:(.text+0x19df): undefined reference to `_libintl
_bindtextdomain'
scripts/kconfig/mconf.o:mconf.c:(.text+0x19eb): undefined reference to `_libintl
_textdomain'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1a37): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1ac9): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1b10): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1b4b): undefined reference to `_libintl
_gettext'
scripts/kconfig/mconf.o:mconf.c:(.text+0x1b74): undefined reference to `_libintl
_gettext'
scripts/kconfig/zconf.tab.o:zconf.tab.c:(.text+0x52d9): more undefined reference
s to `_libintl_gettext' follow
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2

显然是连接时没有找到libintl库。在Linux系统上,libintl是glibc的一部分,所以连接没有问题。在Cygwin中,并没有glibc库,libintl是作为单独的库安装的。

内核的makefile有一个参数HOST_LOADLIBES,用来指定连接主机程序时需要的库,我们可以用这个参数指定libintl库。执行
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-   HOST_LOADLIBES="-lintl" menuconfig
命令,libintl库的错误消失了,但又冒出了更多的连接错误。仔细观察这些 undefined reference 的连接错误,发现它们都与ncurses库有关,看来make menuconfig也无法自动找到ncurses库。好,我们再在HOST_LOADLIBES中增加ncurse库。执行
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-   HOST_LOADLIBES="-lintl -lncurses" menuconfig
命令,程序编译完毕后,熟悉的内核配置界面出现了。但美中不足的是,界面的边框变成了一些汉字,看起来很别扭。
这个问题与Cygwin窗口的代码页有关,解决起来比较简单:用鼠标单击Cygwin左上角的图标,打开系统菜单。再打开默认值菜单项,把“选项”中的“默认代码页”改为“437 (OEM - 美国)”。退出Cygwin,再重新启动Cygwin,使更改的代码页生效。再执行
make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-   HOST_LOADLIBES="-lintl -lncurses" menuconfig
命令,界面内的边框已经能够正常显示了。

Logo

更多推荐