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