summaryrefslogtreecommitdiff
path: root/INSTALL
blob: 0ddd37e0cff27805ef61b1ad1bc9f02aee81cb55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
This is Lua 5.1 (work).

* Installation
  ------------
  Building Lua on a Unix system should be very easy: simply doing "make"
  should work. This will build Lua in the src directory.

  See below for customization instructions. We strongly recommend that
  you enable dynamic loading.

  If you want to install Lua in an official place in your system, then
  do "make install". The official place and the way to install files are
  defined in Makefile. You must have the right permissions to install files.

  If you want to install Lua locally, then do "make local". This will
  create directories bin, include, lib, man, and install Lua there as
  follows:

    bin:	lua luac
    include:	lua.h luaconf.h lualib.h lauxlib.h
    lib:	liblua.a
    man/man1:	lua.1 luac.1

  These are the only directories you need for development.

  There are man pages for lua and luac, in both nroff and html, and a
  reference manual in html in ./doc, some sample code in ./test, and some
  useful stuff in ./etc. You don't need these directories for development.

  See below for instructions for Windows and other systems.

* Customization
  -------------
  Three things can be customized by editing a file:
    - Where and how to install Lua -- edit Makefile.
    - How to build Lua -- edit src/Makefile.
    - Lua features -- edit src/luaconf.h.

  You don't actually need to edit the Makefiles because you may set the
  relevant variables when invoking make.

  On the other hand, if you need to select some Lua features, you'll need
  to edit src/luaconf.h. The edited file will be the one installed, and
  it will be used by any Lua clients that you build, to ensure consistency.

* Installation on Windows and other systems
  -----------------------------------------
  The instructions for building Lua on other systems depend on the compiler
  you use. You'll need to create projects (or whatever your compiler uses)
  for building the library, the interpreter, and the compiler, as follows:

  library:	lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
		lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
		ltable.c ltm.c lundump.c lvm.c lzio.c
		lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
		ltablib.c lstrlib.c loadlib.c linit.c

  interpreter:	library, lua.c

  compiler:	library, luac.c print.c

  If all you want is to build the Lua interpreter, you may put all .c files
  in a single project, except for luac.c and print.c.

  To use Lua as a library in your own programs, you'll need to know how to
  create and use libraries with your compiler.

  As mentioned above, you may edit luaconf.h to select some features before
  building Lua.

(end of INSTALL)