Datasheet

Save the file as build.bat in the c:\dev\lua-5.1.1\src directory. While you’re still in Lua’s src
directory, invoke this batch file to build Lua:
.\build
The batch script generates three files: lua.exe, luac.exe, and lua5.1.dll. You can verify that they
use only standard Windows libraries as follows:
If you have installed the MSYS tools, replace
find with grep.
objdump -x lua.exe | find “DLL Name”
This will print the following import references:
DLL Name: KERNEL32.dll
DLL Name: msvcrt.dll
DLL Name: lua5.1.dll
You can repeat this for luac.exe and lua5.1.dll. Notice that luac.exe does not depend on
lua5.1.dll.
Install the three files in your utility directory as follows:
xcopy lua.exe “%UTIL_DIR%\*.*” /y
xcopy luac.exe “%UTIL_DIR%\*.*” /y
xcopy lua5.1.dll “%UTIL_DIR%\*.*” /y
Binary Packages
Unlike source code that can conform to a wide spectrum of environments, binary applications (that is,
those that have already been compiled) function only in a particular niche. Binary packages need to dis-
tinguish a number of factors, including the following:
Operating system (such as AIX, Solaris, Linux, or Windows)
Hardware architecture (such as 32-bit versus 64-bit or Intel versus PowerPC)
Required C runtime library (such as the various versions of the Microsoft Visual C runtime
library)
These are mostly issues that you don’t have to be concerned with when compiling Lua from source code,
but you do need to pay attention to when the packages are precompiled. Despite the plethora of different
platforms, there is a good chance that you can find a binary package for your particular environment.
Selecting a Prebuilt Binary Package
To acquire a Lua package precompiled for your platform, visit LuaForge (http://luaforge.net/), a web
site devoted to open-source projects created and maintained by members of the growing Lua community.
18
Chapter 1: Getting Situated
04_069172 ch01.qxp 1/2/07 7:53 PM Page 18