Welcome to Lua 5.2
about · installation · changes · license · reference manual
About Lua
Lua is a powerful, fast, lightweight, embeddable scripting language developed by a team at
PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. Lua is free software
used in many products and projects around the world.
Lua's official web site provides complete information about Lua, including an executive
summary and updated documentation, especially the reference manual, which may differ
slightly from the local copy distributed in this package.
Installing Lua
Lua is distributed in source form. You need to build it before using it. Building Lua should be
straightforward because Lua is implemented in pure ANSI C and compiles unmodified in all
known platforms that have an ANSI C compiler. Lua also compiles unmodified as C++. The
instructions given below for building Lua are for Unix-like platforms. See also instructions for
other systems and customization options.
If you don't have the time or the inclination to compile Lua yourself, get a binary from
LuaBinaries. Try also Lua for Windows, an easy-to-use distribution of Lua that includes many
useful libraries.
Building Lua
In most Unix-like platforms, simply do "make" with a suitable target. Here are the details.
1. Open a terminal window and move to the top-level directory, which is named lua-
5.2.2. The Makefile there controls both the build process and the installation process.
2. Do "make" and see if your platform is listed. The platforms currently supported are:
aix ansi bsd freebsd generic linux macosx mingw posix solaris
If your platform is listed, just do "make xxx", where xxx is your platform name.
If your platform is not listed, try the closest one or posix, generic, ansi, in this order.
3. The compilation takes only a few moments and produces three files in the src
directory: lua (the interpreter), luac (the compiler), and liblua.a (the library).
评论1