unable to read opensslv.h:No such file or director

2019-08-12 13:48发布

问题:

I am getting the following error when I try to install OpenSSL version 1.0.1h on MAC OS (Mountain Lion) Terminal,

unable to read opensslv.h:No such file or directory

I am using the following command in the Terminal,

sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared

I am following the instructions on this link. What is wrong here?

回答1:

I am following the instructions on this link. What is wrong here?

You did not follow the instructions. It looks like you missed step 06:

06. cd into openssl-1.0.0c as follow...

sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared

Don't make with sudo. Try this:

/tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared
make -f /tmp/ssl/openssl-1.0.1h/Makefile
sudo make -f /tmp/ssl/openssl-1.0.1h/Makefile install

Its usually easier if you cd into /tmp/ssl/openssl-1.0.1h/ first. Then it reduces to:

tar xzf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared
make
sudo make install

You could also use the following to avoid memorizing the triplet:

export KERNEL_BITS=64
./config shared no-threads shared no-ssl2 ...

After make install, OpenSSL will be installed in /usr/local/ssl unless you change it with --openssldir or ––prefix.


sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared

––prefix=/usr is probably going to be a pain point for you. Apple ships with OpenSSL 0.9.8, which is not binary compatible with OpenSSL 1.0.1h. You should experience unexplained crashes and unexplained incorrect results once you replace the system's version of OpenSSL with your version.


Finally, before you sudo make install, you should make test to ensure everything is OK.