blob: 0210bd1b27e2f1164cd7f11f6e30e6737803cdcf [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Compilation and Installation using Autoconf</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -08008<body>
9
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<div class="header">
11 <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080017<h1>Compilation and Installation using Autoconf</h1>
18
19<ol>
Andreas Bolldae9b0f2012-06-25 21:52:47 +020020<li><p><a href="#basic">Basic Usage</a></li>
21<li><p><a href="#driver">Driver Options</a>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080022 <ul>
23 <li><a href="#xlib">Xlib Driver Options</a></li>
24 <li><a href="#dri">DRI Driver Options</a></li>
25 <li><a href="#osmesa">OSMesa Driver Options</a></li>
26 </ul>
Andreas Bolldae9b0f2012-06-25 21:52:47 +020027<li><p><a href="#demos">Demo Program Options</a>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080028</ol>
29
30
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060031<h2 id="basic">1. Basic Usage</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080032
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>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800109
110<p>
111There are also a few general options for altering the Mesa build:
112<ul>
113<li><code>--with-x</code> - When the X11 development libraries are
114needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
115be used</a> for locating them. If they cannot be found through
116<code>pkg-config</code> a fallback routing using <code>imake</code> will
117be used. In this case, the <code>--with-x</code>,
118<code>--x-includes</code> and <code>--x-libraries</code> options can
119control the use of X for Mesa.
120</li>
Dan Nicholson544ab202007-12-30 08:41:53 -0800121<li><code>--enable-gl-osmesa</code> - The <a href="osmesa.html">OSMesa
122library</a> can be built on top of libGL for drivers that provide it.
123This option controls whether to build libOSMesa. By default, this is
124enabled for the Xlib driver and disabled otherwise. Note that this
125option is different than using OSMesa as the driver.
126</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800127<li><code>--enable-debug</code> - This option will enable compiler
128options and macros to aid in debugging the Mesa libraries.
129</li>
130<li><code>--disable-asm</code> - There are assembly routines
131available for a few architectures. These will be used by default if
132one of these architectures is detected. This option ensures that
133assembly will not be used.
134</li>
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600135<li><code>--enable-32-bit, --enable-64-bit</code> - By default, the
136build will compile code as directed by the environment variables
137<code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
138<code>gcc</code>, these options offer a helper to add the compiler flags
139to force 32- or 64-bit code generation as used on the x86 and x86_64
140architectures.
141</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800142</ul>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800143
144
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600145<h2 id="driver">2. Driver Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800146
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
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200155<h3 id="xlib">Xlib</h3><p>This is the default mode for building Mesa.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800156It uses Xlib as a software renderer to do all rendering. It corresponds
157to the option <code>--with-driver=xlib</code>. The libX11 and libXext
158libraries, as well as the X11 development headers, will be need to
159support the Xlib driver.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800160
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200161<h3 id="dri">DRI</h3><p>This mode uses the DRI hardware drivers for
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800162accelerated OpenGL rendering. Enable the DRI drivers with the option
163<code>--with-driver=dri</code>. See the <a href="install.html">basic
164installation instructions</a> for details on prerequisites for the DRI
165drivers.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800166
167<!-- DRI specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600168<dl>
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200169<dt><code>--with-dri-driverdir=DIR</code>
170<dd><p> This option specifies the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800171location the DRI drivers will be installed to and the location libGL
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700172will search for DRI drivers. The default is <code>${libdir}/dri</code>.
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200173<dt><code>--with-dri-drivers=DRIVER,DRIVER,...</code>
174<dd><p> This option
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800175allows a specific set of DRI drivers to be built. For example,
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700176<code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
177default, the drivers will be chosen depending on the target platform.
178See the directory <code>src/mesa/drivers/dri</code> in the source tree
179for available drivers. Beware that the swrast DRI driver is used by both
180libGL and the X.Org xserver GLX module to do software rendering, so you
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600181may run into problems if it is not available.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800182<!-- This explanation might be totally bogus. Kristian? -->
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200183<dt><code>--disable-driglx-direct</code>
184<dd><p> Disable direct rendering in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800185GLX. Normally, direct hardware rendering through the DRI drivers and
186indirect software rendering are enabled in GLX. This option disables
187direct rendering entirely. It can be useful on architectures where
188kernel DRM modules are not available.
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200189<dt><code>--enable-glx-tls</code> <dd><p>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600190Enable Thread Local Storage (TLS) in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800191GLX.
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200192<dt><code>--with-expat=DIR</code> <dd> The DRI-enabled libGL uses expat to
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800193parse the DRI configuration files in <code>/etc/drirc</code> and
194<code>~/.drirc</code>. This option allows a specific expat installation
195to be used. For example, <code>--with-expat=/usr/local</code> will
196search for expat headers and libraries in <code>/usr/local/include</code>
197and <code>/usr/local/lib</code>, respectively.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600198</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800199
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600200<h3 id="osmesa">OSMesa </h3><p> No libGL is built in this
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800201mode. Instead, the driver code is built into the Off-Screen Mesa
202(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
203page for more details.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800204
205<!-- OSMesa specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600206<dl>
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200207<dt><code>--with-osmesa-bits=BITS</code>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600208<dd><p> This option allows the size
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800209of the color channel in bits to be specified. By default, an 8-bit
210channel will be used, and the driver will be named libOSMesa. Other
211options are 16- and 32-bit color channels, which will add the bit size
212to the library name. For example, <code>--with-osmesa-bits=16</code>
213will create the libOSMesa16 library with a 16-bit color channel.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600214</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800215
216
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600217<h2 id="library">3. Library Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800218
219<p>
220The configure script provides more fine grained control over the GL
221libraries that will be built. More details on the specific GL libraries
222can be found in the <a href="install.html">basic installation
223instructions</a>.
224
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800225
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600226<h2 id="demos">4. Demo Program Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800227
228<p>
229There are many demonstration programs in the MesaDemos tarball. If the
230programs are available when <code>./configure</code> is run, a subset of
231the programs will be built depending on the driver and library options
232chosen. See the directory <code>progs</code> for the full set of demos.
233
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600234<dl>
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200235<dt><code>--with-demos=DEMOS,DEMOS,...</code>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600236<dd><p> This option allows a
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800237specific set of demo programs to be built. For example,
238<code>--with-demos="xdemos,slang"</code>. Beware that if this option is
239used, it will not be ensured that the necessary GL libraries will be
240available.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600241<dt><code>--without-demos</code> <dd><p> This completely disables building the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800242demo programs. It is equivalent to <code>--with-demos=no</code>.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600243</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800244
Andreas Bollb5da52a2012-09-18 18:57:02 +0200245</div>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800246</body>
247</html>