1.1 下载源码
https://download.samba.org/pub/samba/stable/
1.2 编译
我下载的是3.0.11,主要是嵌入式平台空间有限,下载过新版本,可执行程序过大
配置:
./configure --host=mips-linux-gnu --disable-cups --disable-iprint --target=mips-linux-gnu CC=mips-linux-uclibc-gnu-gcc
编译:
编译过程中出错,提示
configure: error: cannot run test program while cross compiling
搜索了一下
把这些对应分支的代码全部去掉,不要它走这个分支,比如以下
把yes改成ye,configure里就不会走里面的分支了
重新配置成功
编译又出错了。。。。。。。。
include/popt_common.h:25:26: error: array type has incomplete element type
直接在include/popt_common.h中包含popt.h头文件即可
编译快成功的时候,又出现一个错误
lib/time.c:66:2: error: too few arguments to function ‘gettimeofday’
gettimeofday这个函数是有两个参数的
我直接改成这样了
不知道这样会不会崩溃,反正编译通过了。
1.3 执行
把smbtree和smbclient拷贝到开发板中执行,跑是跑起来了,不过还得配置一下smb.conf