{"id":1796,"date":"2014-12-23T12:51:51","date_gmt":"2014-12-23T12:51:51","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1796"},"modified":"2014-12-26T00:15:31","modified_gmt":"2014-12-26T00:15:31","slug":"compiling-openssl-libssh2-emscripten-notes","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2014\/12\/compiling-openssl-libssh2-emscripten-notes\/","title":{"rendered":"Compiling OpenSSL and libssh2 with emscripten &#8211; notes"},"content":{"rendered":"<p>Make sure <a href=\"http:\/\/41j.com\/blog\/2014\/11\/debian-jessie-emscripten-installation-notes\/\">emscripten is setup and on the path<\/a>. First, get openssl and libssh2 configured:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nexport CC=emcc\r\nwget https:\/\/www.openssl.org\/source\/openssl-1.0.1j.tar.gz\r\ntar xvzf openssl-1.0.1j.tar.gz\r\ncd openssl-1.0.1j\r\n.\/Configure -no-asm -no-apps android\r\nmake\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit clone git:\/\/git.libssh2.org\/libssh2.git \r\ncd libssh2\r\nexport CFLAGS=&quot;-I\/home\/new\/gitcode\/jterm\/openssl-1.0.1j\/include&quot;\r\n.\/configure --with-libssl-prefix=home\/new\/gitcode\/jterm\/openssl-1.0.1j\r\nmake\r\n<\/pre>\n<p>Compile some code!<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncd examples\r\nemcc ssh2.c -I..\/include -I..\/..\/openssl-1.0.1j\/include -lssh2 -lssl -lcrypto  -L..\/..\/openssl-1.0.1j -L..\/src\/.libs -static\r\n<\/pre>\n<p>Which results in a.out.js, but who knows if it does anything useful! I assume not! But it does run:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nme@laptop:~\/gitcode\/jterm\/libssh2\/example$ nodejs .\/a.out.js 127.0.0.1 user password\r\nfailed to connect!\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Make sure emscripten is setup and on the path. First, get openssl and libssh2 configured: 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 git clone git:\/\/git.libssh2.org\/libssh2.git cd libssh2 export CFLAGS=&quot;-I\/home\/new\/gitcode\/jterm\/openssl-1.0.1j\/include&quot; .\/configure &#8211;with-libssl-prefix=home\/new\/gitcode\/jterm\/openssl-1.0.1j make 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1796","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-sY","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1796"}],"version-history":[{"count":3,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1796\/revisions"}],"predecessor-version":[{"id":1807,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1796\/revisions\/1807"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}