Cross-compiling Apache httpd 2.2.19 for uclibc

本文介绍如何为 uClibc 环境交叉编译 Apache httpd 2.2.19。首先需下载源码并编译本机版本以获取编译工具,随后配置特定参数进行交叉编译,并解决编译过程中出现的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值