macOS 自带的 OpenSSL 包的头文件和库在哪里?
Where are the header files & libraries of the OpenSSL package that comes with macOS?
我刚刚安装了 macOS Catalina 版本 10.15.4 (19E287)。
它安装了 OpenSSL(实际上是 LibreSSL)。
$ openssl version
LibreSSL 2.6.5
我正在从源 "with support for SSL (encrypted) connections" 安装 PostgreSQL,方法是向 configure
提供 --with-openssl
命令行选项。
--with-openssl
Build with support for SSL (encrypted) connections. This
requires the OpenSSL package to be installed. "configure" will
check for the required header files and libraries to make sure
that your OpenSSL installation is sufficient before proceeding.
那么我应该告诉编译器在哪里寻找 "required header files and libraries"?
即,我将 --with-includes
和 --with-libraries
命令行选项设置为 configure
什么?
--with-includes=DIRECTORIES
"DIRECTORIES" is a colon-separated list of directories that will
be added to the list the compiler searches for header files. If
you have optional packages (such as GNU Readline) installed in a
non-standard location, you have to use this option and probably
also the corresponding "--with-libraries" option.
Example: --with-includes=/opt/gnu/include:/usr/sup/include.
--with-libraries=DIRECTORIES
"DIRECTORIES" is a colon-separated list of directories to search
for libraries. You will probably have to use this option (and
the corresponding "--with-includes" option) if you have packages
installed in non-standard locations.
Example: --with-libraries=/opt/gnu/lib:/usr/sup/lib.
我不想使用 Homebrew。如果必须的话,我宁愿从源代码安装 LibreSSL。
它们不再存在,因为它已被弃用。您要么包含自己的库,要么如果您想 link 针对 macOS 自己的库(libssl
& libcrypto
),您应该使用此版本的相应头文件。您可以从 Apple here.
找到来源
我刚刚安装了 macOS Catalina 版本 10.15.4 (19E287)。
它安装了 OpenSSL(实际上是 LibreSSL)。
$ openssl version
LibreSSL 2.6.5
我正在从源 "with support for SSL (encrypted) connections" 安装 PostgreSQL,方法是向 configure
提供 --with-openssl
命令行选项。
--with-openssl Build with support for SSL (encrypted) connections. This requires the OpenSSL package to be installed. "configure" will check for the required header files and libraries to make sure that your OpenSSL installation is sufficient before proceeding.
那么我应该告诉编译器在哪里寻找 "required header files and libraries"?
即,我将 --with-includes
和 --with-libraries
命令行选项设置为 configure
什么?
--with-includes=DIRECTORIES "DIRECTORIES" is a colon-separated list of directories that will be added to the list the compiler searches for header files. If you have optional packages (such as GNU Readline) installed in a non-standard location, you have to use this option and probably also the corresponding "--with-libraries" option. Example: --with-includes=/opt/gnu/include:/usr/sup/include. --with-libraries=DIRECTORIES "DIRECTORIES" is a colon-separated list of directories to search for libraries. You will probably have to use this option (and the corresponding "--with-includes" option) if you have packages installed in non-standard locations. Example: --with-libraries=/opt/gnu/lib:/usr/sup/lib.
我不想使用 Homebrew。如果必须的话,我宁愿从源代码安装 LibreSSL。
它们不再存在,因为它已被弃用。您要么包含自己的库,要么如果您想 link 针对 macOS 自己的库(libssl
& libcrypto
),您应该使用此版本的相应头文件。您可以从 Apple here.