OSDN Git Service

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