openwrt on mini2440
在openwrt dream-box官网下载openwrt源码,其中支持mini2440 boards
https://dev.openwrt.org.cn/wiki/GetSource
下载好之后,进行编译,可以参照如下教程
https://dev.openwrt.org.cn/wiki/howto
编译过程出现问题和解决方法记录如下:
error1:
In file includedfrom clean-temp.h:22:0,
from clean-temp.c:23:
./stdio.h:456:1:error: 'gets' undeclared here (not in a function)
_GL_WARN_ON_USE(gets, "gets is a security hole - use fgets instead");
解决方法:
参考链接:
http://www.civilnet.cn/talk/browse.php?topicno=78555,2楼.
找到:host-m4-1.4.15/lib/stdio.h,然后对stdio.h文件做出如下改动,必要时连同stdio.in.h一起修改:
<span style="font-family:Arial;font-size:12px;"># Begin patch === modified file 'grub-core/gnulib/stdio.in.h' --- grub-core/gnulib/stdio.in.h 2010-09-20 10:35:33 +0000 +++ grub-core/gnulib/stdio.in.h 2012-07-04 15:18:15 +0000 @@ -140,8 +140,10 @@ /* It is very rare that the developer ever has full control of stdin, so any use of gets warrants an unconditional warning. Assume it is always declared, since it is required by C89. */ +#if defined gets #undef gets _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); +#endif
error 2:
elf.cpp:68:5: error: '::close' has not been declared:
方法:
参考trunk的源码和此问题"https://dev.openwrt.org.cn/ticket/45"
修改 ./build_dir/host/mklibs/src/mklibs-readelf/elf.cpp,添加如下语句
#include <unistd.h>