Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 1 | <HTML> |
| 2 | |
| 3 | <TITLE>Compilation and Installation</TITLE> |
| 4 | |
| 5 | <BODY text="#000000" bgcolor="#55bbff" link="#111188"> |
| 6 | |
| 7 | <H1>Compilation and Installation for Unix/X11</H1> |
| 8 | |
| 9 | <p> |
| 10 | If you're not using a variant of Unix with X11, see the |
| 11 | <a href="systems.html">Supported Systems and Drivers</a> section |
| 12 | for instructions. |
| 13 | </p> |
| 14 | |
| 15 | <p> |
| 16 | There are two methods for building Mesa on Unix/X11 systems: |
| 17 | </p> |
| 18 | |
| 19 | <dl> |
| 20 | <dt><a href="#new">NEW-STYLE</a><dt> |
| 21 | <dd> |
| 22 | Basically, type "./configure" followed by "make" |
| 23 | This <em>should</em> work on most Unix-like operating systems. |
| 24 | Unfortunately, autoconf/automake seems to seldom work reliably on non-Linux |
| 25 | systems. For that reason, the old-style make system is still supported |
| 26 | (and is the preferred method of the Mesa developers). |
| 27 | </dd> |
| 28 | <br> |
| 29 | <dt><a href="#old">OLD-STYLE</a><dt> |
| 30 | <dd> |
| 31 | Simply type <code>make</code> and you'll see a list of supported |
| 32 | system configurations. Pick one and type <code>make</code> <em>config</em>. |
| 33 | More details below. |
Brian Paul | afc0428 | 2003-09-03 23:04:31 +0000 | [diff] [blame] | 34 | <br> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 35 | </dd> |
| 36 | </dl> |
| 37 | |
| 38 | <p> |
| 39 | <B>NOTE</b>: The GLUT library and demonstrations programs are in the |
| 40 | MesaDemos-x.y.z.tar.gz file. If you don't have GLUT or you want to |
| 41 | run some demos, download the MesaDemos package too. |
| 42 | </p> |
| 43 | |
| 44 | <p> |
| 45 | In either case, building Mesa entails the following: |
| 46 | <p> |
| 47 | <ul> |
| 48 | <li>Compiling libGL, the OpenGL-replacement library. |
| 49 | <li>Compiling libGLU, the OpenGL Utility library. |
| 50 | <li>Compiling libglut, the GLUT library (if you downloaded the Mesa demos |
| 51 | package) |
| 52 | <li>Compiling the demonstration programs in the directories: |
| 53 | <code>demos, xdemos, samples</code> and <code>book</code> |
| 54 | (if you downloaded the Mesa demos package.) |
| 55 | </ul> |
| 56 | |
| 57 | |
| 58 | <a name="new"> |
| 59 | <H2>NEW-STYLE compilation and installation</H2> |
| 60 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 61 | <p> |
| 62 | <b> 0.</b> If you've downloaded Mesa via CVS there will not be a "configure" |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 63 | script. You'll have to run the "bootstrap" script first. This script |
| 64 | may not work on any OS other than Linux. You'll need these programs |
| 65 | to run the bootstrap script: |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 66 | </p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 67 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 68 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 69 | autoconf 2.50 |
| 70 | automake 1.4-p2 |
| 71 | libtool 1.4 |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 72 | </pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 73 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 74 | <p> |
| 75 | <b>1.</b> Run the configure script |
| 76 | </p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 77 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 78 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 79 | ./configure [options] |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 80 | </pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 81 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 82 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 83 | For Linux, it is recommended that you use: |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 84 | </p> |
| 85 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 86 | ./configure --prefix=/usr |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 87 | </pre> |
| 88 | |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 89 | So that the headers and libs are located according to the Linux/OpenGL |
| 90 | standard spec at http://oss.sgi.com/projects/ogl-sample/ABI/ |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 91 | </p> |
| 92 | <p> |
| 93 | For Red Hat 8.0, Mandrake 9.1 and other Linux distros, you may have to use |
| 94 | the following: |
| 95 | </p> |
| 96 | <pre> |
| 97 | export LDFLAGS="-lstdc++" ; ./configure --prefix=/usr |
| 98 | or |
| 99 | setenv LDFLAGS -lstdc++ ; ./configure --prefix=/usr |
| 100 | </pre> |
| 101 | <p> |
| 102 | This works around a problem when building the GLU library. It needs to |
| 103 | be linked with the C++ runtime library, but libtool (for some reason) |
| 104 | doesn't do this. |
| 105 | </p> |
| 106 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 107 | Possible options are: |
| 108 | |
| 109 | --prefix=DIR |
| 110 | The toplevel directory of the hierachy in which Mesa |
| 111 | will be installed (DIR/include,DIR/lib etc.). |
| 112 | The default is "/usr/local". |
| 113 | |
| 114 | --sysconfdir=DIR |
| 115 | The directory where Mesa configuration files |
| 116 | will be stored. The default is "$prefix/etc". |
| 117 | You may want to overwrite the default with --sysconfdir=/etc. |
| 118 | |
| 119 | --enable-static |
| 120 | Enable building of static libraries. |
| 121 | Static libraries are NOT built by default. |
| 122 | |
| 123 | --disable-shared |
| 124 | Disable building of shared libraries. |
| 125 | Shared libraries are built by default. |
| 126 | |
| 127 | --with-pic |
| 128 | --without-pic |
| 129 | In normal operation, libtool will build shared libraries from |
| 130 | PIC objects and static archives from non-PIC objects, except where one |
| 131 | or the other is not provided by the target host. By specifying |
| 132 | --with-pic you are asking libtool to build static archives from |
| 133 | PIC objects, and similarly by specifying --without-pic you are asking |
| 134 | libtool to build shared libraries from non-PIC objects. |
| 135 | libtool will only honour this flag where it will produce a |
| 136 | working library, otherwise it reverts to the default. |
| 137 | |
| 138 | --enable-debug |
| 139 | Enable debugging messages (disabled by default). |
| 140 | |
| 141 | --enable-profile |
| 142 | Enable profiling (disabled by default). |
| 143 | |
| 144 | --disable-optimize |
| 145 | Disable extra optimizations (enabled by default, |
| 146 | i.e., optimize for maximum performance). |
| 147 | |
| 148 | --enable-warn |
| 149 | Enable extended compiler warnings (disabled by default). |
| 150 | |
| 151 | --enable-x86[=ARG] |
| 152 | --disable-x86 |
| 153 | Enable/disable x86 assembler support to speed up Mesa |
| 154 | (autodetected by default). You may set `on' or `off'. |
| 155 | |
| 156 | --enable-3dnow[=ARG] |
| 157 | --disable-3dnow |
| 158 | Enable/disable 3Dnow support to speed up Mesa |
| 159 | (autodetected by default). You may set `on' or `off'. |
| 160 | |
| 161 | --enable-mmx[=ARG] |
| 162 | --disable-mmx |
| 163 | Enable/disable MMX support to speed up Mesa |
| 164 | (autodetected by default). You may set `on' or `off'. |
| 165 | |
| 166 | --enable-sse[=ARG] |
| 167 | --disable-sse |
| 168 | Enable/disable SSE support to speed up Mesa |
| 169 | (autodetected by default). You may set `on' or `off'. |
| 170 | If you have a PentiumIII and want to use SSE make sure you have the |
| 171 | PIII Linux kernel-patch installed or things will fail! |
| 172 | You can get the patch from http://www.redhat.com/~dledford/linux_kernel.html |
| 173 | |
| 174 | --with-glide[=DIR] |
| 175 | --without-glide |
| 176 | Enable/disable support for Glide (disabled by default). |
| 177 | DIR is the installation directory of Glide. |
| 178 | If Glide cannot be found, the driver won't be built. |
| 179 | |
| 180 | --with-glut[=DIR] |
| 181 | --without-glut |
| 182 | Don't/use already-installed GLUT (autodetected by default). |
| 183 | DIR is the installation directory of Glut. |
| 184 | If GLUT cannot be found, the version shipped with Mesa will be built. |
| 185 | |
| 186 | --with-ggi[=DIR] |
| 187 | --without-ggi |
| 188 | Enable/disable support for GGI (autodetected by default). |
| 189 | DIR is the installation directory of GGI. |
| 190 | If GGI cannot be found, the driver won't be built. |
| 191 | |
| 192 | --disable-ggi-fbdev |
| 193 | Don't build the GGI fbdev target (autodetected by default). |
| 194 | |
| 195 | --disable-ggi-genkgi |
| 196 | Don't build the GGI generic KGI driver (autodetected by default). |
| 197 | |
| 198 | --disable-ggi-savage4 |
| 199 | Don't build the GGI Savage4 KGI driver (autodetected by default). |
| 200 | |
| 201 | --disable-osmesa |
| 202 | Disable OSmesa (offscreen rendering) support (enabled by default). |
| 203 | |
| 204 | --with-svga[=DIR] |
| 205 | --without-svga |
| 206 | Enable/disable support for SVGALib (autodetected by default). |
| 207 | DIR is the installation directory of SVGALib. |
| 208 | If SVGALib cannot be found, the driver won't be built. |
| 209 | |
| 210 | --x-includes=DIR |
| 211 | Search for the X include files in DIR. |
| 212 | |
| 213 | --x-libraries=DIR |
| 214 | Search for the X library files in DIR. |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 215 | </pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 216 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 217 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 218 | User specific compiler options can be set using the shell variable |
| 219 | CFLAGS. For instance, |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 220 | </p> |
| 221 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 222 | CFLAGS="-g -O2" ./configure |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 223 | </pre> |
| 224 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 225 | (on some systems: env CFLAGS="-g -O2" ./configure) |
| 226 | sets the compiler flags to "-g -O2". |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 227 | </p> |
| 228 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 229 | For more options run "./configure --help" and read INSTALL.GNU. |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 230 | </p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 231 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 232 | <p> |
| 233 | <b>2.</b> To build the Mesa libraries run: |
| 234 | </p> |
| 235 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 236 | make |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 237 | </pre> |
Brian Paul | 8412c60 | 2003-04-01 15:33:08 +0000 | [diff] [blame] | 238 | <p>(on some systems you may need to run <code>gmake</code> or |
| 239 | <code>gnumake</code> instead) |
| 240 | </p> |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 241 | <p> |
| 242 | When finished, libGL.so will be in src/.libs/ and libGLU.so will be in |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 243 | si-glu/.libs/, etc. |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 244 | </p> |
| 245 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 246 | Optionally, you can strip the libraries using |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 247 | </p> |
| 248 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 249 | make strip |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 250 | </pre> |
| 251 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 252 | Now make sure that you have the permissions to install Mesa in the |
| 253 | specified directories, for example, by becoming super user ("su") |
| 254 | Then run: |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 255 | </p> |
| 256 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 257 | make install |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 258 | </pre> |
| 259 | <p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 260 | Mesa is now installed. |
| 261 | Please don't move the installed files but rerun all installation |
| 262 | steps if you want to use other directories. |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 263 | </p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 264 | |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 265 | <p> |
| 266 | <b>3.</b>To test whether Mesa works properly you might want to run the |
| 267 | Mesa demos: |
| 268 | </p> |
| 269 | <pre> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 270 | make check |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 271 | </pre> |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 272 | <p> |
| 273 | Builds all demos. |
| 274 | </p> |
| 275 | <pre> |
| 276 | make exec |
| 277 | </pre> |
| 278 | <p> |
| 279 | Builds and executes all demos. |
| 280 | </p> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 281 | |
| 282 | |
| 283 | <a name="old"> |
| 284 | <H2>OLD-STYLE compilation and installation</H2> |
| 285 | |
| 286 | <p> |
| 287 | This procedure usually works when <code>./configure ; make</code> fails. |
| 288 | </p> |
| 289 | |
| 290 | <p> |
| 291 | <b>Note</b>: If you tried <code>./configure ; make</code> but it failed, |
| 292 | first copy the top-level <code>Makefile.X11</code> file over |
| 293 | <code>Makefile</code>. |
| 294 | </p> |
| 295 | |
| 296 | <p> |
Brian Paul | afc0428 | 2003-09-03 23:04:31 +0000 | [diff] [blame] | 297 | <B>Also Note</B>: if you've obtained Mesa directly from CVS you'll have |
| 298 | to copy the top-level Makefile.X11 to Makefile. |
| 299 | </p> |
| 300 | |
| 301 | <p> |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 302 | Just type <code>make</code> alone. |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 303 | You'll see a list of supported system configurations. |
Brian Paul | b0eee79 | 2003-03-16 16:43:04 +0000 | [diff] [blame] | 304 | Choose one and type <code>make</code> <em>config</em> |
| 305 | (for example <code>make linux-x86</code>). |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 306 | The Mesa libraries and demo programs will be compiled. |
| 307 | </p> |
| 308 | |
| 309 | <H3>Header and library files</H3> |
| 310 | |
| 311 | <p> |
| 312 | The standard location for the OpenGL header files on Unix-type systems is |
| 313 | in <code>/usr/include/GL/</code>. |
| 314 | The standard location for the libraries is <code>/usr/lib/</code>. |
| 315 | For more information see, the |
| 316 | <a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent"> |
| 317 | Linux/OpenGL ABI specification</a>. |
| 318 | </p> |
| 319 | |
| 320 | <p> |
| 321 | If you'd like Mesa to co-exist with another implementation of OpenGL that's |
| 322 | already installed, you'll have to choose different directories, like |
| 323 | <code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>. |
| 324 | </p> |
| 325 | |
| 326 | <p> |
| 327 | To install the Mesa headers, do this: |
| 328 | <pre> |
| 329 | cp -r include/GL /usr/include |
| 330 | </pre> |
| 331 | |
| 332 | <p> |
| 333 | To install the Mesa libraries, do this: |
| 334 | </p> |
| 335 | <pre> |
| 336 | cp -pd lib/* /usr/lib |
| 337 | |
| 338 | (The -pd options preserve symbolic links) |
| 339 | </pre> |
| 340 | |
| 341 | <H3>LD_LIBRARY_PATH</H3> |
| 342 | |
| 343 | <p> |
| 344 | On Linux and similar operating systems the <code>LD_LIBRARY_PATH</code> |
| 345 | environment variable can be used to indicate a list of directories to |
| 346 | search for shared libraries. |
| 347 | If you don't install Mesa in <code>/usr/lib/</code> you may have to |
| 348 | set the <code>LD_LIBRARY_PATH</code> variable in order to use the Mesa |
| 349 | libraries. |
| 350 | </p> |
| 351 | |
| 352 | </body> |
| 353 | </html> |