在lfs上安装net-tools,步骤: 下载net-tools-1.60.tar.bz2,解压后 make config --对每项进行配置 make --这里如果是默认的1.60版本,会出现报错,提示如下错误: inet_sr.c: In function 'INET_setroute': inet_sr.c:108: error: label at end of compound statement make[1]: *** [inet_sr.o] Error 1 make[1]: Leaving directory `/root/sources/net-tools-1.60/lib' make: *** [subdirs] Error 2 解决的办法是对这个问题打一个patch,patch内容如下: --- net-tools-1.60/hostname.c 2001-04-08 19:04:23.000000000 +0200 +++ net-tools-1.60-fixed/hostname.c 2004-05-29 20:29:50.526423387 +0200 @@ -98,6 +98,7 @@ fprintf(stderr, _("%s: name too long\n"), program_name); break; default: + ; } exit(1); }; @@ -117,6 +118,7 @@ fprintf(stderr, _("%s: name too long\n"), program_name); break; default: + ; } exit(1); }; @@ -174,6 +176,7 @@ printf("%s\n", hp->h_name); break; default: + ; } } diff -Nur net-tools-1.60/lib/inet_sr.c net-tools-1.60-fixed/lib/inet_sr.c --- net-tools-1.60/lib/inet_sr.c 2000-02-20 22:46:45.000000000 +0100 +++ net-tools-1.60-fixed/lib/inet_sr.c 2004-05-29 20:29:42.490447616 +0200 @@ -105,6 +105,7 @@ case 2: isnet = 0; break; default: + ; } /* Fill in the other fields. */ 将以上内容保存为hostname.patch,复制到net-tools的源代码目录下,执行: patch -Np1 -i hostname.patch 即可修改该问题。 然后make -n install ; make install。 完成安装。 以上patch的原文链接: http://distro./pub/linux/distributions/sourcemage/grimoire/codex/test/net/net-tools/gcc-3.4.patch |
|
来自: dwlinux_gs > 《Err.集合》