Skip to content

Instantly share code, notes, and snippets.

@artman41
Created June 20, 2023 22:56
Show Gist options
  • Save artman41/07f456556d8269e66dbf2e3ee59ca9c0 to your computer and use it in GitHub Desktop.
Save artman41/07f456556d8269e66dbf2e3ee59ca9c0 to your computer and use it in GitHub Desktop.
Compile erlang for Remarkable
#!/bin/bash
# This script assume that:
# * You have installed the toolchain in the default location
# * You are using toolchain 3.1.15 for rm11x
set -x
export CC=clang;
export CXX=clang;
export CFLAGS="-g -O3 -fstack-protector"
export LDFLAGS="-fstack-protector"
export KERL_CONFIGURE_OPTIONS="--enable-bootstrap-only"
__ERL_VSN="26.0"
__DIRNAME="26.0-rm11";
if ! [[ -d "~/.kerl/builds/$__DIRNAME" ]]; then
kerl build $__ERL_VSN $__DIRNAME;
fi;
. /opt/codex/rm11x/3.1.15/environment-setup-cortexa7hf-neon-remarkable-linux-gnueabi
export erl_xcomp_sysroot="$OECORE_TARGET_SYSROOT"
export erl_xcomp_isysroot="$OE_QMAKE_INCDIR_QT"
export erl_xcomp_host="$(echo $CONFIGURE_FLAGS | sed -n 's|.*--target=\([a-z\-]*\) .*|\1|p')"
export erl_xcomp_build="$(echo $CONFIGURE_FLAGS | sed -n 's|.*--build=\([a-z0-9\_\-]*\).*|\1|p')"
bash -c "cd ~/.kerl/builds/${__DIRNAME}/otp_src_${__ERL_VSN}; ./configure $CONFIGURE_FLAGS && make"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment