Compile OpenSSL with the 'shared' option? Compile OpenSSL with the 'shared' option? apache apache

Compile OpenSSL with the 'shared' option?


Same problem here, BUT usually Makefiles will consider environment variables for compiler or linker options.

So, if you place the -fPIC option before calling the configure script, it should take care of it. You can do it with:

CFLAGS=-fPIC ./config shared --prefix=/your/path

or

export CFLAGS=-fPIC./config shared --prefix=/your/path

It worked for me.


There is an option -fXXX that you can pass to config so you can do it with:

./config -fPIC shared


Compiling openssl

Download your openssl tarball, unzip, and then ensure that the install directory is named openssl.

I placed mine in /usr/local/openssl, so I'll use that in my example.

  1. sudo mv openssl-1.0.2u /usr/local/openssl && cd /usr/local/openssl

  2. sudo make distclean

  3. sudo ./config -fPIC -shared

  4. sudo make && sudo install

    Now, add the openssl shared library to your PATH.

  5. vim ~/.profile Go export PATH="/usr/local/openssl/lib:$PATH" :wq