configure: error: mod_so has been requested but cannot be built on your system 解决办法

configure: error: mod_so has been requested but cannot be built on your system

openwrt 交叉编译 apache ,
configure 添加 --enable-so 选项后报错信息如下:

configure: error: mod_so has been requested but cannot be built on your system

原因分析 :
在编译目录查找打印上面错误的位置,grep “mod_so has been requested but cannot be built on your system” configure -n

httpd-2.4.28# grep "mod_so has been requested but cannot be built on your system" configure -n
13655:            as_fn_error $? "mod_so has been requested but cannot be built on your system" "$LINENO" 5

在 configure 文件的 第 13655 行:查看其上下文:

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#include <apr.h>
#if APR_HAS_DSO
YES_IS_DEFINED
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  $EGREP "YES_IS_DEFINED" >/dev/null 2>&1; then :
  ac_cv_define_APR_HAS_DSO=yes
else
  ac_cv_define_APR_HAS_DSO=no
fi
rm -f conftest*

CPPFLAGS=$apr_old_cppflags


case "x$enable_so" in
    "xyes")
        if test $ac_cv_define_APR_HAS_DSO = "no"; then
            as_fn_error $? "mod_so has been requested but cannot be built on your system" "$LINENO" 5
        fi
        ;;

可知 configure 脚本检查了 APR_HAS_DSO 宏定义,没有定义APR_HAS_DSO 时就会报以上错误,
APR_HAS_DSO 位于 apr.h 中,来自 libapr 。

检查 libapr 的 编译选项: 位于 openwrt\feeds\packages\libs\apr\Makefile

 CONFIGURE_ARGS += \
        --with-devrandom=/dev/urandom \
        --disable-dso \
        $(call autoconf_bool,CONFIG_IPV6,ipv6)

openwrt 编译 libapr 时 开启了 --disable-dso 导致 APR_HAS_DSO 宏未定义

解决办法:
修改 openwrt\feeds\packages\libs\apr\Makefile , 把 --disable-dso 选项去掉

 CONFIGURE_ARGS += \
        --with-devrandom=/dev/urandom \       
        $(call autoconf_bool,CONFIG_IPV6,ipv6)

从新编译libapr 后再编译 apache

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值