Imported from ../lua-5.0.3.tar.gz.
[lua.git] / INSTALL
blob748c6861d009f9254a139fdb2994e352f412bbd8
1 This is Lua 5.0.
3 * Installation
4   ------------
5   Building Lua on a Unix system should be very easy:
7         1. Read "config" and edit it to suit your platform and needs.
8            We strongly recommend that you enable support for dynamic loading,
9            if your platform allows it.
10         2. Do "make".
11         3. If you want to install Lua in an "official" place in your system,
12            then do "make install". The official place and the way to install
13            files are defined in "config". You may have to be root to do this.
15   See below for instructions for Windows and other systems.
17 * What you get
18   ------------
19   If "make" succeeds, you get:
20         * an interpreter in ./bin/lua and a compiler in ./bin/luac;
21         * libraries in ./lib;
22         * include files in ./include.
23   These are the only directories you need for development.
25   There are man pages for lua and luac, in both nroff and html; a reference
26   manual in html in ./doc, some sample code in ./test, and some useful stuff
27   in ./etc. You don't need these directories for development.
29   See also the README files in the various subdirectories.
30   A convenient starting point is ./doc/readme.html.
32 * If you have problems (and solutions!)
33   -------------------------------------
34   If "make" fails, please let us know (lua@tecgraf.puc-rio.br).
35   If you make changes to "config" or to the Makefiles, please send them to us.
37 * Shared libraries
38   ----------------
39   If you are running Linux, do "make so" after "make" succeeds.
40   This will create shared libraries in ./lib.
41   To install those shared libraries in an official place, do "make soinstall".
43   If you want the interpreter and the compiler to use shared libraries,
44   then do "make sobin" too. You may want to do this before "make install".
46   If you only want the shared libraries, you may want to add -fPIC to MYCFLAGS
47   in "config". Also, you may need to run "ldconfig" as root.
49   You may need to include ./lib in the LD_LIBRARY_PATH environment variable
50   to link programs that use the shared libraries if you don't put them in the
51   official places with "make install". (You may need to use the full path.)
53   Building shared libraries in other systems is similar but details differ;
54   you may need to fix a few details in the top-level Makefile.
56 * Installation on Windows and other systems
57   -----------------------------------------------------
58   The instructions for building Lua on other systems machine depend on the
59   particular compiler you are using. The simplest way is to create a folder
60   with all .c and .h files, and then create projects for the core library,
61   the standard library, the interpreter, and the compiler, as follows:
63   core lib:     lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
64                 lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
65                 ltable.c ltests.c ltm.c lundump.c lvm.c lzio.c
67   standard lib: lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c
68                 lstrlib.c loadlib.c
70   interpreter:  core lib, standard lib, lua.c
72   compiler:     core lib, standard lib, luac.c print.c
73                 and also lopcodes.c (with LUA_OPNAMES defined) from core.
75   Of course, to use Lua as a library, you'll have to know how to create
76   and use libraries with your compiler.
78   Also, read "config" to see what can be customized at compilation time.
80 (end of INSTALL)