Difference between revisions of "Lua"

From Chumby Wiki
Jump to: navigation, search
(Building lua)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
=Building lua=
 
=Building lua=
  
* download and unpack the lua source distribution [http://www.lua.org/ftp/lua-5.1.2.tar.gz lua-5.1.2.tar.gz].
+
* download and unpack the lua source distribution [http://www.lua.org/ftp/lua-5.1.4.tar.gz lua-5.1.4.tar.gz].
* edit src/Makefile
+
* edit <code>src/Makefile</code>
 
** line 10 <pre>CC=arm-linux-gcc</pre>
 
** line 10 <pre>CC=arm-linux-gcc</pre>
 
** line 12 <pre>AR=arm-linux-ar</pre>
 
** line 12 <pre>AR=arm-linux-ar</pre>
 
** line 13 <pre>RANLIB=arm-linux-ranlib</pre>
 
** line 13 <pre>RANLIB=arm-linux-ranlib</pre>
 +
** line 15 <pre>LIBS= -lm $(MYLIBS) -static</pre>
 
** line 99, remove '''-lreadline -lhistory -lncurses'''
 
** line 99, remove '''-lreadline -lhistory -lncurses'''
* edit src/luaconf.h, comment out line 39 (disable LUA_USE_READLINE)
+
* edit <code>src/luaconf.h</code>, comment out line 39 (disable LUA_USE_READLINE)
 
* do:
 
* do:
 
   make linux
 
   make linux
* copy src/lua to a USB dongle and mount it on the chumby
+
  arm-linux-strip src/lua
 +
* copy <code>src/lua</code> to a USB dongle and mount it on the chumby
 
* run lua programs - there are example programs in the "test/" directory
 
* run lua programs - there are example programs in the "test/" directory
  
 
=Too lazy?=
 
=Too lazy?=
Download a prebuilt executable for chumby from [http://files.chumby.com/languages/lua/lua.tgz here].
+
Download a prebuilt executable for chumby from [http://files.chumby.com/languages/lua/lua_chumby_1.7.tar.gz here].

Latest revision as of 15:19, 30 May 2009

Lua is a lightweight scripting language - see the Lua website

Building lua

  • download and unpack the lua source distribution lua-5.1.4.tar.gz.
  • edit src/Makefile
    • line 10
      CC=arm-linux-gcc
    • line 12
      AR=arm-linux-ar
    • line 13
      RANLIB=arm-linux-ranlib
    • line 15
      LIBS= -lm $(MYLIBS) -static
    • line 99, remove -lreadline -lhistory -lncurses
  • edit src/luaconf.h, comment out line 39 (disable LUA_USE_READLINE)
  • do:
 make linux
 arm-linux-strip src/lua
  • copy src/lua to a USB dongle and mount it on the chumby
  • run lua programs - there are example programs in the "test/" directory

Too lazy?

Download a prebuilt executable for chumby from here.