blob: 837c92f4e299df4d76d892dd8b9186e87cc02420 [file] [log] [blame]
Dan Nicholson4c5a2b32007-12-23 16:38:18 -08001<html>
2
3<title>Compilation and Installation using Autoconf</title>
4
5<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<body>
8
9
10<h1>Compilation and Installation using Autoconf</h1>
11
12<ol>
13<li><a href="#basic">Basic Usage</a></li>
14<li><a href="#driver">Driver Options</a></li>
15 <ul>
16 <li><a href="#xlib">Xlib Driver Options</a></li>
17 <li><a href="#dri">DRI Driver Options</a></li>
18 <li><a href="#osmesa">OSMesa Driver Options</a></li>
19 </ul>
20<li><a href="#library">Library Options</a></li>
21 <ul>
22 <li><a href="#glu">GLU</a></li>
23 <li><a href="#glw">GLw</a></li>
24 <li><a href="#glut">GLUT</a></li>
25 </ul>
26<li><a href="#demos">Demo Program Options</a></li>
27</ol>
28
29
30<a name="basic">
31<h2>1. Basic Usage</h2>
32
33<p>
34The autoconf generated configure script can be used to guess your
35platform and change various options for building Mesa. To use the
36configure script, type:
37</p>
38
39<pre>
40 ./configure
41</pre>
42
43<p>
44To see a short description of all the options, type <code>./configure
45--help</code>. If you are using a development snapshot and the configure
Dan Nicholson460d25d2008-03-07 12:04:17 -080046script does not exist, type <code>./autogen.sh</code> to generate it
47first. If you know the options you want to pass to
48<code>configure</code>, you can pass them to <code>autogen.sh</code>. It
49will run <code>configure</code> with these options after it is
50generated. Once you have run <code>configure</code> and set the options
51to your preference, type:
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080052</p>
53
54<pre>
55 make
56</pre>
57
58<p>
59This will produce libGL.so and several other libraries depending on the
60options you have chosen. Later, if you want to rebuild for a different
61configuration run <code>make realclean</code> before rebuilding.
62</p>
63
64<p>
65Some of the generic autoconf options are used with Mesa:
66
67<ul>
68<li><code>--prefix=PREFIX</code> - This is the root directory where
69files will be installed by <code>make install</code>. The default is
70<code>/usr/local</code>.
71</li>
72<li><code>--exec-prefix=EPREFIX</code> - This is the root directory
73where architecture-dependent files will be installed. In Mesa, this is
74only used to derive the directory for the libraries. The default is
75<code>${prefix}</code>.
76</li>
77<li><code>--libdir=LIBDIR</code> - This option specifies the directory
78where the GL libraries will be installed. The default is
79<code>${exec_prefix}/lib</code>. It also serves as the name of the
80library staging area in the source tree. For instance, if the option
81<code>--libdir=/usr/local/lib64</code> is used, the libraries will be
82created in a <code>lib64</code> directory at the top of the Mesa source
83tree.
84</li>
85<li><code>--enable-static, --disable-shared</code> - By default, Mesa
86will build shared libraries. Either of these options will force static
87libraries to be built. It is not currently possible to build static and
88shared libraries in a single pass.
89</li>
90<li><code>CC, CFLAGS, CXX, CXXFLAGS</code> - These environment variables
91control the C and C++ compilers used during the build. By default,
92<code>gcc</code> and <code>g++</code> are used with the options
93<code>"-g -O2"</code>.
94</li>
95<li><code>LDFLAGS</code> - An environment variable specifying flags to
96pass when linking programs. These are normally empty, but can be used
97to direct the linker to use libraries in nonstandard directories. For
98example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.
99</li>
100<li><code>PKG_CONFIG_PATH</code> - When available, the
101<code>pkg-config</code> utility is used to search for external libraries
102on the system. This environment variable is used to control the search
103path for <code>pkg-config</code>. For instance, setting
104<code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for
105package metadata in <code>/usr/X11R6</code> before the standard
106directories.
107</li>
108</ul>
109</p>
110
111<p>
112There are also a few general options for altering the Mesa build:
113<ul>
114<li><code>--with-x</code> - When the X11 development libraries are
115needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
116be used</a> for locating them. If they cannot be found through
117<code>pkg-config</code> a fallback routing using <code>imake</code> will
118be used. In this case, the <code>--with-x</code>,
119<code>--x-includes</code> and <code>--x-libraries</code> options can
120control the use of X for Mesa.
121</li>
Dan Nicholson544ab202007-12-30 08:41:53 -0800122<li><code>--enable-gl-osmesa</code> - The <a href="osmesa.html">OSMesa
123library</a> can be built on top of libGL for drivers that provide it.
124This option controls whether to build libOSMesa. By default, this is
125enabled for the Xlib driver and disabled otherwise. Note that this
126option is different than using OSMesa as the driver.
127</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800128<li><code>--enable-debug</code> - This option will enable compiler
129options and macros to aid in debugging the Mesa libraries.
130</li>
131<li><code>--disable-asm</code> - There are assembly routines
132available for a few architectures. These will be used by default if
133one of these architectures is detected. This option ensures that
134assembly will not be used.
135</li>
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600136<li><code>--enable-32-bit, --enable-64-bit</code> - By default, the
137build will compile code as directed by the environment variables
138<code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
139<code>gcc</code>, these options offer a helper to add the compiler flags
140to force 32- or 64-bit code generation as used on the x86 and x86_64
141architectures.
142</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800143</ul>
144</p>
145
146
147<a name="driver">
148<h2>2. Driver Options</h2>
149
150<p>
151There are several different driver modes that Mesa can use. These are
152described in more detail in the <a href="install.html">basic
153installation instructions</a>. The Mesa driver is controlled through the
154configure option --with-driver. There are currently three supported
155options in the configure script.
156</p>
157
158<ul>
159
160<a name="xlib">
161<li><b><em>Xlib</em></b> - This is the default mode for building Mesa.
162It uses Xlib as a software renderer to do all rendering. It corresponds
163to the option <code>--with-driver=xlib</code>. The libX11 and libXext
164libraries, as well as the X11 development headers, will be need to
165support the Xlib driver.
166</li>
167
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800168<a name="dri">
169<li><b><em>DRI</em></b> - This mode uses the DRI hardware drivers for
170accelerated OpenGL rendering. Enable the DRI drivers with the option
171<code>--with-driver=dri</code>. See the <a href="install.html">basic
172installation instructions</a> for details on prerequisites for the DRI
173drivers.
174</li>
175
176<!-- DRI specific options -->
177<p>
178<ul>
179<li><code>--with-dri-driverdir=DIR</code> - This option specifies the
180location the DRI drivers will be installed to and the location libGL
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700181will search for DRI drivers. The default is <code>${libdir}/dri</code>.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800182</li>
183<li><code>--with-dri-drivers=DRIVER,DRIVER,...</code> - This option
184allows a specific set of DRI drivers to be built. For example,
185<code>--with-dri-drivers="i965,radeon,nouveau"</code>. By default,
186the drivers will be chosen depending on the target platform. See the
187directory <code>src/mesa/drivers/dri</code> in the source tree for
188available drivers.
189</li>
190<!-- This explanation might be totally bogus. Kristian? -->
191<li><code>--disable-driglx-direct</code> - Disable direct rendering in
192GLX. Normally, direct hardware rendering through the DRI drivers and
193indirect software rendering are enabled in GLX. This option disables
194direct rendering entirely. It can be useful on architectures where
195kernel DRM modules are not available.
196</li>
197<li><code>--enable-glx-tls</code> - Enable Thread Local Storage (TLS) in
198GLX.
199</li>
200<li><code>--with-expat=DIR</code> - The DRI-enabled libGL uses expat to
201parse the DRI configuration files in <code>/etc/drirc</code> and
202<code>~/.drirc</code>. This option allows a specific expat installation
203to be used. For example, <code>--with-expat=/usr/local</code> will
204search for expat headers and libraries in <code>/usr/local/include</code>
205and <code>/usr/local/lib</code>, respectively.
206</li>
207</ul>
208</p>
209
210<a name="osmesa">
211<li><b><em>OSMesa</em></b> - No libGL is built in this
212mode. Instead, the driver code is built into the Off-Screen Mesa
213(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
214page for more details.
215</li>
216
217<!-- OSMesa specific options -->
218<p>
219<ul>
220<li><code>--with-osmesa-bits=BITS</code> - This option allows the size
221of the color channel in bits to be specified. By default, an 8-bit
222channel will be used, and the driver will be named libOSMesa. Other
223options are 16- and 32-bit color channels, which will add the bit size
224to the library name. For example, <code>--with-osmesa-bits=16</code>
225will create the libOSMesa16 library with a 16-bit color channel.
226</li>
227</ul>
228</p>
229
230</ul>
231
232
233<a name="library">
234<h2>3. Library Options</h2>
235
236<p>
237The configure script provides more fine grained control over the GL
238libraries that will be built. More details on the specific GL libraries
239can be found in the <a href="install.html">basic installation
240instructions</a>.
241
242<ul>
243<a name="glu">
244<li><b><em>GLU</em></b> - The libGLU library will be built by default
245on all drivers. This can be disable with the option
246<code>--disable-glu</code>.
247</li>
248
249<a name="glw">
250<li><b><em>GLw</em></b> - The libGLw library will be built by default
251if libGLU has been enabled. This can be disable with the option
252<code>--disable-glw</code>.
253</li>
254
255<a name="glut">
256<li><b><em>GLUT</em></b> - The libglut library will be built by default
257if libGLU has been enabled and the glut source code from the MesaGLUT
258tarball is available. This can be disable with the option
259<code>--disable-glut</code>.
260</li>
261</ul>
262</p>
263
264
265<a name="demos">
266<h2>4. Demo Program Options</h2>
267
268<p>
269There are many demonstration programs in the MesaDemos tarball. If the
270programs are available when <code>./configure</code> is run, a subset of
271the programs will be built depending on the driver and library options
272chosen. See the directory <code>progs</code> for the full set of demos.
273
274<ul>
275<li><code>--with-demos=DEMOS,DEMOS,...</code> - This option allows a
276specific set of demo programs to be built. For example,
277<code>--with-demos="xdemos,slang"</code>. Beware that if this option is
278used, it will not be ensured that the necessary GL libraries will be
279available.
280</li>
281<li><code>--without-demos</code> - This completely disables building the
282demo programs. It is equivalent to <code>--with-demos=no</code>.
283</li>
284</ul>
285</p>
286
287</body>
288</html>