【问题标题】:Error When Cross Compiling gnutls交叉编译 gnutls 时出错
【发布时间】:2011-10-09 09:46:29
【问题描述】:

我正在尝试交叉编译 gnutls。 Gnutls 依赖于 libnettle。我能够交叉编译 libnettle,但是,在尝试交叉编译 gnutls 时,我在配置过程中遇到错误:

configure: error:  Libnettle 2.2 was not found. 

我交叉编译的 libnettle 版本是 2.2。

要配置的命令是:

./configure --host=mips --prefix=/home/tom/lib/gnutls-3.0.3 CC=/crosstools/mips-gcc CXX=/crosstools/mips-g++ --enable-shared --with-libnettle-prefix=/home/tom/lib/nettle-2.2

我也试过: 配置 LDFLAGS="-L/home/tom/lib/nettle-2.2" 没有运气。

这些库安装在 /home/tom/lib/nettle-2.2/lib 中。我也试过这个目录。由于某种原因,libnettle 没有被检测到。有谁知道为什么?

【问题讨论】:

  • 改用LFLAGS 并查看configure (config.log) 的输出。什么失败了?
  • 但是 config.log 中有什么?它应该有编译了什么测试程序来检测 libnettle 以及导致它失败的原因。
  • 感谢您的回复,亚历克斯。我已经尝试过使用 LFLAGS,但遇到了同样的事情。配置:8351:检查 libnettle 配置:8370:/crosstoolsmips64/bin/mips-gcc -std= gnu99 -o conftest -g -O2 conftest.c -lnettle -lhogweed -lgmp >&5 conftest.c:36:24: nettle /gcm.h:没有这样的文件或目录 conftest.c:在函数main': conftest.c:40: warning: implicit declaration of function gcm_set_iv' 配置:8370:$? = 1 配置:失败的程序是:| /* confdefs.h */ configure:8380: result: no configure:8406: error: *** *** Libnettle 2.2 was not found.
  • 如您所见,它甚至无法编译,因为它找不到标头。也许它不尊重--with-libnettle-prefix 设置或者它不是正确的路径。

标签: linux compilation cross-compiling mips64


【解决方案1】:

根据a similar question 和我自己的个人经验,gnutls 需要同时查看 libnettle 和 libhogweed 才能通过此检查。荨麻构建将构建两者,但前提是您的系统上也有 GMP 库。

以下是执行此操作的一些步骤:

  1. 检查您的 /home/tom/lib/nettle-2.2/lib 目录并确保您同时拥有 libnettle.so 和 libhogweed.so。
  2. 如果您没有 libhogweed.so,则必须使用 GMP 重建荨麻。你的发行版可能有一个 gmp-devel 包,它将安装必要的 GMP 库(我的有,所以我没有尝试从源代码构建 GMP)
  3. 然后您应该能够构建 gnutls,或者至少可以通过 libnettle 的检查。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-20
    • 2018-09-13
    • 2014-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-02
    相关资源
    最近更新 更多