Pet*_*zov 18 c makefile compilation build
我试图在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
Run Code Online (Sandbox Code Playgroud)
我运行命令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.
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
最好的祝愿
del*_*ver 19
问题是libhogweednettle 不会构建,除非你已经观察到了libgmp的dev头文件.不幸的是,.configure --help来自configure 的文档和输出没有说明这一点.
同时,gnuTLS文档也没有解释这一点(正如你所注意到的,这里的配置输出不是很有帮助).虽然libgmp被列为pre-req,但由于某些原因libhogweed不是(也许是因为它被认为是nettle的一部分).配置错误"无法找到-lgmp"的原因是libgmp不存在,但libhogweed.so也不存在,因为它是nettle 的隐藏可选部分.如果你然后安装libgmp-dev并且只运行configure for gnutls,那么你将获得相同的"检查libnettle ...... no".这应该说的是"检查libhogweed ......不",但负责conf脚本的人太懒了,不能打破它(我猜一个补丁可以提交).
换句话说,在构建gnutls之前,需要先安装libgmp-dev 然后重建 nettle .
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.
Run Code Online (Sandbox Code Playgroud)
我安装 gmp-devel。问题已解决。