【问题标题】:Zabbix cross-compilation issue with HAVE_LONG_LONG condition testZabbix 交叉编译问题与 HAVE_LONG_LONG 条件测试
【发布时间】:2014-08-07 13:09:40
【问题描述】:

我正在尝试为嵌入式 Linux 设备 (powerpc-8xx) 交叉编译 Zabbix 代理 配置脚本在“检查长长格式...”时失败 我已经用谷歌搜索了这个问题,显然 Zabbix configure/configure.ac 脚本还没有准备好交叉编译。 一个人为 configure.ac/configure.in 文件提出了一个不错的补丁here(添加了一个额外的AC_MSG_RESULT(no) 行):

AC_TRY_RUN(
[
#include <sys/types.h>
int main()
{
        uint64_t i;

        sscanf("200000000010020", "%qu", &i);

        if (i == 200000000010020) return 0;
        else return -1;
}
],
AC_DEFINE(HAVE_LONG_LONG_QU, 1 ,[Define to 1 if format '%qu' exists.])
AC_MSG_RESULT(yes),
+AC_MSG_RESULT(no),
AC_MSG_RESULT(no))

..但我不能使用 autoconf/automake(因为我使用的是 Debian Etch 并且它的 autoconf 版本不兼容,它太旧了)

所以我必须对我的 ./configure 文件应用相同的更改,但使用不同的语法,特别是对这些行:

if ac_fn_c_try_run "$LINENO"; then :

$as_echo "#define HAVE_LONG_LONG_QU 1 " >>confdefs.h

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi

如何移植这些更改?

【问题讨论】:

    标签: cross-compiling configure powerpc zabbix


    【解决方案1】:

    我已经为最新的 Zabbix 2.2 和补丁版本运行了 ./bootstrap.sh。

    这是两个 ./configure 版本之间的差异:

    $ diff -U 4 configure-original configure-patched
    --- configure-original  2014-08-07 16:42:27.228887386 +0300
    +++ configure-patched   2014-08-07 16:43:23.404887379 +0300
    @@ -7326,12 +7326,10 @@
    
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long format" >&5
     $as_echo_n "checking for long long format... " >&6; }
     if test "$cross_compiling" = yes; then :
    -  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    -as_fn_error $? "cannot run test program while cross compiling
    -See \`config.log' for more details" "$LINENO" 5; }
    +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    +$as_echo "no" >&6; }
     else
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
    

    【讨论】:

    • 这些行在我的配置文件中有不同的行号,我刚刚手动应用了补丁,它可以工作!!!谢谢!你想在 Zabbix tracker 上发一张票吗?
    • Zabbix 跟踪器上关于这个问题的票是你已经提到的那个 - ZBX-5561,它从昨天开始就在处理。 :-)
    • 你可以提交你的配置文件补丁,比如开票的人:support.zabbix.com/secure/attachment/20063/cross-comp.patch
    • 我已按照您的建议附上了补丁。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多