Eöl (ELF Object Loader) ris is a fully automatic, run-time, fast foreign function interface for native C libraries. It allows using existing libraries directly from Lua. Eöl uses the DWARF debugging information generated by C compilers.
Eöl is licensed under a MIT-style
license, see LICENSE
for the full text.
Eöl used to be called Eris, but the name was already used for the Eris persistence system for Lua. The change of name was done on 2015-08-01 to avoid module name clashes.
Eöl is tested and compatible with:
- Lua 5.3.1
- Lua 5.3.0
Building Eöl requires the following dependencies:
- A reasonable POSIX-ish operating system. Development is done using GNU/Linux, other systems might work (YMMV).
libdwarf
, version20140805
(or newer).libelf
, version0.161
(or newer).- Ninja (preferred), or GNU Make.
- (Optional) GNU
readline
.
Though GNU Autofoo is not used, care has been taken in following its conventions, so in order to build Eöl the following will work:
./configure
make
Or, using Ninja to do the build (preferred):
./configure
ninja
Once building has finished, it is possible to check that everything is working fine by running the test suite:
./run-tests
Once built, the eol
module can be used from Lua:
-- Find and load the readline library from the standard system directories.
local libreadline = require("eol").load("libreadline")
-- Obtain a handle to the readline() function, which allows calling it.
local readline = libreadline.readline
-- Read a line from standard input using readline() and echo it back.
print(readline("input: "))
For more examples, check the the samples/
subdirectory. Documentation
is available under the doc/
subdirectory. Run your favourite Markdown
processor on it to read the documentation in HTML.
Usage examples can be found in the examples/
subdirectory.
Some of the examples use third-party code, which needs to be built from sources. The needed sources are referenced from the repository as Git submodules, and the exact needed version will be fetched automatically. Note that the examples can only be built with Ninja at the moment:
git submodule update --recursive --init
ninja examples
Additional dependencies for the examples:
- OpenGL ES 2 (
libGLESv2
from Mesa will do). - GLFW3