Compile curl with openssl

curlopenssl

I'm trying to compile curl with openssl support and though I've tried for hours I still cannot figure out what I'm doing wrong.
Here's what I did:

  1. compile openssl like this:
    cd /usr/local/install/openssl-1.0.2a
    ./config
    make
    make install

  2. try to compile curl

    cd /usr/local/install/curl-7.42.1
    ./configure –with-ssl=/usr/local/ssl/
    make

and I get this error:

/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against '.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value

collect2: error: ld returned 1 exit status

Best Answer

I finally found a way to compile curl, this is what worked for me:
openssl:

./config -fPIC no-gost no-shared no-zlib
make depend
make
make install 

curl:

./configure  --with-ssl=/usr/local/ssl
make 
make install