Lua-5.1.5

Introduction to Lua

Lua is a powerful light-weight programming language designed for extending applications. It is also frequently used as a general-purpose, stand-alone language. Lua is implemented as a small library of C functions, written in ANSI C, and compiles unmodified in all known platforms. The implementation goals are simplicity, efficiency, portability, and low embedding cost. The result is a fast language engine with small footprint, making it ideal in embedded systems too.

This package is known to build and work properly using an LFS-7.4 platform.

Package Information

  • Download (HTTP): http://www.lua.org/ftp/lua-5.1.5.tar.gz

  • Download MD5 sum: 2e115fe26e435e33b0d5c022e4490567

  • Download size: 217 KB

  • Estimated disk space required: 3.4 MB

  • Estimated build time: 0.1 SBU

Additional Downloads

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/lua

Installation of Lua

Install Lua by running the following commands:

patch -Np1 -i ../lua-5.1.5-shared_library-2.patch &&
sed -i '/#define LUA_ROOT/s:/usr/local/:/usr/:' src/luaconf.h &&
make linux

To test the results, issue: make test.

Now, as the root user:

make INSTALL_TOP=/usr TO_LIB="liblua.so liblua.so.5.1 liblua.so.5.1.5" \
     INSTALL_DATA="cp -d" INSTALL_MAN=/usr/share/man/man1 install &&
mkdir -pv /usr/share/doc/lua-5.1.5 &&
cp -v doc/*.{html,css,gif,png} /usr/share/doc/lua-5.1.5

Some packages check for the pkg-config file for Lua. As the root user:

cat > /usr/lib/pkgconfig/lua.pc << "EOF"
V=5.1
R=5.1.5

prefix=/usr
INSTALL_BIN=${prefix}/bin
INSTALL_INC=${prefix}/include
INSTALL_LIB=${prefix}/lib
INSTALL_MAN=${prefix}/man/man1
INSTALL_LMOD=${prefix}/share/lua/${V}
INSTALL_CMOD=${prefix}/lib/lua/${V}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires: 
Libs: -L${libdir} -llua -lm
Cflags: -I${includedir}
EOF

Command Explanations

sed -i ...: This command changes Lua search path to match the install paths.

Contents

Installed Programs: lua and luac
Installed Library: liblua.so
Installed Directories: /usr/lib/lua, /usr/share/lua and /usr/share/doc/lua-5.1.5

Short Descriptions

lua

is the standalone Lua interpreter.

luac

is the Lua compiler.

liblua.so

contains the Lua API functions.

Last updated on 2013-08-22 04:10:10 -0700