///////////////////从「林」开始: imx51-linux-webserver(goAhead 2.5)/////////////////
/////////////////////////////////////////////////////////////////
//environment:
// compile system:Ubantu 10.04
// target system: imx51
// resource: webs-2-5.tar.gz
// reference: http://blog.csdn.net/reille/article/details/6784809
// Thanks: reille
//////////////////////////////////////////////////////////////////
//////////////////////////////compile webs/////////////////////
$ tar -xzvf webs-2-5.tar.gz
$ cd webs-2-5/LINUX
$ vim MAKEFILE
+ CROSS_COMPILE = /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
+ AS = $(CROSS_COMPILE)as
+ LD = $(CROSS_COMPILE)ld
+ CC = $(CROSS_COMPILE)gcc
+ CPP = $(CC) -E
+ AR = $(CROSS_COMPILE)ar
+ NM = $(CROSS_COMPILE)nm
+ STRIP = $(CROSS_COMPILE)strip
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
- matrixsslDir:=$(shell ls -d ../matrixssl-3-1*/)
+ # matrixsslDir:=$(shell ls -d ../matrixssl-3-1*/)
$ vim main.c
+ // lin repair --- 20120424
+ #define LIN_ADD 1
+ #define LIN_MASK 0
+ #define LIN_ADD_MASK 0
+ #define LIN_MASK_ADD 1
+ #if LIN_MASK
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);
+ #endif
+ #if LIN_ADD
+ intaddr.s_addr = inet_addr(T("192.168.1.19"));
+ #endif
$ cd ../
$ vim webs.h
- #define WEBS_WHITELIST_SUPPORT 1
+ #define WEBS_WHITELIST_SUPPORT 0
$ cd LINUX/
$ make clean
$ make
/////////////////////////copy to target rootfs////////////////////////
$ cd ../../
$ mkdir -p rootfs-add-bk/mnt/webs
$ cp webs-2-5/LINUX/webs rootfs-add-bk/mnt/webs/
$ cp webs-2-5/LINUX/libwebs.a rootfs-add-bk/mnt/webs/
$ cp -rf webs-2-5/www rootfs-add-bk/mnt/
$ cp -rf webs-2-5/wwwdemo rootfs-add-bk/mnt/
$ cp -rf rootfs-add-bk/* @target rootfs/
来源:oschina
链接:https://my.oschina.net/u/152096/blog/54949