Download :
 - openssh6.8p1.tar.gz from http://ftp.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.8p1.tar.gz 
 - openssl1.0.2g.tar.gz from https://www.openssl.org/source/openssl-1.0.2g.tar.gz or ftp://ftp.openssl.org/source/openssl-1.0.2g.tar.gz
Note: Very important to compile in /tmp and not in a home directory or it may cause NFS lookups when executing ssh

Compilation machines: 
 - for solaris/sparc, works on esekits3013.rnd.ki.sw.ericsson.se (solaris 8) with module add gcc/3.4.6 && module add zlib/1.2.3  && module add make/3.80 (or gmake), 
 - for linux 32, works on esekilxxen1230.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 
 - for linux 64, works on esekilxxen1250.rnd.ericsson.se (64-bit machine with old linux version 2.6.16 and old libc 2.4) 
 - for solaris/x86, works on eswki51komp.rnd.ki.sw.ericsson.se

cd /tmp
rm -rf openssh-6.8p1
rm -rf openssl-1.0.2g
gzip -df openssh-6.8p1.tar.gz && tar xf openssh-6.8p1.tar
gzip -df openssl-1.0.2g.tar.gz && tar xf openssl-1.0.2g.tar

setenv CC gcc
export CC=gcc


Solaris/sparc: module add gcc/3.4.6 && module add zlib/1.2.3  && module add gmake
cd /tmp/openssl-1.0.2g
cp ~/moshell/commonjars/src/openssh/sshmods/ssl/ssl.h ssl/ssl.h
cp ~/moshell/commonjars/src/openssh/sshmods/apps/* apps
Solaris/x86:   ./Configure solaris-x86-gcc && make
Solaris/sparc: ./config && make
Cygwin:        ./config && make
Linux:         ./config -fPIC shared && make depend && make

cd /tmp/openssh-6.8p1
cp ~/moshell/commonjars/src/openssh/sshmods/ssh/* .
Cygwin:        ./configure --with-ssl-dir=../openssl-1.0.2g && make
Solaris/sparc: ./configure --with-ssl-dir=../openssl-1.0.2g --without-zlib-version-check && make
Solaris/x86:   ./configure --with-ssl-dir=../openssl-1.0.2g  && make 
Linux:         env LD_LIBRARY_PATH=../openssl-1.0.2g ./configure --with-ssl-dir=../openssl-1.0.2g && make

Keep the following files and store them in the following locations, with the correct extension (.solaris, .sol86, .linux, .lin64, .exe)
/tmp/openssh-6.8p1/ssh            -> moshell/commonjars
/tmp/openssh-6.8p1/sftp           -> moshell/commonjars
/tmp/openssh-6.8p1/sshd           -> moshell/commonjars
/tmp/openssh-6.8p1/sftp-server    -> moshell/commonjars
/tmp/openssh-6.8p1/scp            -> moshell/commonjars
/tmp/openssl-1.0.2g/apps/openssl  -> moshell/commonjars
On linux, and lin64:
/tmp/openssl-1.0.2g/libssl.so.1.0.0     -> moshell/commonjars/lib/<os>
/tmp/openssl-1.0.2g/libcrypto.so.1.0.0  -> moshell/commonjars/lib/<os>
No shared libraries on cygwin and solaris (statically compiled)


Also strip them to save space

update mos2emInfo["ssh_version"] in moshell/prog.awk




#Not needed anymore on solaris/x86 (or because already done on iov86?)
#First, patch the gcc compiler by downloading the file www.openssl.org/~appro/values.c and store under /tmp/openssl-1.0.0a
#Then run: ksh -f values.c gcc
