Skip to content

Instantly share code, notes, and snippets.

@Potherca
Last active April 13, 2024 16:05
Show Gist options
  • Save Potherca/866dfc72de9bfe0fc5627945446826a6 to your computer and use it in GitHub Desktop.
Save Potherca/866dfc72de9bfe0fc5627945446826a6 to your computer and use it in GitHub Desktop.

Revisions

  1. Potherca revised this gist Nov 20, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion compile-lynx-wasm.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    # Sources used in figuring this out:
    #
    # - https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm
    # - https://emscripten.org/docs/compiling/Building-Projects.html#building-projects

    # Set up Emscripten SDK
    git clone https://github.com/emscripten-core/emsdk.git
    cd emsdk/
    @@ -23,4 +28,4 @@ make

    # Compile Lynx with EMScripten
    emconfigure ./configure --with-ssl
    emconfigure ./configure --with-ssl --with-build-cc
    emmake make
  2. Potherca created this gist Nov 20, 2020.
    26 changes: 26 additions & 0 deletions compile-lynx-wasm.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Set up Emscripten SDK
    git clone https://github.com/emscripten-core/emsdk.git
    cd emsdk/
    ./emsdk install latest
    ./emsdk activate latest
    source ./emsdk_env.sh

    # Test compile so we know EMScripten works
    cd -
    wget https://raw.githubusercontent.com/emscripten-core/emscripten/master/src/shell_minimal.html
    wget https://gist.github.com/Potherca/89a4ce1f018c7d39a6fa0320673c8d57/raw/hello3.c
    emcc -o hello3.html hello3.c -O3 -s WASM=1 --shell-file shell_minimal.html -s NO_EXIT_RUNTIME=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']"

    # Compile Lynx so we know that works
    sudo touch /usr/local/etc/lynx.cfg && sudo chown $USER /usr/local/etc/lynx.cfg
    sudo touch /usr/local/etc/lynx.lss && sudo chown $USER /usr/local/etc/lynx.lss
    wget https://invisible-mirror.net/archives/lynx/tarballs/lynx2.9.0dev.6.zip
    unzip lynx2.9.0dev.6.zip
    cd ../lynx2.9.0dev.6/
    ./configure --with-ssl
    make
    ./lynx https://invisible-mirror.net/archives/lynx/tarballs/

    # Compile Lynx with EMScripten
    emconfigure ./configure --with-ssl
    emconfigure ./configure --with-ssl --with-build-cc