我正在从以下源代码编译openssl。。。
https://github.com/openssl/openssl
cd openssl
./config
make
sudo make install
然后我将.zshrc
文件设置为包含。。。
export OPENSSL_DIR=/usr/local
但是当我从postgres源目录运行./configure --with-openssl
时,我得到了
配置:错误:OpenSSL 需要库"crypto">
我缺少什么?
/usr/local/lib
的ls -af
显示。。。
-rwxr-xr-x 1 root wheel 2608216 Jun 22 13:34 libcrypto.1.1.dylib
-rwxr-xr-x 1 root wheel 3898256 Jun 17 08:47 libcrypto.3.dylib
-rw-r--r-- 1 root wheel 4258256 Jun 22 13:34 libcrypto.a
lrwxr-xr-x 1 root wheel 19 Jun 22 13:34 libcrypto.dylib -> libcrypto.1.1.dylib
我将configure命令更改为./configure --with-openssl --with-includes=/usr/local/include --with-libraries=/usr/local/lib
。在我运行这个export LDFLAGS="-L/usr/local/lib"
之前,它可能有帮助,也可能没有帮助。现在它似乎奏效了。
在MacOS上,以下步骤对我有效。
brew install openssl-devel
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
./configure --with-openssl
./configure --with-openssl > log
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
postgresql-12.7 % tail log
config.status: src/include/pg_config.h is unchanged
config.status: creating src/include/pg_config_ext.h
config.status: src/include/pg_config_ext.h is unchanged
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: src/interfaces/ecpg/include/ecpg_config.h is unchanged
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/darwin.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.darwin to src/Makefile.port
sudo make install
我在MacOS 上也遇到了这个问题
configure: error: library 'crypto' is required for OpenSSL
它对我有效
ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/lib/