blob: 0dd8a7b11fa57d29a8b47496fcf922e3ad455797 [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>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080027</ol>
28
29
Christopher Yeleighton7f94d982012-03-12 12:21:24 -060030<h2 id="basic">1. Basic Usage</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080031
32<p>
33The autoconf generated configure script can be used to guess your
34platform and change various options for building Mesa. To use the
35configure script, type:
36</p>
37
38<pre>
39 ./configure
40</pre>
41
42<p>
43To see a short description of all the options, type <code>./configure
44--help</code>. If you are using a development snapshot and the configure
Dan Nicholson460d25d2008-03-07 12:04:17 -080045script does not exist, type <code>./autogen.sh</code> to generate it
46first. If you know the options you want to pass to
47<code>configure</code>, you can pass them to <code>autogen.sh</code>. It
48will run <code>configure</code> with these options after it is
49generated. Once you have run <code>configure</code> and set the options
50to your preference, type:
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080051</p>
52
53<pre>
54 make
55</pre>
56
57<p>
Emil Velikov019f0552016-06-29 14:26:36 +010058This will produce libGL.so and/or several other libraries depending on the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080059options you have chosen. Later, if you want to rebuild for a different
60configuration run <code>make realclean</code> before rebuilding.
61</p>
62
63<p>
64Some of the generic autoconf options are used with Mesa:
Andreas Boll63eade42012-09-20 16:01:03 +020065</p>
66<dl>
67<dt><code>--prefix=PREFIX</code></dt>
68<dd><p>This is the root directory where
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080069files will be installed by <code>make install</code>. The default is
Andreas Boll63eade42012-09-20 16:01:03 +020070<code>/usr/local</code>.</p>
71</dd>
72
73<dt><code>--exec-prefix=EPREFIX</code></dt>
74<dd><p>This is the root directory
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080075where architecture-dependent files will be installed. In Mesa, this is
76only used to derive the directory for the libraries. The default is
Andreas Boll63eade42012-09-20 16:01:03 +020077<code>${prefix}</code>.</p>
78</dd>
79
80<dt><code>--libdir=LIBDIR</code></dt>
81<dd><p>This option specifies the directory
Dan Nicholson4c5a2b32007-12-23 16:38:18 -080082where the GL libraries will be installed. The default is
83<code>${exec_prefix}/lib</code>. It also serves as the name of the
84library staging area in the source tree. For instance, if the option
85<code>--libdir=/usr/local/lib64</code> is used, the libraries will be
86created in a <code>lib64</code> directory at the top of the Mesa source
Andreas Boll63eade42012-09-20 16:01:03 +020087tree.</p>
88</dd>
89
Marcin Ślusarzc2285142015-09-19 19:17:34 +020090<dt><code>--sysconfdir=DIR</code></dt>
91<dd><p>This option specifies the directory where the configuration
92files will be installed. The default is <code>${prefix}/etc</code>.
93Currently there's only one config file provided when dri drivers are
94enabled - it's <code>drirc</code>.</p>
95</dd>
96
Qiang Yu04bdbbc2018-08-06 11:41:33 +080097<dt><code>--datadir=DIR</code></dt>
98<dd><p>This option specifies the directory where the data files will
99be installed. The default is <code>${prefix}/share</code>.
100Currently when dri drivers are enabled, <code>drirc.d/</code> is at
101this place.</p>
102</dd>
103
Andreas Boll63eade42012-09-20 16:01:03 +0200104<dt><code>--enable-static, --disable-shared</code></dt>
105<dd><p>By default, Mesa
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800106will build shared libraries. Either of these options will force static
107libraries to be built. It is not currently possible to build static and
Andreas Boll63eade42012-09-20 16:01:03 +0200108shared libraries in a single pass.</p>
109</dd>
110
111<dt><code>CC, CFLAGS, CXX, CXXFLAGS</code></dt>
112<dd><p>These environment variables
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800113control the C and C++ compilers used during the build. By default,
Emil Velikov478f8272014-08-13 21:31:33 +0100114<code>gcc</code> and <code>g++</code> are used and the debug/optimisation
115level is left unchanged.</p>
Andreas Boll63eade42012-09-20 16:01:03 +0200116</dd>
117
118<dt><code>LDFLAGS</code></dt>
119<dd><p>An environment variable specifying flags to
Emil Velikov478f8272014-08-13 21:31:33 +0100120pass when linking programs. These should be empty and
121<code>PKG_CONFIG_PATH</code> is recommended to be used instead. If needed
122it can be used to direct the linker to use libraries in nonstandard
123directories. For example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p>
Andreas Boll63eade42012-09-20 16:01:03 +0200124</dd>
125
126<dt><code>PKG_CONFIG_PATH</code></dt>
Emil Velikov478f8272014-08-13 21:31:33 +0100127<dd><p>The
Eric Engestrom077879c2017-02-26 23:58:03 +0000128<code>pkg-config</code> utility is a hard requirement for configuring and
Emil Velikov478f8272014-08-13 21:31:33 +0100129building mesa. It is used to search for external libraries
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800130on the system. This environment variable is used to control the search
131path for <code>pkg-config</code>. For instance, setting
132<code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for
133package metadata in <code>/usr/X11R6</code> before the standard
Andreas Boll63eade42012-09-20 16:01:03 +0200134directories.</p>
135</dd>
136</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800137
138<p>
139There are also a few general options for altering the Mesa build:
Andreas Boll63eade42012-09-20 16:01:03 +0200140</p>
141<dl>
Andreas Boll63eade42012-09-20 16:01:03 +0200142<dt><code>--enable-debug</code></dt>
Emil Velikov019f0552016-06-29 14:26:36 +0100143<dd><p>This option will set the compiler debug/optimisation levels (if the user
144hasn't already set them via the CFLAGS/CXXFLAGS) and macros to aid in
145debugging the Mesa libraries.</p>
146
Eric Engestrom077879c2017-02-26 23:58:03 +0000147<p>Note that enabling this option can lead to noticeable loss of performance.</p>
Andreas Boll63eade42012-09-20 16:01:03 +0200148
149<dt><code>--disable-asm</code></dt>
150<dd><p>There are assembly routines
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800151available for a few architectures. These will be used by default if
152one of these architectures is detected. This option ensures that
Andreas Boll63eade42012-09-20 16:01:03 +0200153assembly will not be used.</p>
154</dd>
155
Emil Velikov478f8272014-08-13 21:31:33 +0100156<dt><code>--build=</code></dt>
157<dt><code>--host=</code></dt>
158<dd><p>By default, the build will compile code for the architecture that
159it's running on. In order to build cross-compile Mesa on a x86-64 machine
160that is to run on a i686, one would need to set the options to:</p>
161
Emil Velikov0267c6d2014-08-15 17:58:14 +0100162<p><code>--build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu</code></p>
Emil Velikov478f8272014-08-13 21:31:33 +0100163
164Note that these can vary from distribution to distribution. For more
165information check with the
166<a href="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Specifying-Target-Triplets.html">
167autoconf manual</a>.
Emil Velikov0267c6d2014-08-15 17:58:14 +0100168Note that you will need to correctly set <code>PKG_CONFIG_PATH</code> as well.
Emil Velikov478f8272014-08-13 21:31:33 +0100169
170
171<p>In some cases a single compiler is capable of handling both architectures
172(multilib) in that case one would need to set the <code>CC,CXX</code> variables
173appending the correct machine options. Seek your compiler documentation for
174further information -
175<a href="https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.html"> gcc
176machine dependent options</a></p>
177
Emil Velikov0267c6d2014-08-15 17:58:14 +0100178<p>In addition to specifying correct <code>PKG_CONFIG_PATH</code> for the target
179architecture, the following should be sufficient to configure multilib Mesa</p>
Emil Velikov478f8272014-08-13 21:31:33 +0100180
Emil Velikov0267c6d2014-08-15 17:58:14 +0100181<code>./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu ...</code>
Andreas Boll63eade42012-09-20 16:01:03 +0200182</dd>
183</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800184
185
Emil Velikov019f0552016-06-29 14:26:36 +0100186<h2 id="driver">2. GL Driver Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800187
188<p>
189There are several different driver modes that Mesa can use. These are
190described in more detail in the <a href="install.html">basic
191installation instructions</a>. The Mesa driver is controlled through the
Emil Velikov019f0552016-06-29 14:26:36 +0100192configure options <code>--enable-glx</code> and <code>--enable-osmesa</code>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800193</p>
194
Matt Turner66be7b42013-09-09 16:27:18 -0700195<h3 id="xlib">Xlib</h3><p>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800196It uses Xlib as a software renderer to do all rendering. It corresponds
Emil Velikov019f0552016-06-29 14:26:36 +0100197to the option <code>--enable-glx=xlib</code> or <code>--enable-glx=gallium-xlib</code>.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800198
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200199<h3 id="dri">DRI</h3><p>This mode uses the DRI hardware drivers for
Emil Velikov019f0552016-06-29 14:26:36 +0100200accelerated OpenGL rendering. To enable use <code>--enable-glx=dri
201--enable-dri</code>.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800202
203<!-- DRI specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600204<dl>
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200205<dt><code>--with-dri-driverdir=DIR</code>
206<dd><p> This option specifies the
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800207location the DRI drivers will be installed to and the location libGL
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700208will search for DRI drivers. The default is <code>${libdir}/dri</code>.
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200209<dt><code>--with-dri-drivers=DRIVER,DRIVER,...</code>
210<dd><p> This option
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800211allows a specific set of DRI drivers to be built. For example,
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700212<code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
213default, the drivers will be chosen depending on the target platform.
214See the directory <code>src/mesa/drivers/dri</code> in the source tree
215for available drivers. Beware that the swrast DRI driver is used by both
216libGL and the X.Org xserver GLX module to do software rendering, so you
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600217may run into problems if it is not available.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800218<!-- This explanation might be totally bogus. Kristian? -->
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200219<dt><code>--disable-driglx-direct</code>
220<dd><p> Disable direct rendering in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800221GLX. Normally, direct hardware rendering through the DRI drivers and
222indirect software rendering are enabled in GLX. This option disables
223direct rendering entirely. It can be useful on architectures where
224kernel DRM modules are not available.
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200225<dt><code>--enable-glx-tls</code> <dd><p>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600226Enable Thread Local Storage (TLS) in
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800227GLX.
Emil Velikov478f8272014-08-13 21:31:33 +0100228<dt><code>--with-expat=DIR</code>
229<dd><p><strong>DEPRECATED</strong>, use <code>PKG_CONFIG_PATH</code> instead.</p>
230<p>The DRI-enabled libGL uses expat to
Marcin Ślusarzc2285142015-09-19 19:17:34 +0200231parse the DRI configuration files in <code>${sysconfdir}/drirc</code> and
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800232<code>~/.drirc</code>. This option allows a specific expat installation
233to be used. For example, <code>--with-expat=/usr/local</code> will
234search for expat headers and libraries in <code>/usr/local/include</code>
235and <code>/usr/local/lib</code>, respectively.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600236</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800237
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600238<h3 id="osmesa">OSMesa </h3><p> No libGL is built in this
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800239mode. Instead, the driver code is built into the Off-Screen Mesa
240(OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
Matt Turner66be7b42013-09-09 16:27:18 -0700241page for more details. It corresponds to the option
242<code>--enable-osmesa</code>.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800243
244<!-- OSMesa specific options -->
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600245<dl>
Andreas Bolldae9b0f2012-06-25 21:52:47 +0200246<dt><code>--with-osmesa-bits=BITS</code>
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600247<dd><p> This option allows the size
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800248of the color channel in bits to be specified. By default, an 8-bit
249channel will be used, and the driver will be named libOSMesa. Other
250options are 16- and 32-bit color channels, which will add the bit size
251to the library name. For example, <code>--with-osmesa-bits=16</code>
252will create the libOSMesa16 library with a 16-bit color channel.
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600253</dl>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800254
255
Christopher Yeleighton7f94d982012-03-12 12:21:24 -0600256<h2 id="library">3. Library Options</h2>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800257
258<p>
Emil Velikov019f0552016-06-29 14:26:36 +0100259The configure script provides more fine grained control over the libraries
260that will be built.
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800261
Andreas Bollb5da52a2012-09-18 18:57:02 +0200262</div>
Dan Nicholson4c5a2b32007-12-23 16:38:18 -0800263</body>
264</html>