Building eLua in Linux

Building eLua in Linux

Building eLua in Linux is fairly easy. This tutorial assumes that Ubuntu is used for building, however any distro should be fine, you just need to convert the "apt-get" calls to your distro’s package manager equivalent. You need a few packages installed to build eLua:

  • a toolchain: check the toolchains page for toolchain instructions. Please note that even if you already have a compiled toolchain, the differences in the Newlib configure flags (mainly the --disable-newlib-supplied-syscalls flags) might prevent eLua for building properly on your machine.

  • Python: it should be already installed. If it’s not, use apt-get to install it:

    $ sudo apt-get install python
  • scons - eLua uses scons instead of make and makefiles, because we find scons much more "natural" and easier to use than make. To install it:

    $ sudo apt-get install scons
  • your toolchain’s "bin" directory (this is generally something like /usr/local/cross-arm/bin, where /usr/local/cross-arm is the directory in which you installed your toolchain) must be in $PATH.

  • if you’re building for the i386 platform, you’ll also need "nasm":

    $ sudo apt-get install nasm
  • gcc: if you want to use the ROMFS precompile feature (see here for details) you need to build an image of the eLua cross compiler, and you need an i386 toolchain for this. It should be already installed, but if you want to be on the safe side do this:

    sudo apt-get install build-essential

    Then build the eLua cross compiler by executing this command:

    scons -f cross-lua.py

After you setup your build environment as described above, follow this tutorial to build your eLua image.