Compiling OpenSSL and libssh2 with emscripten – notes
Make sure emscripten is setup and on the path. First, get openssl and libssh2 configured:
1 2 3 4 5 6 | export CC=emcc wget https: //www .openssl.org /source/openssl-1 .0.1j. tar .gz tar xvzf openssl-1.0.1j. tar .gz cd openssl-1.0.1j . /Configure -no-asm -no-apps android make |
1 2 3 4 5 | git clone git: //git .libssh2.org /libssh2 .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 make |
Compile some code!
1 2 | 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:
1 2 | me@laptop:~/gitcode/jterm/libssh2/example$ nodejs ./a.out.js 127.0.0.1 user password failed to connect! |