INSTALL 3.8 KB

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