Cross-compiling Apache httpd 2.2.19 for uclibc

来源:互联网 发布:程序员单词 编辑:程序博客网 时间:2024/05/16 07:16

Cross-compiling Apache httpd 2.2.19 for uclibc

1. 下载 Apache httpd 2.2.19
http://httpd.apache.org/download.cgi

2. 编译本机版本

由于httpd需要编译工具生成中间代码, 所有先编译本机版本产生工具.
# ./configure --host=i686-pc-linux-uclibc  /
 --with-included-apr /
 --with-mpm=worker /
 --enable-static-ab /
 --enable-cgi /
 --enable-cgid
# cp srclib/pcre/dftables  /tmp/tools 
# cp server/gen_test_char  /tmp/tools
 
3. 交叉编译 for uclibc 
将交叉编译工具路径加入到PATH

# ./configure --host=i686-pc-linux-uclibc  /
 --with-included-apr /
 --with-mpm=worker /
 --enable-static-ab /
 --enable-cgi /
 --enable-cgid /
 LDFLAGS="-L/mnt/clfs/lib -L/mnt/clfs/usr/lib" LIBS=-lpthread /
 AR=i686-pc-linux-uclibc-ar /
 AS=i686-pc-linux-uclibc-as /
 CC=i686-pc-linux-uclibc-gcc /
 CXX=i686-pc-linux-uclibc-gcc /
 RANLIB=i686-pc-linux-uclibc-ranlib /
 STRIP=i686-pc-linux-uclibc-strip /
 F77=none /
    ac_cv_c_alignment=need /
 ac_cv_c_endian=little /
 ac_cv_int_type_size_t=yes /
 ac_cv_int_type_int32_t=yes /
 ac_cv_int_type_uint32_t=yes /
 ac_cv_lib_rt_fdatasync=no /
 ac_cv_sizeof_char=1 /
 ac_cv_sizeof_char_p=4 /
 ac_cv_sizeof_int=4 /
 ac_cv_sizeof_long=4 /
 ac_cv_sizeof_long_int=4 /
 ac_cv_sizeof_long_long=8 /
 ac_cv_sizeof_long_long_int=8 /
 ac_cv_sizeof_off_t=4 /
 ac_cv_sizeof_pid_t=4 /
 ac_cv_sizeof_short=2 /
 ac_cv_sizeof_size_t=4 /
 ac_cv_sizeof_ssize_t=4 /
 ac_cv_sizeof_struct_iovec=8 /
    ac_cv_file__dev_zero=yes /
    ac_cv_func_setpgrp_void=yes /
    apr_cv_process_shared_works=yes /
    apr_cv_mutex_robust_shared=yes /
    apr_cv_tcp_nodelay_with_cork=yes /
    ap_cv_void_ptr_lt_long=no /
    ap_void_ptr_lt_long=no /
    ac_cv_func_memcmp_working=yes /
    ac_cv_func_mkstemp64=yes /
    ac_cv_func_mmap64=yes /
    ac_cv_func_mmap_fixed_mapped=yes /
    ac_cv_func_pthread_attr_setguardsize=yes /
    ac_cv_func_pthread_key_delete=yes /
    ac_cv_func_pthread_rwlock_init=yes /
    ac_cv_func_pthread_yield=yes /
    ac_cv_func_readdir64_r=yes /
    ac_cv_func_sem_open=yes /
    ac_cv_func_sendfile64=yes /
    ac_cv_func_sendfilev64=no /
    ac_cv_header_libpq_fe_h=no /
    ac_cv_header_sql_h=no /
    ac_cv_negative_eai=yes /
    ac_cv_o_nonblock_inherited=no /
    ac_cv_struct_rlimit=yes /
    apr_cv_typematch_ssize_t_int=yes /
    apr_cv_typematch_ssize_t_long=yes /
    apr_cv_typematch_size_t_unsigned_int=yes /
    apr_cv_typematch_size_t_unsigned_long=yes

在编译完srclib/pcre/dftables 时会出现一个dftables生成chartables.c文件错误的信息.
这时候需手动生成
# cd srclib/pcre/
# /tmp/tools/dftables chartables.c
# cd ../../
# make
在编译server目录时会再次提示gen_test_char生成test_char.h的错误信息
# cd /server
# /tmp/tools/gen_test_char > test_char.h
# cd ../
# make
编译完成.

4. 安装
# make DESTDIR=/tmp/httpd install