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