Friday, September 7, 2012

Enable Lua scripting on TS-7260 board

Lua is a powerful, fast, lightweight, embeddable scripting language. I would like to use it on my TS-7260 board. I use the following steps:
  1. Download the latest Lua 5.2.1 source code and unzip it to local directory (c:/lua-5.2.1).
  2. Setup TS-Linux cross compilation environment in a cygwin shell as below:
  3. Since there is no readline support for TS-Linux, comment out line 46 of file src/luaconf.h to exclude LUA_USE_READLINE.
  4. Compile all C files of Lua as below:
  5. Build Lua shared library liblua.so.1.0.1 as below:
  6. Build Lua executable lua as below:
  7. Copy Lua shared library and Lua executable to TS-7260 board, place them is directory /lib and /usr/bin respectively.
  8. In directory /lib, enable executable permission and create a symbolic link for liblua.so.1.0.1 as below:
  9. In directory /usr/bin, enable executable permission for lua as below:
  10. Type "lua" in a TS-Linux bash shell and expect the following greeting from Lua:
  11. You are ready to run Lua script on TS-7260.

No comments:

Post a Comment