INSTALL 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. INSTALL for Lua 5.1
  2. * Building Lua
  3. ------------
  4. Lua is built in the src directory, but the build process can be
  5. controlled from the top-level Makefile.
  6. Building Lua on Unix systems should be very easy. First do "make" and
  7. see if your platform is listed. If so, just do "make xxx", where xxx
  8. is your platform name. The platforms currently supported are:
  9. ansi bsd generic linux macosx mingw posix solaris
  10. See below for customization instructions and for instructions on how
  11. to build with other Windows compilers.
  12. If you want to check that Lua has been built correctly, do "make test"
  13. after building Lua. Also, have a look at the example programs in test.
  14. * Installing Lua
  15. --------------
  16. Once you have built Lua, you may want to install it in an official
  17. place in your system. In this case, do "make install". The official
  18. place and the way to install files are defined in Makefile. You must
  19. have the right permissions to install files.
  20. If you want to build and install Lua in one step, do "make xxx install",
  21. where xxx is your platform name.
  22. If you want to install Lua locally, then do "make local". This will
  23. create directories bin, include, lib, man, and install Lua there as
  24. follows:
  25. bin: lua luac
  26. include: lua.h luaconf.h lualib.h lauxlib.h lua.hpp
  27. lib: liblua.a
  28. man/man1: lua.1 luac.1
  29. These are the only directories you need for development.
  30. There are man pages for lua and luac, in both nroff and html, and a
  31. reference manual in html in doc, some sample code in test, and some
  32. useful stuff in etc. You don't need these directories for development.
  33. If you want to install Lua locally, but in some other directory, do
  34. "make install INSTALL_TOP=xxx", where xxx is your chosen directory.
  35. See below for instructions for Windows and other systems.
  36. * Customization
  37. -------------
  38. Three things can be customized by editing a file:
  39. - Where and how to install Lua -- edit Makefile.
  40. - How to build Lua -- edit src/Makefile.
  41. - Lua features -- edit src/luaconf.h.
  42. You don't actually need to edit the Makefiles because you may set the
  43. relevant variables when invoking make.
  44. On the other hand, if you need to select some Lua features, you'll need
  45. to edit src/luaconf.h. The edited file will be the one installed, and
  46. it will be used by any Lua clients that you build, to ensure consistency.
  47. We strongly recommend that you enable dynamic loading. This is done
  48. automatically for all platforms listed above that have this feature
  49. (and also Windows). See src/luaconf.h and also src/Makefile.
  50. * Building Lua on Windows and other systems
  51. -----------------------------------------
  52. If you're not using the usual Unix tools, then the instructions for
  53. building Lua depend on the compiler you use. You'll need to create
  54. projects (or whatever your compiler uses) for building the library,
  55. the interpreter, and the compiler, as follows:
  56. library: lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
  57. lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
  58. ltable.c ltm.c lundump.c lvm.c lzio.c
  59. lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
  60. ltablib.c lstrlib.c loadlib.c linit.c
  61. interpreter: library, lua.c
  62. compiler: library, luac.c print.c
  63. If you use Visual Studio .NET, you can use etc/luavs.bat
  64. in its "Command Prompt".
  65. If all you want is to build the Lua interpreter, you may put all .c files
  66. in a single project, except for luac.c and print.c. Or just use etc/all.c.
  67. To use Lua as a library in your own programs, you'll need to know how to
  68. create and use libraries with your compiler.
  69. As mentioned above, you may edit luaconf.h to select some features before
  70. building Lua.
  71. (end of INSTALL)