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