macos - 从源代码构建 ClamAV 和 OpenSSL 时的配置问题

标签 macos openssl anaconda

我正在尝试在 OS X 10.11.6 上构建 clamav-0.99.2。 ./configure 出现以下错误:

configure:17977: error: Your OpenSSL installation is misconfigured or missing

configure:17963: gcc -o conftest -I/usr/local/include  -L/usr/local/lib -lssl -lcrypto -lz conftest.c -lssl -lcrypto -lz  >&5
Undefined symbols for architecture x86_64:
  "_SSL_library_init", referenced from:
      _main in conftest-256c9a.o
ld: symbol(s) not found for architecture x86_64

它只是运行一个简单的测试程序:

|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char SSL_library_init ();
| int
| main ()
| {
| return SSL_library_init ();
|   ;
|   return 0;
| }

我尝试了./configure --without-ssl,同样的问题。

checking for OpenSSL installation... /usr/local
checking for SSL_library_init in -lssl... no
configure: error: Your OpenSSL installation is misconfigured or missing

我已经从 github 安装了 OpenSSL,并且构建时没有错误:

$ openssl
OpenSSL> version
OpenSSL 1.0.2l  25 May 2017

可能与Anaconda的openssl有冲突:

$ which openssl
/Users/davidlaxer/anaconda/bin/openssl
$ whereis openssl
/usr/bin/openssl

函数 SSL_library_init () 不在库中:

$ nm /usr/local/lib/libssl.* | grep SSL_l
00000000000143a0 T _SSL_load_client_CA_file
0000000000001590 T _SSL_load_client_CA_file
00000000000143a0 T _SSL_load_client_CA_file

$ ls -l /usr/local/lib/libssl.* 
-rwxr-xr-x  1 root  wheel  501464 Oct 14 14:41 /usr/local/lib/libssl.1.1.dylib
-rw-r--r--  1 root  wheel  711256 Oct 14 14:41 /usr/local/lib/libssl.a
lrwxr-xr-x  1 root  wheel      16 Oct 14 14:41 /usr/local/lib/libssl.dylib -> libssl.1.1.dylib

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Openssl 似乎已经构建并通过了测试:

$ make test
...
All tests successful.
Files=136, Tests=1116, 643 wallclock secs ( 3.69 usr  0.55 sys + 261.00 cusr 239.88 csys = 505.12 CPU)
Result: PASS

最佳答案

编译时还是同样的问题,

解决方案:安装libxml2-dev libcurl4-openssl-dev

关于macos - 从源代码构建 ClamAV 和 OpenSSL 时的配置问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46775365/

相关文章:

security - 用静态证书解密openssl数据包

python - Visual Studio 不适用于 Anaconda 环境

macos - 具有多个按钮的 NSStatusItem

macos - 如何在 Mac 上从 Jenkins 运行 docker builds?

android - 如何在 ANDROID 应用程序中使用 openSSL 库

ssl - 如何在 OpenSSL 中设置 TLS 应用程序数据协议(protocol)

python - 根本无法启动 Jupyter Notebook

python - PyCharm 虚拟环境和 Anaconda 环境有什么区别?

html - IE 和 MAC 浏览器不支持字体系列

java - 客户端 (X509) 认证的默认环境应该是什么