如何使用 Conan 在 linux 上构建 openssl

How to build openssl on linux using Conan

这似乎是在 Linux 上从源代码构建 openssl 的最佳方式。但是,我找不到使用 -fPIC 和 -shared 构建它的方法(因为它将是链接的静态文件)。

版本:https://www.conan.io/source/OpenSSL/1.0.2g/lasote/stable

或者,我试图找到预构建的二进制文件,但我找不到任何图集。

您可以查看最新的 Conan 包配方 here, the prebuilt packages are in the conan-center 存储库,conan.io 存储库不再有效。

使用 fPIC 构建包的共享风格:

  1. 将柯南中心存储库添加到遥控器:

    conan remote add conan-center https://api.bintray.com/conan/conan/conan-center

  2. 在你的需求中指定最新的版本引用(比如你的conanfile.txt),指定共享选项:

[requires]
OpenSSL/1.0.2l@conan/stable
[options]
OpenSSL:shared=True
  1. 安装它。如果因为找不到预构建的二进制文件而出现错误,您可以使用 --build missing 参数
  2. 从源构建

conan install

您还可以在 Windows 中使用 VisualStudio、MinGW、OSX 使用 apple-clang、Linux 使用 gcc 构建它...完全相同的过程。

希望对您有所帮助。