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