1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/docs/building.txt
2008-08-04 12:08:24 +00:00

72 lines
3.5 KiB
Plaintext

(NOTE: view this file with a monospaced font)
01. Building eLua
================================================================================
To build eLua you'll need:
- a GCC/Newlib toolchain for your target (see http://elua.berlios.de for
instructions on how to build your own toolchain). 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.
- Linux. Compiling under windows should be possible, however this isn't tested.
I'm using Ubuntu, so I'm also using "apt-get". If you're using a distro with a
different package manager you'll need to translate the "apt-get" calls to your
specific distribution.
- python. It should be already installed; if it's not:
$ sudo apt-get install python
- scons. eLua uses scons instead of make and makefiles, because I 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
For each platform, eLua assumes a certain name for the compiler/linker/assembler
executable files, as shown below.
================================================================================
| Tool | Compiler | Linker | Assembler |
|------------|---------------------|----------------------|--------------------|
| Platform | | | |
|============|=====================|======================|====================|
| ARM (all) | arm-elf-gcc | arm-elf-gcc | arm-elf-gcc |
|============|=====================|======================|====================|
| i386 | i686-elf-gcc | i686-elf-gcc | nasm |
|============|=====================|======================|====================|
| Cortex-M3 | arm-elf-gcc | arm-elf-gcc | arm-elf-gcc |
================================================================================
If your toolchain uses different names, you have to modify the "conf.py" file
from src/platform/<your platform>.
To build, go to the directory where you unpacked your eLua distribution and
invoke scons:
$ scons [target=<lua|lualong>]
[cpu=<at91sam7x256|at91sam7x512|i386|str912fw44|lm3s8962>]
[prog]
- target=lua | lualong: specify if you want to build full Lua (with floating point
support) or integer only Lua (lualong). The default is "lua".
- cpu=at91sam7x256 | at91sam7x512 | i386 | str912fw44 | lm3s8962: specify what
CPU to build for.
- prog: by default, the above 'scons' command will build only the 'elf' file.
Specify "prog" to build also the platform-specific programming file where
appropriate (for example, on a AT91SAM7X256 this results in a .bin file that
can be programmed in the CPU).
The output will be a file named elua_<target>_<cpu>.elf (and also another
file with the same name but ending in .bin if "prog" was specified for platforms
that need .bin files for programming).
If you want the equivalent of a "make clean", invoke "scons" as shown above,
but add a "-c" at the end of the command line.