1

I am trying to install openssl by source I run:

wget  wget ftp://ftp.openssl.org/source/openssl-1.0.2g.tar.gz
tar xvzf openssl-1.0.2g.tar.gz
cd openssl-1.0.2g
./config --prefix=/home/david/project shared 
make depend
make test
make install
make

It fails after make test is executed with:

make[2]: Leaving directory `/home/david/project/openssl-1.0.1s'
make[2]: Entering directory `/home/david/project/openssl-1.0.1s/test'
/usr/bin/ld: cannot find -lssl
collect2: ld returned 1 exit status
make[2]: *** [link_app.gnu] Error 1
make[2]: Leaving directory `/home/david/project/openssl-1.0.1s/test'
make[1]: *** [bntest] Error 2
make[1]: Leaving directory `/home/david/project/openssl-1.0.1s/test'
make: *** [tests] Error 2

How can libssl-dev be installed from source since I am not using package manager ?


EDIT. I had:

[root@localhost lib64]# ls -l libssl*
-rwxr-xr-x. 1 root root 258456 Dec 15 19:46 libssl3.so
lrwxrwxrwx. 1 root root     16 Feb 27 22:10 libssl.so.10 -> libssl.so.1.0.1e
-rwxr-xr-x. 1 root root 441240 Jan  8 14:45 libssl.so.1.0.1e

and added:

[root@localhost lib64]# ls -l libssl*
-rwxr-xr-x. 1 root root 258456 Dec 15 19:46 libssl3.so
lrwxrwxrwx. 1 root root     16 Mar 18 16:24 libssl.so -> libssl.so.1.0.1e
lrwxrwxrwx. 1 root root     16 Feb 27 22:10 libssl.so.10 -> libssl.so.1.0.1e
-rwxr-xr-x. 1 root root 441240 Jan  8 14:45 libssl.so.1.0.1e

How could I get round having to add the symbolic link ? Is there something I could do as an install option ?

1 Answer 1

0

./config --prefix=/home/david/project shared

I don't normally use PREFIX. I would recommend using OPENSSLDIR since OpenSSL configure supports the option:

wget ftp://ftp.openssl.org/source/openssl-1.0.2g.tar.gz
tar xvzf openssl-1.0.2g.tar.gz
cd openssl-1.0.2g
./config shared no-ssl2 no-ssl3 no-comp --openssldir=/home/david/project 

make depend
make test
make install

Also, you seem to have an extra make. I'm guessing you probably don't need it. What purpose does it serve?

make depend
make test
make install
make

Also, you can probably avoid installing the man pages locally, and just use make install_sw:

make depend
make test
make install_sw

You should also consider using an RPATH to make sure you avoid runtime linking problems:

export MYPATH=/home/david/project 
./config shared no-ssl2 no-ssl3 no-comp -Wl,-rpath=${MYPATH}/lib --openssldir=${MYPATH}

EDIT. I had...

Before you begin installing into an existing installation directory, you should probably just delete the old local installation:

export MYPATH=/home/david/project
rm -rf ${MYPATH}

./config shared no-ssl2 no-ssl3 no-comp -Wl,-rpath=${MYPATH}/lib --openssldir=${MYPATH}
make
make test
make install_sw

Also see Compilation and Installation on the OpenSSL wiki. It discusses PREFIX, OPENSSLDIR and RPATHs. It also discusses other configuration options, like no-ssl2, no-ssl3 and no-comp.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .