Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 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> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 23 | </ul> |
| 24 | <li><a href="#demos">Demo Program Options</a></li> |
| 25 | </ol> |
| 26 | |
| 27 | |
| 28 | <a name="basic"> |
| 29 | <h2>1. Basic Usage</h2> |
| 30 | |
| 31 | <p> |
| 32 | The autoconf generated configure script can be used to guess your |
| 33 | platform and change various options for building Mesa. To use the |
| 34 | configure script, type: |
| 35 | </p> |
| 36 | |
| 37 | <pre> |
| 38 | ./configure |
| 39 | </pre> |
| 40 | |
| 41 | <p> |
| 42 | To see a short description of all the options, type <code>./configure |
| 43 | --help</code>. If you are using a development snapshot and the configure |
Dan Nicholson | 460d25d | 2008-03-07 12:04:17 -0800 | [diff] [blame] | 44 | script does not exist, type <code>./autogen.sh</code> to generate it |
| 45 | first. If you know the options you want to pass to |
| 46 | <code>configure</code>, you can pass them to <code>autogen.sh</code>. It |
| 47 | will run <code>configure</code> with these options after it is |
| 48 | generated. Once you have run <code>configure</code> and set the options |
| 49 | to your preference, type: |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 50 | </p> |
| 51 | |
| 52 | <pre> |
| 53 | make |
| 54 | </pre> |
| 55 | |
| 56 | <p> |
| 57 | This will produce libGL.so and several other libraries depending on the |
| 58 | options you have chosen. Later, if you want to rebuild for a different |
| 59 | configuration run <code>make realclean</code> before rebuilding. |
| 60 | </p> |
| 61 | |
| 62 | <p> |
| 63 | Some of the generic autoconf options are used with Mesa: |
| 64 | |
| 65 | <ul> |
| 66 | <li><code>--prefix=PREFIX</code> - This is the root directory where |
| 67 | files will be installed by <code>make install</code>. The default is |
| 68 | <code>/usr/local</code>. |
| 69 | </li> |
| 70 | <li><code>--exec-prefix=EPREFIX</code> - This is the root directory |
| 71 | where architecture-dependent files will be installed. In Mesa, this is |
| 72 | only used to derive the directory for the libraries. The default is |
| 73 | <code>${prefix}</code>. |
| 74 | </li> |
| 75 | <li><code>--libdir=LIBDIR</code> - This option specifies the directory |
| 76 | where the GL libraries will be installed. The default is |
| 77 | <code>${exec_prefix}/lib</code>. It also serves as the name of the |
| 78 | library staging area in the source tree. For instance, if the option |
| 79 | <code>--libdir=/usr/local/lib64</code> is used, the libraries will be |
| 80 | created in a <code>lib64</code> directory at the top of the Mesa source |
| 81 | tree. |
| 82 | </li> |
| 83 | <li><code>--enable-static, --disable-shared</code> - By default, Mesa |
| 84 | will build shared libraries. Either of these options will force static |
| 85 | libraries to be built. It is not currently possible to build static and |
| 86 | shared libraries in a single pass. |
| 87 | </li> |
| 88 | <li><code>CC, CFLAGS, CXX, CXXFLAGS</code> - These environment variables |
| 89 | control the C and C++ compilers used during the build. By default, |
| 90 | <code>gcc</code> and <code>g++</code> are used with the options |
| 91 | <code>"-g -O2"</code>. |
| 92 | </li> |
| 93 | <li><code>LDFLAGS</code> - An environment variable specifying flags to |
| 94 | pass when linking programs. These are normally empty, but can be used |
| 95 | to direct the linker to use libraries in nonstandard directories. For |
| 96 | example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>. |
| 97 | </li> |
| 98 | <li><code>PKG_CONFIG_PATH</code> - When available, the |
| 99 | <code>pkg-config</code> utility is used to search for external libraries |
| 100 | on the system. This environment variable is used to control the search |
| 101 | path for <code>pkg-config</code>. For instance, setting |
| 102 | <code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for |
| 103 | package metadata in <code>/usr/X11R6</code> before the standard |
| 104 | directories. |
| 105 | </li> |
| 106 | </ul> |
| 107 | </p> |
| 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> |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 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> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 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> |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 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> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 141 | </ul> |
| 142 | </p> |
| 143 | |
| 144 | |
| 145 | <a name="driver"> |
| 146 | <h2>2. Driver Options</h2> |
| 147 | |
| 148 | <p> |
| 149 | There are several different driver modes that Mesa can use. These are |
| 150 | described in more detail in the <a href="install.html">basic |
| 151 | installation instructions</a>. The Mesa driver is controlled through the |
| 152 | configure option --with-driver. There are currently three supported |
| 153 | options in the configure script. |
| 154 | </p> |
| 155 | |
| 156 | <ul> |
| 157 | |
| 158 | <a name="xlib"> |
| 159 | <li><b><em>Xlib</em></b> - This is the default mode for building Mesa. |
| 160 | It uses Xlib as a software renderer to do all rendering. It corresponds |
| 161 | to the option <code>--with-driver=xlib</code>. The libX11 and libXext |
| 162 | libraries, as well as the X11 development headers, will be need to |
| 163 | support the Xlib driver. |
| 164 | </li> |
| 165 | |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 166 | <a name="dri"> |
| 167 | <li><b><em>DRI</em></b> - This mode uses the DRI hardware drivers for |
| 168 | accelerated OpenGL rendering. Enable the DRI drivers with the option |
| 169 | <code>--with-driver=dri</code>. See the <a href="install.html">basic |
| 170 | installation instructions</a> for details on prerequisites for the DRI |
| 171 | drivers. |
| 172 | </li> |
| 173 | |
| 174 | <!-- DRI specific options --> |
| 175 | <p> |
| 176 | <ul> |
| 177 | <li><code>--with-dri-driverdir=DIR</code> - This option specifies the |
| 178 | location the DRI drivers will be installed to and the location libGL |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 179 | will search for DRI drivers. The default is <code>${libdir}/dri</code>. |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 180 | </li> |
| 181 | <li><code>--with-dri-drivers=DRIVER,DRIVER,...</code> - This option |
| 182 | allows a specific set of DRI drivers to be built. For example, |
Dan Nicholson | 5cae1b7 | 2008-06-30 10:28:02 -0700 | [diff] [blame] | 183 | <code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By |
| 184 | default, the drivers will be chosen depending on the target platform. |
| 185 | See the directory <code>src/mesa/drivers/dri</code> in the source tree |
| 186 | for available drivers. Beware that the swrast DRI driver is used by both |
| 187 | libGL and the X.Org xserver GLX module to do software rendering, so you |
| 188 | may run into problems if it is not available.</li> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 189 | <!-- This explanation might be totally bogus. Kristian? --> |
| 190 | <li><code>--disable-driglx-direct</code> - Disable direct rendering in |
| 191 | GLX. Normally, direct hardware rendering through the DRI drivers and |
| 192 | indirect software rendering are enabled in GLX. This option disables |
| 193 | direct rendering entirely. It can be useful on architectures where |
| 194 | kernel DRM modules are not available. |
| 195 | </li> |
| 196 | <li><code>--enable-glx-tls</code> - Enable Thread Local Storage (TLS) in |
| 197 | GLX. |
| 198 | </li> |
| 199 | <li><code>--with-expat=DIR</code> - The DRI-enabled libGL uses expat to |
| 200 | parse the DRI configuration files in <code>/etc/drirc</code> and |
| 201 | <code>~/.drirc</code>. This option allows a specific expat installation |
| 202 | to be used. For example, <code>--with-expat=/usr/local</code> will |
| 203 | search for expat headers and libraries in <code>/usr/local/include</code> |
| 204 | and <code>/usr/local/lib</code>, respectively. |
| 205 | </li> |
| 206 | </ul> |
| 207 | </p> |
| 208 | |
| 209 | <a name="osmesa"> |
| 210 | <li><b><em>OSMesa</em></b> - No libGL is built in this |
| 211 | mode. Instead, the driver code is built into the Off-Screen Mesa |
| 212 | (OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a> |
| 213 | page for more details. |
| 214 | </li> |
| 215 | |
| 216 | <!-- OSMesa specific options --> |
| 217 | <p> |
| 218 | <ul> |
| 219 | <li><code>--with-osmesa-bits=BITS</code> - This option allows the size |
| 220 | of the color channel in bits to be specified. By default, an 8-bit |
| 221 | channel will be used, and the driver will be named libOSMesa. Other |
| 222 | options are 16- and 32-bit color channels, which will add the bit size |
| 223 | to the library name. For example, <code>--with-osmesa-bits=16</code> |
| 224 | will create the libOSMesa16 library with a 16-bit color channel. |
| 225 | </li> |
| 226 | </ul> |
| 227 | </p> |
| 228 | |
| 229 | </ul> |
| 230 | |
| 231 | |
| 232 | <a name="library"> |
| 233 | <h2>3. Library Options</h2> |
| 234 | |
| 235 | <p> |
| 236 | The configure script provides more fine grained control over the GL |
| 237 | libraries that will be built. More details on the specific GL libraries |
| 238 | can be found in the <a href="install.html">basic installation |
| 239 | instructions</a>. |
| 240 | |
| 241 | <ul> |
| 242 | <a name="glu"> |
| 243 | <li><b><em>GLU</em></b> - The libGLU library will be built by default |
| 244 | on all drivers. This can be disable with the option |
| 245 | <code>--disable-glu</code>. |
| 246 | </li> |
Dan Nicholson | 4c5a2b3 | 2007-12-23 16:38:18 -0800 | [diff] [blame] | 247 | </ul> |
| 248 | </p> |
| 249 | |
| 250 | |
| 251 | <a name="demos"> |
| 252 | <h2>4. Demo Program Options</h2> |
| 253 | |
| 254 | <p> |
| 255 | There are many demonstration programs in the MesaDemos tarball. If the |
| 256 | programs are available when <code>./configure</code> is run, a subset of |
| 257 | the programs will be built depending on the driver and library options |
| 258 | chosen. See the directory <code>progs</code> for the full set of demos. |
| 259 | |
| 260 | <ul> |
| 261 | <li><code>--with-demos=DEMOS,DEMOS,...</code> - This option allows a |
| 262 | specific set of demo programs to be built. For example, |
| 263 | <code>--with-demos="xdemos,slang"</code>. Beware that if this option is |
| 264 | used, it will not be ensured that the necessary GL libraries will be |
| 265 | available. |
| 266 | </li> |
| 267 | <li><code>--without-demos</code> - This completely disables building the |
| 268 | demo programs. It is equivalent to <code>--with-demos=no</code>. |
| 269 | </li> |
| 270 | </ul> |
| 271 | </p> |
| 272 | |
| 273 | </body> |
| 274 | </html> |