2

I'm trying to compile wget with static linking, but I'm running into a problem with ssl. My setup doesn't have ssl installed, so I had to compile it myself, it seemed to go ok, and this is the listing of /usr/local/ssh/lib:

/usr/local/ssl/lib> ls -la
total 2000
drwxr-xr-x  3 root root    4096 2012-03-22 14:28 .
drwxr-xr-x  9 root root    4096 2012-03-22 14:28 ..
-rw-r--r--  1 root root 1752954 2012-03-22 14:28 libcrypto.a
-rw-r--r--  1 root root  272388 2012-03-22 14:28 libssl.a
drw-r--r--  2 root root    4096 2012-03-22 14:28 pkgconfig

When trying to configure the compilation:

wget-1.13> env LDFLAGS="-L/usr/local/ssh/lib" ./configure --with-ssl=openssl
.....
configure: error. openssl development libraries not found 

Any hints what might be wrong ? I compiled openssl for linux-elf

julumme
  • 2,326
  • 2
  • 25
  • 38

1 Answers1

3

Ok, looks like it's classical "can't read own writing" problem. Above I was trying to link to ssh library, not ssl O_o.

For future reference, correct procedure to link and compile a static wget with openssl is:

$>env CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib" ./configure --with-ssl=openssl

Include could be ie: ~/openssl/openssl-0.9.8u/include (headers for the openssl that was compiled) library could be in ie: usr/local/ssl/lib (folder containing libssl.a)

Then compiling:

$>make CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib -all-static"

Binary will be in the src folder.

Note that on some systems the -all-static option should be just -static.

julumme
  • 2,326
  • 2
  • 25
  • 38
  • Can you check https://stackoverflow.com/questions/44716613/compiling-wget-with-static-linking? Tnx. – mpapec Jun 23 '17 at 08:27