Compiling OpenSSL and libssh2 with emscripten – notes

Make sure emscripten is setup and on the path. First, get openssl and libssh2 configured:

export CC=emcc
tar xvzf openssl-1.0.1j.tar.gz
cd openssl-1.0.1j
./Configure -no-asm -no-apps android
git clone git:// 
cd libssh2
export CFLAGS="-I/home/new/gitcode/jterm/openssl-1.0.1j/include"
./configure --with-libssl-prefix=home/new/gitcode/jterm/openssl-1.0.1j

Compile some code!

cd examples
emcc ssh2.c -I../include -I../../openssl-1.0.1j/include -lssh2 -lssl -lcrypto  -L../../openssl-1.0.1j -L../src/.libs -static

Which results in a.out.js, but who knows if it does anything useful! I assume not! But it does run:

me@laptop:~/gitcode/jterm/libssh2/example$ nodejs ./a.out.js user password
failed to connect!

Comments are closed.