Configure error in Mac OS X Lion 10.7 — Library &#

2019-08-08 10:42发布

问题:

Tried brew install postgres and got the following error:

datadir=/usr/local/Cellar/postgresql/9.2.4/share/postgresql --docdir=/usr/local/Cellar/postgresql
checking for library containing gss_init_sec_context... -lgssapi_krb5
checking for library containing com_err... none required
checking for library containing krb5_sendauth... none required
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL

OpenSSL seems to be installed correctly (I brew installed it, with no complaints, and brew doctor doesn't raise any flags about it), and my XCode developer tools are also up to date. Looked around for how to install crypto on a mac, (OS X Lion 10.7), and there are surprisingly few resources. Any ideas what's wrong or how to fix it?

I tried uninstalling/reinstalling OpenSSL.

回答1:

The problem ended up being based on an inexplicably empty libcrypto.dylib file. There was a backup (libcrypto.dylib.BAK), and I just overwrote the empty file with it and all the problems went away. No idea how that happened in the first place, but if anyone's having similar problems, I'd look for .BAK files in usr/lib/ and (if there are any) see if the associated files are empty.



回答2:

For cryptography, PostgreSQL use Zlib, so, you need to install Zlib headers in your Mac, to be able to compile it with crypto support. You can see an example but is for Ubuntu. You need to figure out how to install zlib in Mac:

To read more about the pgcrypto module, visit this link.