如何编译GnuTLS
我试图在Centos 6.2上多次编译GnuTLS库,但没有运气。 这些是步骤:
我下载了Nettle 2.4
[root@localhost opt]# wget http://www.lysator.liu.se/~nisse/archive/nettle-2.4.tar.gz [root@localhost nettle-2.4]# tar zxvf nettle-2.4.tar.gz [root@localhost nettle-2.4]# cd nettle-2.4 [root@localhost nettle-2.4]# ./configure --enable-shared --prefix=/usr Version: nettle 2.4 Host type: x86_64-unknown-linux-gnu ABI: 64 Assembly files: x86_64 Install prefix: /usr Library directory: ${exec_prefix}/lib64 Compiler: gcc Shared libraries: yes Public key crypto: no
我运行命令make
和make install
我下载了最新的GnuTLS
./configure --with-libnettle-prefix=/usr hecking for shared library run path origin... done checking whether to use nettle... yes checking for libnettle... no configure: error: *** *** Libnettle 2.4 was not found.
我错过了什么?
最好的祝愿
问题是libhogweed
不会构建libhogweed
除非你已经观察到了libgmp的dev头文件。 不幸的是,来自configure的docs和.configure --help
和输出没有说明这一点。
同时,gnuTLS文档也没有解释这一点(正如您所注意到的,此处的配置输出不是很有帮助)。 尽管libgmp被列为pre-req,但由于某些原因libhogweed不是(也许是因为它被认为是nettle的一部分)。 配置错误“无法找到-lgmp”的原因是libgmp不存在,但libhogweed.so
也不存在,因为它是libhogweed.so
的隐藏可选部分。 如果你然后安装libgmp-dev并且只运行configure for gnutls,那么你将获得相同的“检查libnettle …… no”。 这应该说的是“检查libhogweed ……不”,但负责conf脚本的人太懒了,不能打破它(我猜一个补丁可以提交)。
换句话说,在构建gnutls之前,需要先安装libgmp-dev 然后重建 nettle。
我安装了nettle-dev
和nettle-bin
,它的工作原理:)
configure:8798: checking for libnettle configure:8820: gcc -std=gnu99 -o conftest -g -O2 conftest.c /usr/lib/libnettle.so /usr/lib/libhogweed.so -lgmp >&5 /usr/bin/ld: cannot find -lgmp collect2: ld returned 1 exit status configure:8820: $? = 1 configure: failed program was: configure:8830: result: no configure:8856: error: *** *** Libnettle 2.4 was not found.
我安装了gmp-devel。 问题是固定的。
Gnu TLS配置脚本没有大声说需要pkg-config,如果没有安装pkg-config,甚至可能不会尝试其他软件包。 安装pkg-config为我解决了这个问题。
如果在Debian上出现这个问题一段时间,请尝试安装pkgconf包。