陸續記錄移植過程。
1.下載Boa源碼
2.生成makefile文件
creating cache ./config.cache
checking for gunzip... /bin/gunzip
checking for flex... flex
checking for yywrap in -lfl... yes
checking for bison... bison -y
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking whether make sets ${MAKE}... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for fcntl.h... yes
checking for sys/fcntl.h... yes
checking for limits.h... yes
checking for sys/time.h... yes
checking for sys/select.h... yes
checking for getopt.h... yes
checking for working const... yes
checking for uid_t in sys/types.h... yes
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether setvbuf arguments are reversed... no
checking for unistd.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for getcwd... yes
checking for strdup... yes
checking for strstr... yes
checking for gethostname... yes
checking for gethostbyname... yes
checking for select... yes
checking for socket... yes
checking for inet_aton... yes
checking for scandir... yes
checking for alphasort... yes
checking for tm.tm_gmtoff... yes
checking for tm.tm_zone... yes
checking for sockaddr_in.sin_len... no
checking compile and link profiling code... no
checking whether to compile and link debugging code... yes
checking whether to link with the Dmalloc memory debugger/profiler... no
checking whether to link with the Electric Fence memory debugger... no
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
可見makefile文件已經成功生成。3.作編譯前的一些修改
util.c:100:1: error: pasting "t" and "->" does not give a valid preprocessing token
(2)修改src/log.cDIE("unable to dup2 the error log");
}
DIE("unable to dup2 the error log");
}*/
log.c:73 - unable to dup2 the error log: Bad file descriptor
DIE("getpwuid");
}
if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
DIE("initgroups");
}
if (passwdbuf == NULL) {
DIE("getpwuid");
}
if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
DIE("initgroups");
}
#endif
boa.c:211 - getpwuid:No such file or direactory
註釋掉DIE("icky Linux kernel bug!");
}
if (setuid(0) != -1) {
DIE("icky Linux kernel bug!");
}
#endif
boa.c:226 - icky Linux kernel bug!: No such file or directory
4.修改makefile
CPP = gcc -E
CPP = arm-arago-linux-gnueabi-gcc -E
5.編譯
6.去除調試信息
-rwxr-xr-x 1 vincent vincent 208275 2013-05-10 10:51 boa
執行命令去除調試信息;-rwxr-xr-x 1 vincent vincent 62760 2013-05-10 11:18 boa
OK,boa精簡了好多好多。7.配置與構建
8.運行測試
root@OMAP3EVM:/# [01/Jan/2000:00:13:54 +0000] boa: server version Boa/0.94.13
[01/Jan/2000:00:13:54 +0000] boa: server built May 10 2013 at 13:59:37.
[01/Jan/2000:00:13:54 +0000] boa: starting server pid=611, port 80
eth0 Link encap:Ethernet HWaddr 00:24:BA:ED:58:CA
inet addr:192.168.188.165 Bcast:192.168.188.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12027 errors:0 dropped:5 overruns:0 frame:0
TX packets:4822 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4823486 (4.5 MiB) TX bytes:799473 (780.7 KiB)
Interrupt:61
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
IP爲:192.168.188.165