Download :
 - openssl1.0.2k.tar.gz from https://www.openssl.org/source/openssl-1.0.2k.tar.gz or ftp://ftp.openssl.org/source/openssl-1.0.2k.tar.gz
 - libssh2 1.7.0 from http://gask2web.ericsson.se/pub/get?DocNo=19012-11/CAX1053568
 - curl 7.52.1 from http://gask2web.ericsson.se/pub/get?DocNo=19012-37/CAX1053172
Store all the files in /tmp

Compilation machines: only compiled on linux 32bit for now
 - for linux 32, works on esekilxxen1231.rnd.ericsson.se (32-bit machine with old linux version 2.6.16 and old libc 2.4) with module add gcc/3.4.6 -> use old glibc to avoid problems when running on a old linux machine 

cd /tmp
rm -rf openssl-1.0.2k
gzip -df openssl-1.0.2k.tar.gz && tar xf openssl-1.0.2k.tar
cd /tmp/openssl-1.0.2k
cp ~/moshell/commonjars/src/openssh/patches/0001-Moshell-SSL-mods-1.0.2k.patch .
patch -p1 -i 0001-Moshell-SSL-mods-1.0.2k.patch
./config -fPIC shared && make depend && make

setenv CC gcc

Build libssh2
tar -xzf /tmp/19012-11_CAX1053568_X_A_UNIX_TAR_COMPRESS.tar.Z
cd /tmp/libssh2-1.7.0/
env CFLAGS="-m32 -I/tmp/openssl-1.0.2k/include" LIBS="-ldl" LDFLAGS="-L/tmp/openssl-1.0.2k" ./configure --with-openssl --enable-shared=no
make

cd /tmp
unzip 19012-37_CAX1053172_X_A_PKZIPV2R04.zip
tar -xf curl-7.52.1.tar.bz2
cd curl-7.52.1/
env CFLAGS="-m32" LIBS="-ldl" LDFLAGS="-L/tmp/openssl-1.0.2k -L/tmp/libssh2-1.7.0/src/.libs -static" ./configure --disable-debug --disable-curldebug --disable-ldap --disable-rtsp --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-libcurl-option --enable-ipv6 --disable-sspi --disable-ntlm-wb --with-ssl=/tmp/openssl-1.0.2k --with-libssh2=/tmp/libssh2-1.7.0
make

