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