3

在 El Capitan 10.11.1 上编译 http 2.4.16 时遇到 OpenSSL 错误。

它正在寻找 OpenSSL 版本 >= 0.9.8a

checking for OpenSSL... checking for user-provided OpenSSL base directory... none
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old

默认的 OpenSSL 版本是0.9.8zg

$ openssl version
OpenSSL 0.9.8zg 14 July 2015

最后,这是我的编译行的一部分:

./configure --prefix=/usr/local/MyWebserver/httpd-2.4.12 \
--enable-ssl \
--with-few-things… \
--disable-lots-of-things…

我不想安装另一个 openssl,即使brew.

4

5 回答 5

5

对我来说,通过安装“openssl-devel”包解决了这个问题。

于 2018-03-09T16:30:05.023 回答
2

以上解决方案都不适合我。

我通过告诉“配置”使用哪个 open-ssl 来解决它:

在进行 ./configure 时,请添加以下内容:

--with-ssl=/usr/local/Cellar/openssl/1.0.2r

而 1.0.2r 是您当前的 openssl 版本,通常由 brew 安装。

我更喜欢使用这种方法而不是弄乱系统文件(即不喜欢在 /usr/... 目录上链接任何东西,因为它会弄乱系统,尤其是 Apple 总是会进行更新以防止你这样做this),因此,以下命令有效:

./configure --enable-ssl --enable-so --prefix=/(无论你喜欢安装位置) --with-included-apr --with-mpm=prefork --with-ssl=/usr/local /地窖/openssl/1.0.2r

为了使我的安装工作,我还需要下载 apr 和 apr-util,解压缩并将它们放在 srclib 文件夹中,然后再安装。

我希望这有帮助。

于 2019-05-07T12:21:52.760 回答
1

如果您安装了当前版本的 OpenSSL(使用 Homebrew),则不一定需要复制内容,创建符号链接足以确保它被 configure 命令拾取:

ln -s /usr/local/opt/openssl/include/openssl /usr/local/include

更多详情:https ://medium.com/@timmykko/using-openssl-library-with-macos-sierra-7807cfd47892

于 2018-09-19T15:03:14.520 回答
0

我找到了一种方法:

  1. 将文件夹 /usr/incude/openssl 从 Yosemite (MacOS 10.10) 复制到我的计算机 (El Capitan MacOS 10.11) 上的 /usr/local/include/openssl。
  2. 然后通过在编译环境变量 gcc 和 g++ 中添加一个标志来编译 apache: -I/usr/local/include

这是我使用的所有变量:

ARCH="-arch x86_64 -mmacosx-version-min=10.7"
LDFLAGS="-O3 $ARCH"
CFLAGS="-O3 -fno-common $ARCH"
CXXFLAGS="-O3 -fno-common $ARCH"
CC="gcc $ARCH -I/usr/local/include"
CXX="gcc $ARCH -I/usr/local/include"
CPP="gcc -E"
CXXCPP="g++ -E »
于 2015-10-18T12:35:03.113 回答
0

实际上,您只需要提供标题。在此处下载 Openssl 源代码,然后复制到 /usr/local/include/,如下所示,

$ sudo cp -r include/openssl /usr/local/include/

那么一切都会正常工作。

于 2017-01-22T05:19:21.007 回答