blob: 07a966e05e3a9053dd61f09571b57285ddcd7240 [file] [log] [blame]
Christopher Yeleighton7f94d982012-03-12 12:21:24 -06001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ><html LANG=en>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -08002
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>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060013<li><p ><a href="#basic">Basic Usage</a></li>
14<li><p ><a href="#driver">Driver Options</a>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080015 <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>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060020<li><p ><a href="#library">Library Options</a>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080021 <ul>
22 <li><a href="#glu">GLU</a></li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080023 </ul>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060024<li><p ><a href="#demos">Demo Program Options</a>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080025</ol>
26
27
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060028<h2 id="basic">1. Basic Usage</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080029
30<p>
31The autoconf generated configure script can be used to guess your
32platform and change various options for building Mesa. To use the
33configure script, type:
34</p>
35
36<pre>
37 ./configure
38</pre>
39
40<p>
41To see a short description of all the options, type <code>./configure
42--help</code>. If you are using a development snapshot and the configure
Dan Nicholson460d25d2008-03-07 12:04:17 -080043script does not exist, type <code>./autogen.sh</code> to generate it
44first. If you know the options you want to pass to
45<code>configure</code>, you can pass them to <code>autogen.sh</code>. It
46will run <code>configure</code> with these options after it is
47generated. Once you have run <code>configure</code> and set the options
48to your preference, type:
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080049</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>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800106
107<p>
108There are also a few general options for altering the Mesa build:
109<ul>
110<li><code>--with-x</code> - When the X11 development libraries are
111needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
112be used</a> for locating them. If they cannot be found through
113<code>pkg-config</code> a fallback routing using <code>imake</code> will
114be used. In this case, the <code>--with-x</code>,
115<code>--x-includes</code> and <code>--x-libraries</code> options can
116control the use of X for Mesa.
117</li>
Dan Nicholson544ab202007-12-30 08:41:53 -0800118<li><code>--enable-gl-osmesa</code> - The <a href="osmesa.html">OSMesa
119library</a> can be built on top of libGL for drivers that provide it.
120This option controls whether to build libOSMesa. By default, this is
121enabled for the Xlib driver and disabled otherwise. Note that this
122option is different than using OSMesa as the driver.
123</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800124<li><code>--enable-debug</code> - This option will enable compiler
125options and macros to aid in debugging the Mesa libraries.
126</li>
127<li><code>--disable-asm</code> - There are assembly routines
128available for a few architectures. These will be used by default if
129one of these architectures is detected. This option ensures that
130assembly will not be used.
131</li>
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600132<li><code>--enable-32-bit, --enable-64-bit</code> - By default, the
133build will compile code as directed by the environment variables
134<code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
135<code>gcc</code>, these options offer a helper to add the compiler flags
136to force 32- or 64-bit code generation as used on the x86 and x86_64
137architectures.
138</li>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800139</ul>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800140
141
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600142<h2 id="driver">2. Driver Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800143
144<p>
145There are several different driver modes that Mesa can use. These are
146described in more detail in the <a href="install.html">basic
147installation instructions</a>. The Mesa driver is controlled through the
148configure option --with-driver. There are currently three supported
149options in the configure script.
150</p>
151
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600152<h3 id="xlib">Xlib</h3 ><p >This is the default mode for building Mesa.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800153It uses Xlib as a software renderer to do all rendering. It corresponds
154to the option <code>--with-driver=xlib</code>. The libX11 and libXext
155libraries, as well as the X11 development headers, will be need to
156support the Xlib driver.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800157
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600158<h3 id="dri">DRI </h3 ><p >This mode uses the DRI hardware drivers for
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800159accelerated OpenGL rendering. Enable the DRI drivers with the option
160<code>--with-driver=dri</code>. See the <a href="install.html">basic
161installation instructions</a> for details on prerequisites for the DRI
162drivers.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800163
164<!-- DRI specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600165<dl>
166<dt><code>--with-dri-driverdir=DIR</code>
167<dd ><p > This option specifies the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800168location the DRI drivers will be installed to and the location libGL
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700169will search for DRI drivers. The default is <code>${libdir}/dri</code>.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600170<dt><code>--with-dri-drivers=DRIVER,DRIVER,...</code>
171<dd ><p > This option
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800172allows a specific set of DRI drivers to be built. For example,
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700173<code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
174default, the drivers will be chosen depending on the target platform.
175See the directory <code>src/mesa/drivers/dri</code> in the source tree
176for available drivers. Beware that the swrast DRI driver is used by both
177libGL and the X.Org xserver GLX module to do software rendering, so you
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600178may run into problems if it is not available.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800179<!-- This explanation might be totally bogus. Kristian? -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600180<dt><code>--disable-driglx-direct</code>
181<dd ><p > Disable direct rendering in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800182GLX. Normally, direct hardware rendering through the DRI drivers and
183indirect software rendering are enabled in GLX. This option disables
184direct rendering entirely. It can be useful on architectures where
185kernel DRM modules are not available.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600186<dt><code>--enable-glx-tls</code> <dd ><p >
187Enable Thread Local Storage (TLS) in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800188GLX.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600189<dt><code>--with-expat=DIR</code> <dd > The DRI-enabled libGL uses expat to
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800190parse the DRI configuration files in <code>/etc/drirc</code> and
191<code>~/.drirc</code>. This option allows a specific expat installation
192to be used. For example, <code>--with-expat=/usr/local</code> will
193search for expat headers and libraries in <code>/usr/local/include</code>
194and <code>/usr/local/lib</code>, respectively.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600195</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800196
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600197<h3 id="osmesa">OSMesa </h3><p> No libGL is built in this
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800198mode. Instead, the driver code is built into the Off-Screen Mesa
199(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
200page for more details.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800201
202<!-- OSMesa specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600203<dl>
204<dt><code>--with-osmesa-bits=BITS</code>
205<dd><p> This option allows the size
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800206of the color channel in bits to be specified. By default, an 8-bit
207channel will be used, and the driver will be named libOSMesa. Other
208options are 16- and 32-bit color channels, which will add the bit size
209to the library name. For example, <code>--with-osmesa-bits=16</code>
210will create the libOSMesa16 library with a 16-bit color channel.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600211</dl>
212</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800213
214
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600215<h2 id="library">3. Library Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800216
217<p>
218The configure script provides more fine grained control over the GL
219libraries that will be built. More details on the specific GL libraries
220can be found in the <a href="install.html">basic installation
221instructions</a>.
222
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600223<dl>
224<dt id="glu">GLU <dd><p> The libGLU library will be built by default
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800225on all drivers. This can be disable with the option
226<code>--disable-glu</code>.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600227</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800228
229
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600230<h2 id="demos">4. Demo Program Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800231
232<p>
233There are many demonstration programs in the MesaDemos tarball. If the
234programs are available when <code>./configure</code> is run, a subset of
235the programs will be built depending on the driver and library options
236chosen. See the directory <code>progs</code> for the full set of demos.
237
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600238<dl>
239<dt><code>--with-demos=DEMOS,DEMOS,...</code>
240<dd><p> This option allows a
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800241specific set of demo programs to be built. For example,
242<code>--with-demos="xdemos,slang"</code>. Beware that if this option is
243used, it will not be ensured that the necessary GL libraries will be
244available.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600245<dt><code>--without-demos</code> <dd><p> This completely disables building the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800246demo programs. It is equivalent to <code>--with-demos=no</code>.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600247</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800248
249</body>
250</html>