Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 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> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 8 | <body> |
| 9 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 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 | |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 17 | <h1>Compilation and Installation using Autoconf</h1> |
| 18 | |
| 19 | <ol> |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 20 | <li><p><a href="#basic">Basic Usage</a></li> |
| 21 | <li><p><a href="#driver">Driver Options</a> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 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> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 27 | </ol> |
| 28 | |
| 29 | |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 30 | <h2 id="basic">1. Basic Usage</h2> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 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 |
Dan Nicholson | 460d25d | 2008-03-07 12:04:17 -0800 | [diff] [blame] | 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: |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 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: |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 65 | </p> |
| 66 | <dl> |
| 67 | <dt><code>--prefix=PREFIX</code></dt> |
| 68 | <dd><p>This is the root directory where |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 69 | files will be installed by <code>make install</code>. The default is |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 70 | <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 Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 75 | where architecture-dependent files will be installed. In Mesa, this is |
| 76 | only used to derive the directory for the libraries. The default is |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 77 | <code>${prefix}</code>.</p> |
| 78 | </dd> |
| 79 | |
| 80 | <dt><code>--libdir=LIBDIR</code></dt> |
| 81 | <dd><p>This option specifies the directory |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 82 | where the GL libraries will be installed. The default is |
| 83 | <code>${exec_prefix}/lib</code>. It also serves as the name of the |
| 84 | library staging area in the source tree. For instance, if the option |
| 85 | <code>--libdir=/usr/local/lib64</code> is used, the libraries will be |
| 86 | created in a <code>lib64</code> directory at the top of the Mesa source |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 87 | tree.</p> |
| 88 | </dd> |
| 89 | |
| 90 | <dt><code>--enable-static, --disable-shared</code></dt> |
| 91 | <dd><p>By default, Mesa |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 92 | will build shared libraries. Either of these options will force static |
| 93 | libraries to be built. It is not currently possible to build static and |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 94 | shared libraries in a single pass.</p> |
| 95 | </dd> |
| 96 | |
| 97 | <dt><code>CC, CFLAGS, CXX, CXXFLAGS</code></dt> |
| 98 | <dd><p>These environment variables |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 99 | control the C and C++ compilers used during the build. By default, |
| 100 | <code>gcc</code> and <code>g++</code> are used with the options |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 101 | <code>"-g -O2"</code>.</p> |
| 102 | </dd> |
| 103 | |
| 104 | <dt><code>LDFLAGS</code></dt> |
| 105 | <dd><p>An environment variable specifying flags to |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 106 | pass when linking programs. These are normally empty, but can be used |
| 107 | to direct the linker to use libraries in nonstandard directories. For |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 108 | example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.</p> |
| 109 | </dd> |
| 110 | |
| 111 | <dt><code>PKG_CONFIG_PATH</code></dt> |
| 112 | <dd><p>When available, the |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 113 | <code>pkg-config</code> utility is used to search for external libraries |
| 114 | on the system. This environment variable is used to control the search |
| 115 | path for <code>pkg-config</code>. For instance, setting |
| 116 | <code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for |
| 117 | package metadata in <code>/usr/X11R6</code> before the standard |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 118 | directories.</p> |
| 119 | </dd> |
| 120 | </dl> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 121 | |
| 122 | <p> |
| 123 | There are also a few general options for altering the Mesa build: |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 124 | </p> |
| 125 | <dl> |
| 126 | <dt><code>--with-x</code></dt> |
| 127 | <dd><p>When the X11 development libraries are |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 128 | needed, the <code>pkg-config</code> utility <a href="#pkg-config">will |
| 129 | be used</a> for locating them. If they cannot be found through |
| 130 | <code>pkg-config</code> a fallback routing using <code>imake</code> will |
| 131 | be used. In this case, the <code>--with-x</code>, |
| 132 | <code>--x-includes</code> and <code>--x-libraries</code> options can |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 133 | control the use of X for Mesa.</p> |
| 134 | </dd> |
| 135 | |
| 136 | <dt><code>--enable-gl-osmesa</code></dt> |
| 137 | <dd><p>The <a href="osmesa.html">OSMesa |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 138 | library</a> can be built on top of libGL for drivers that provide it. |
| 139 | This option controls whether to build libOSMesa. By default, this is |
| 140 | enabled for the Xlib driver and disabled otherwise. Note that this |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 141 | option is different than using OSMesa as the driver.</p> |
| 142 | </dd> |
| 143 | |
| 144 | <dt><code>--enable-debug</code></dt> |
| 145 | <dd><p>This option will enable compiler |
| 146 | options and macros to aid in debugging the Mesa libraries.</p> |
| 147 | </dd> |
| 148 | |
| 149 | <dt><code>--disable-asm</code></dt> |
| 150 | <dd><p>There are assembly routines |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 151 | available for a few architectures. These will be used by default if |
| 152 | one of these architectures is detected. This option ensures that |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 153 | assembly will not be used.</p> |
| 154 | </dd> |
| 155 | |
| 156 | <dt><code>--enable-32-bit</code></dt> |
| 157 | <dt><code>--enable-64-bit</code></dt> |
| 158 | <dd><p>By default, the |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 159 | build will compile code as directed by the environment variables |
| 160 | <code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is |
| 161 | <code>gcc</code>, these options offer a helper to add the compiler flags |
| 162 | to force 32- or 64-bit code generation as used on the x86 and x86_64 |
Andreas Boll | 63eade4 | 2012-09-20 16:01:03 +0200 | [diff] [blame^] | 163 | architectures.</p> |
| 164 | </dd> |
| 165 | </dl> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 166 | |
| 167 | |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 168 | <h2 id="driver">2. Driver Options</h2> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 169 | |
| 170 | <p> |
| 171 | There are several different driver modes that Mesa can use. These are |
| 172 | described in more detail in the <a href="install.html">basic |
| 173 | installation instructions</a>. The Mesa driver is controlled through the |
| 174 | configure option --with-driver. There are currently three supported |
| 175 | options in the configure script. |
| 176 | </p> |
| 177 | |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 178 | <h3 id="xlib">Xlib</h3><p>This is the default mode for building Mesa. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 179 | It uses Xlib as a software renderer to do all rendering. It corresponds |
| 180 | to the option <code>--with-driver=xlib</code>. The libX11 and libXext |
| 181 | libraries, as well as the X11 development headers, will be need to |
| 182 | support the Xlib driver. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 183 | |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 184 | <h3 id="dri">DRI</h3><p>This mode uses the DRI hardware drivers for |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 185 | accelerated OpenGL rendering. Enable the DRI drivers with the option |
| 186 | <code>--with-driver=dri</code>. See the <a href="install.html">basic |
| 187 | installation instructions</a> for details on prerequisites for the DRI |
| 188 | drivers. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 189 | |
| 190 | <!-- DRI specific options --> |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 191 | <dl> |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 192 | <dt><code>--with-dri-driverdir=DIR</code> |
| 193 | <dd><p> This option specifies the |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 194 | location the DRI drivers will be installed to and the location libGL |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 195 | will search for DRI drivers. The default is <code>${libdir}/dri</code>. |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 196 | <dt><code>--with-dri-drivers=DRIVER,DRIVER,...</code> |
| 197 | <dd><p> This option |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 198 | allows a specific set of DRI drivers to be built. For example, |
Dan Nicholson | 5cae1b7 | 2008-06-30 10:28:02 -0700 | [diff] [blame] | 199 | <code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By |
| 200 | default, the drivers will be chosen depending on the target platform. |
| 201 | See the directory <code>src/mesa/drivers/dri</code> in the source tree |
| 202 | for available drivers. Beware that the swrast DRI driver is used by both |
| 203 | libGL and the X.Org xserver GLX module to do software rendering, so you |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 204 | may run into problems if it is not available. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 205 | <!-- This explanation might be totally bogus. Kristian? --> |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 206 | <dt><code>--disable-driglx-direct</code> |
| 207 | <dd><p> Disable direct rendering in |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 208 | GLX. Normally, direct hardware rendering through the DRI drivers and |
| 209 | indirect software rendering are enabled in GLX. This option disables |
| 210 | direct rendering entirely. It can be useful on architectures where |
| 211 | kernel DRM modules are not available. |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 212 | <dt><code>--enable-glx-tls</code> <dd><p> |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 213 | Enable Thread Local Storage (TLS) in |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 214 | GLX. |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 215 | <dt><code>--with-expat=DIR</code> <dd> The DRI-enabled libGL uses expat to |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 216 | parse the DRI configuration files in <code>/etc/drirc</code> and |
| 217 | <code>~/.drirc</code>. This option allows a specific expat installation |
| 218 | to be used. For example, <code>--with-expat=/usr/local</code> will |
| 219 | search for expat headers and libraries in <code>/usr/local/include</code> |
| 220 | and <code>/usr/local/lib</code>, respectively. |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 221 | </dl> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 222 | |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 223 | <h3 id="osmesa">OSMesa </h3><p> No libGL is built in this |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 224 | mode. Instead, the driver code is built into the Off-Screen Mesa |
| 225 | (OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a> |
| 226 | page for more details. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 227 | |
| 228 | <!-- OSMesa specific options --> |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 229 | <dl> |
Andreas Boll | dae9b0f | 2012-06-25 21:52:47 +0200 | [diff] [blame] | 230 | <dt><code>--with-osmesa-bits=BITS</code> |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 231 | <dd><p> This option allows the size |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 232 | of the color channel in bits to be specified. By default, an 8-bit |
| 233 | channel will be used, and the driver will be named libOSMesa. Other |
| 234 | options are 16- and 32-bit color channels, which will add the bit size |
| 235 | to the library name. For example, <code>--with-osmesa-bits=16</code> |
| 236 | will create the libOSMesa16 library with a 16-bit color channel. |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 237 | </dl> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 238 | |
| 239 | |
Christopher Yeleighton | 7f94d98 | 2012-03-12 12:21:24 -0600 | [diff] [blame] | 240 | <h2 id="library">3. Library Options</h2> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 241 | |
| 242 | <p> |
| 243 | The configure script provides more fine grained control over the GL |
| 244 | libraries that will be built. More details on the specific GL libraries |
| 245 | can be found in the <a href="install.html">basic installation |
| 246 | instructions</a>. |
| 247 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 248 | </div> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 249 | </body> |
| 250 | </html> |