diff options
Diffstat (limited to 'doc/install.html')
-rw-r--r-- | doc/install.html | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/doc/install.html b/doc/install.html new file mode 100644 index 00000000..b7211d21 --- /dev/null +++ b/doc/install.html | |||
@@ -0,0 +1,216 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>Installation</title> | ||
5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | ||
6 | <meta name="Author" content="Mike Pall"> | ||
7 | <meta name="Copyright" content="Copyright (C) 2005-2009, Mike Pall"> | ||
8 | <meta name="Language" content="en"> | ||
9 | <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen"> | ||
10 | <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print"> | ||
11 | </head> | ||
12 | <body> | ||
13 | <div id="site"> | ||
14 | <a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a> | ||
15 | </div> | ||
16 | <div id="head"> | ||
17 | <h1>Installation</h1> | ||
18 | </div> | ||
19 | <div id="nav"> | ||
20 | <ul><li> | ||
21 | <a href="luajit.html">LuaJIT</a> | ||
22 | <ul><li> | ||
23 | <a class="current" href="install.html">Installation</a> | ||
24 | </li><li> | ||
25 | <a href="running.html">Running</a> | ||
26 | </li><li> | ||
27 | <a href="api.html">API Extensions</a> | ||
28 | </li></ul> | ||
29 | </li><li> | ||
30 | <a href="status.html">Status</a> | ||
31 | <ul><li> | ||
32 | <a href="changes.html">Changes</a> | ||
33 | </li></ul> | ||
34 | </li><li> | ||
35 | <a href="faq.html">FAQ</a> | ||
36 | </li><li> | ||
37 | <a href="http://luajit.org/download.html">Download <span class="ext">»</span></a> | ||
38 | </li></ul> | ||
39 | </div> | ||
40 | <div id="main"> | ||
41 | <p> | ||
42 | LuaJIT is only distributed as a source package. This page explains | ||
43 | how to build and install LuaJIT with different operating systems | ||
44 | and C compilers. | ||
45 | </p> | ||
46 | <p> | ||
47 | For the impatient (on POSIX systems): | ||
48 | </p> | ||
49 | <pre class="code"> | ||
50 | make && sudo make install | ||
51 | </pre> | ||
52 | <p> | ||
53 | LuaJIT currently builds out-of-the box on all popular x86 systems | ||
54 | (Linux, Windows, OSX etc.). It builds and runs fine as a 32 bit | ||
55 | application under x64-based systems, too. | ||
56 | </p> | ||
57 | |||
58 | <h2>Configuring LuaJIT</h2> | ||
59 | <p> | ||
60 | The standard configuration should work fine for most installations. | ||
61 | Usually there is no need to tweak the settings, except when you want to | ||
62 | install to a non-standard path. The following three files hold all | ||
63 | user-configurable settings: | ||
64 | </p> | ||
65 | <ul> | ||
66 | <li><tt>src/luaconf.h</tt> sets some configuration variables, in | ||
67 | particular the default paths for loading modules.</li> | ||
68 | <li><tt>Makefile</tt> has settings for installing LuaJIT (POSIX | ||
69 | only).</li> | ||
70 | <li><tt>src/Makefile</tt> has settings for compiling LuaJIT under POSIX, | ||
71 | MinGW and Cygwin.</li> | ||
72 | <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with | ||
73 | MSVC.</li> | ||
74 | </ul> | ||
75 | <p> | ||
76 | Please read the instructions given in these files, before changing | ||
77 | any settings. | ||
78 | </p> | ||
79 | |||
80 | <h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2> | ||
81 | <h3>Prerequisites</h3> | ||
82 | <p> | ||
83 | Depending on your distribution, you may need to install a package for | ||
84 | GCC (GCC 3.4 or later required), the development headers and/or a | ||
85 | complete SDK. | ||
86 | </p> | ||
87 | <p> | ||
88 | E.g. on a current Debian/Ubuntu, install <tt>libc6-dev</tt> | ||
89 | with the package manager. Currently LuaJIT only builds as a 32 bit | ||
90 | application, so you actually need to install <tt>libc6-dev-i386</tt> | ||
91 | when building on an x64 OS. | ||
92 | </p> | ||
93 | <p> | ||
94 | Download the current source package (pick the .tar.gz), if you haven't | ||
95 | already done so. Move it to a directory of your choice, open a | ||
96 | terminal window and change to this directory. Now unpack the archive | ||
97 | and change to the newly created directory: | ||
98 | </p> | ||
99 | <pre class="code"> | ||
100 | tar zxf LuaJIT-2.0.0-beta1.tar.gz | ||
101 | cd LuaJIT-2.0.0-beta1 | ||
102 | </pre> | ||
103 | <h3>Building LuaJIT</h3> | ||
104 | <p> | ||
105 | The supplied Makefiles try to auto-detect the settings needed for your | ||
106 | operating system and your compiler. They need to be run with GNU Make, | ||
107 | which is probably the default on your system, anyway. Simply run: | ||
108 | </p> | ||
109 | <pre class="code"> | ||
110 | make | ||
111 | </pre> | ||
112 | <h3>Installing LuaJIT</h3> | ||
113 | <p> | ||
114 | The top-level Makefile installs LuaJIT by default under | ||
115 | <tt>/usr/local</tt>, i.e. the executable ends up in | ||
116 | <tt>/usr/local/bin</tt> and so on. You need to have root privileges | ||
117 | to write to this path. So, assuming sudo is installed on your system, | ||
118 | run the following command and enter your sudo password: | ||
119 | </p> | ||
120 | <pre class="code"> | ||
121 | sudo make install | ||
122 | </pre> | ||
123 | <p> | ||
124 | Otherwise specify the directory prefix as an absolute path, e.g.: | ||
125 | </p> | ||
126 | <pre class="code"> | ||
127 | sudo make install PREFIX=/opt/lj2 | ||
128 | </pre> | ||
129 | <p> | ||
130 | But note that the installation prefix and the prefix for the module paths | ||
131 | (configured in <tt>src/luaconf.h</tt>) must match. | ||
132 | </p> | ||
133 | <p style="color: #c00000;"> | ||
134 | Note: to avoid overwriting a previous version, the beta test releases | ||
135 | only install the LuaJIT executable under the versioned name (i.e. | ||
136 | <tt>luajit-2.0.0-beta1</tt>). You probably want to create a symlink | ||
137 | for convenience, with a command like this: | ||
138 | </p> | ||
139 | <pre class="code" style="color: #c00000;"> | ||
140 | sudo ln -sf luajit-2.0.0-beta1 /usr/local/bin/luajit | ||
141 | </pre> | ||
142 | |||
143 | <h2 id="windows">Windows Systems</h2> | ||
144 | <h3>Prerequisites</h3> | ||
145 | <p> | ||
146 | Either install one of the open source SDKs | ||
147 | (<a href="http://mingw.org/"><span class="ext">»</span> MinGW</a> or | ||
148 | <a href="http://www.cygwin.com/"><span class="ext">»</span> Cygwin</a>) which come with modified | ||
149 | versions of GCC plus the required development headers. | ||
150 | </p> | ||
151 | <p> | ||
152 | Or install Microsoft's Visual C++ (MSVC) — the freely downloadable | ||
153 | <a href="http://www.microsoft.com/Express/VC/"><span class="ext">»</span> Express Edition</a> | ||
154 | works just fine. | ||
155 | </p> | ||
156 | <p> | ||
157 | Next, download the source package and unpack it using an archive manager | ||
158 | (e.g. the Windows Explorer) to a directory of your choice. | ||
159 | </p> | ||
160 | <h3>Building with MSVC</h3> | ||
161 | <p> | ||
162 | Open a "Visual Studio .NET Command Prompt" and <tt>cd</tt> to the | ||
163 | directory where you've unpacked the sources. Then run this command: | ||
164 | </p> | ||
165 | <pre class="code"> | ||
166 | cd src | ||
167 | msvcbuild | ||
168 | </pre> | ||
169 | <p> | ||
170 | Then follow the installation instructions below. | ||
171 | </p> | ||
172 | <h3>Building with MinGW or Cygwin</h3> | ||
173 | <p> | ||
174 | Open a command prompt window and make sure the MinGW or Cygwin programs | ||
175 | are in your path. Then <tt>cd</tt> to the directory where | ||
176 | you've unpacked the sources and run this command for MinGW: | ||
177 | </p> | ||
178 | <pre class="code"> | ||
179 | cd src | ||
180 | mingw32-make | ||
181 | </pre> | ||
182 | <p> | ||
183 | Or this command for Cygwin: | ||
184 | </p> | ||
185 | <pre class="code"> | ||
186 | cd src | ||
187 | make | ||
188 | </pre> | ||
189 | <p> | ||
190 | Then follow the installation instructions below. | ||
191 | </p> | ||
192 | <h3>Installing LuaJIT</h3> | ||
193 | <p> | ||
194 | Copy <tt>luajit.exe</tt> and <tt>lua51.dll</tt> | ||
195 | to a newly created directory (any location is ok). Add <tt>lua</tt> | ||
196 | and <tt>lua\jit</tt> directories below it and copy all Lua files | ||
197 | from the <tt>lib</tt> directory of the distribution to the latter directory. | ||
198 | </p> | ||
199 | <p> | ||
200 | There are no hardcoded | ||
201 | absolute path names — all modules are loaded relative to the | ||
202 | directory where <tt>luajit.exe</tt> is installed | ||
203 | (see <tt>src/luaconf.h</tt>). | ||
204 | </p> | ||
205 | <br class="flush"> | ||
206 | </div> | ||
207 | <div id="foot"> | ||
208 | <hr class="hide"> | ||
209 | Copyright © 2005-2009 Mike Pall | ||
210 | <span class="noprint"> | ||
211 | · | ||
212 | <a href="contact.html">Contact</a> | ||
213 | </span> | ||
214 | </div> | ||
215 | </body> | ||
216 | </html> | ||