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