朱的工作记录  
技术博客
日历
<2011年5月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
统计
  • 随笔 - 2
  • 文章 - 4
  • 评论 - 4
  • 引用 - 0

导航

常用链接

留言簿(1)

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
交叉编译器:mipsel-linux-uclibc-gcc
环境:suse 9

1.下载解压(包括matrixssl-3-1-2-open,因为需要用到这个ssl库)
matrixssl-3-1-2-open这个库放在webs-2-5目录里面。
2.编译
修改matrixssl-3-1-2-open的Makefile
CC      = mipsel-linux-uclibc-gcc
STRIP   = mipsel-linux-uclibc-strip
AR      = mipsel-linux-uclibc-ar
#make
生成libmatrixssl.a

修改LINUX/Makefile:
CC      = mipsel-linux-uclibc-gcc
STRIP   = mipsel-linux-uclibc-strip
AR      = mipsel-linux-uclibc-ar
修改main.c:
static char_t       *rootWeb = T("www");            /* Root web directory */ 
static char_t *demoWeb = T("wwwdemo"); /* Root web directory */
这个是webs程序跑的html目录

/*if (gethostname(host, sizeof(host)) < 0) 
{

error(E_L, E_LOG, T("Can't get hostname"));

return -1;
}

if ((hp = gethostbyname(host)) == NULL)
{

error(E_L, E_LOG, T("Can't get host address"));

return -1;

}

memcpy((char *) &intaddr, (char *) hp->h_addr_list[0],
(size_t) hp->h_length);*/
intaddr.s_addr=inet_addr(
"10.2.11.195");//替换成自身IP,因为在MIPS平台无法通过上面的函数获取IP
/*getcwd(dir, sizeof(dir));      
if ((cp = strrchr(dir, '/')))
{

*cp = '\0';

}*/

strcpy(dir, "/mnt");//直接赋值html所在的目录路径,因为使用上面的函数获取,出现404
//ascToUni(wbuf, host, min(strlen(host) + 1, sizeof(wbuf)));//屏蔽这一行
#make
即可在当前目录下生成webs程序,拷贝到目标平台测试运行(可以使用源码提供的wwwdemo作html测试)

3.运行
./webs -demo(运行wwwdemo里面的html)
posted on 2012-02-07 19:54 阅读(1859) 评论(0)  编辑 收藏 引用 所属分类: Web Server

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


 
Copyright © 朱 Powered by: 博客园 模板提供:沪江博客