| 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 |  | 
 | 60 | <pre> | 
 | 61 | 0) If you've downloaded Mesa via CVS there will not be a "configure" | 
 | 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: | 
 | 65 |  | 
 | 66 | 	autoconf 2.50 | 
 | 67 | 	automake 1.4-p2 | 
 | 68 | 	libtool 1.4 | 
 | 69 |  | 
 | 70 |  | 
 | 71 | 1) Run the configure script | 
 | 72 |  | 
 | 73 | 	./configure [options] | 
 | 74 |  | 
 | 75 | For Linux, it is recommended that you use: | 
 | 76 | 	./configure --prefix=/usr | 
 | 77 | So that the headers and libs are located according to the Linux/OpenGL | 
 | 78 | standard spec at http://oss.sgi.com/projects/ogl-sample/ABI/ | 
 | 79 |  | 
 | 80 | Possible options are: | 
 | 81 |  | 
 | 82 | --prefix=DIR | 
 | 83 | 	The toplevel directory of the hierachy in which Mesa | 
 | 84 | 	will be installed (DIR/include,DIR/lib etc.). | 
 | 85 | 	The default is "/usr/local". | 
 | 86 |  | 
 | 87 | --sysconfdir=DIR | 
 | 88 | 	The directory where Mesa configuration files | 
 | 89 | 	will be stored.	The default is "$prefix/etc". | 
 | 90 | 	You may want to overwrite the default with --sysconfdir=/etc. | 
 | 91 |  | 
 | 92 | --enable-static | 
 | 93 | 	Enable building of static libraries. | 
 | 94 | 	Static libraries are NOT built by default. | 
 | 95 | 	 | 
 | 96 | --disable-shared | 
 | 97 | 	Disable building of shared libraries. | 
 | 98 | 	Shared libraries are built by default. | 
 | 99 |  | 
 | 100 | --with-pic | 
 | 101 | --without-pic | 
 | 102 | 	In normal operation, libtool will build shared libraries from | 
 | 103 | 	PIC objects and static archives from non-PIC objects, except where one | 
 | 104 | 	or the other is not provided by the target host.  By specifying | 
 | 105 | 	--with-pic you are asking libtool to build static archives from | 
 | 106 | 	PIC objects, and similarly by specifying --without-pic you are asking | 
 | 107 | 	libtool to build shared	libraries from non-PIC objects. | 
 | 108 | 	libtool will only honour this flag where it will produce a | 
 | 109 | 	working library, otherwise it reverts to the default. | 
 | 110 | 	 | 
 | 111 | --enable-debug | 
 | 112 | 	Enable debugging messages (disabled by default). | 
 | 113 | 	 | 
 | 114 | --enable-profile | 
 | 115 | 	Enable profiling (disabled by default). | 
 | 116 | 	 | 
 | 117 | --disable-optimize | 
 | 118 | 	Disable extra optimizations (enabled by default, | 
 | 119 | 	i.e., optimize for maximum performance). | 
 | 120 | 	 | 
 | 121 | --enable-warn | 
 | 122 | 	Enable extended compiler warnings (disabled by default). | 
 | 123 | 	 | 
 | 124 | --enable-x86[=ARG] | 
 | 125 | --disable-x86 | 
 | 126 | 	Enable/disable x86 assembler support to speed up Mesa | 
 | 127 | 	(autodetected by default). You may set `on' or `off'. | 
 | 128 | 	 | 
 | 129 | --enable-3dnow[=ARG] | 
 | 130 | --disable-3dnow | 
 | 131 | 	Enable/disable 3Dnow support to speed up Mesa | 
 | 132 | 	(autodetected by default). You may set `on' or `off'. | 
 | 133 | 	 | 
 | 134 | --enable-mmx[=ARG] | 
 | 135 | --disable-mmx | 
 | 136 | 	Enable/disable MMX support to speed up Mesa | 
 | 137 | 	(autodetected by default). You may set `on' or `off'. | 
 | 138 | 	 | 
 | 139 | --enable-sse[=ARG] | 
 | 140 | --disable-sse | 
 | 141 | 	Enable/disable SSE support to speed up Mesa | 
 | 142 | 	(autodetected by default). You may set `on' or `off'. | 
 | 143 | 	If you have a PentiumIII and want to use SSE make sure you have the | 
 | 144 | 	PIII Linux kernel-patch installed or things will fail! | 
 | 145 | 	You can get the patch from http://www.redhat.com/~dledford/linux_kernel.html | 
 | 146 | 	 | 
 | 147 | --with-glide[=DIR] | 
 | 148 | --without-glide | 
 | 149 | 	Enable/disable support for Glide (disabled by default). | 
 | 150 | 	DIR is the installation directory of Glide. | 
 | 151 | 	If Glide cannot be found, the driver won't be built. | 
 | 152 | 	 | 
 | 153 | --with-glut[=DIR] | 
 | 154 | --without-glut | 
 | 155 | 	Don't/use already-installed GLUT (autodetected by default). | 
 | 156 | 	DIR is the installation directory of Glut. | 
 | 157 | 	If GLUT cannot be found, the version shipped with Mesa will be built. | 
 | 158 | 	 | 
 | 159 | --with-ggi[=DIR] | 
 | 160 | --without-ggi | 
 | 161 | 	Enable/disable support for GGI (autodetected by default). | 
 | 162 | 	DIR is the installation directory of GGI. | 
 | 163 | 	If GGI cannot be found, the driver won't be built. | 
 | 164 |  | 
 | 165 | --disable-ggi-fbdev | 
 | 166 | 	Don't build the GGI fbdev target (autodetected by default). | 
 | 167 | 	 | 
 | 168 | --disable-ggi-genkgi | 
 | 169 | 	Don't build the GGI generic KGI driver (autodetected by default). | 
 | 170 | 	 | 
 | 171 | --disable-ggi-savage4 | 
 | 172 | 	Don't build the GGI Savage4 KGI driver (autodetected by default). | 
 | 173 | 	 | 
 | 174 | --disable-osmesa | 
 | 175 | 	Disable OSmesa (offscreen rendering) support (enabled by default). | 
 | 176 |  | 
 | 177 | --with-svga[=DIR] | 
 | 178 | --without-svga | 
 | 179 | 	Enable/disable support for SVGALib (autodetected by default). | 
 | 180 | 	DIR is the installation directory of SVGALib. | 
 | 181 | 	If SVGALib cannot be found, the driver won't be built. | 
 | 182 |  | 
 | 183 | --x-includes=DIR | 
 | 184 | 	Search for the X include files in DIR. | 
 | 185 | 	 | 
 | 186 | --x-libraries=DIR | 
 | 187 | 	Search for the X library files in DIR. | 
 | 188 |  | 
 | 189 | User specific compiler options can be set using the shell variable | 
 | 190 | CFLAGS. For instance, | 
 | 191 | 	CFLAGS="-g -O2" ./configure | 
 | 192 | (on some systems: env CFLAGS="-g -O2" ./configure) | 
 | 193 | sets the compiler flags to "-g -O2". | 
 | 194 |  | 
 | 195 | For more options run "./configure --help" and read INSTALL.GNU. | 
 | 196 |  | 
 | 197 | 2) To build the Mesa libraries run: | 
 | 198 |  | 
 | 199 | 	make | 
 | 200 |  | 
 | 201 | When finished, libGL.so will be in src/.libs/, libGLU.so will be in | 
 | 202 | si-glu/.libs/, etc. | 
 | 203 |  | 
 | 204 | Optionally, you can strip the libraries using | 
 | 205 |  | 
 | 206 | 	make strip | 
 | 207 | 	 | 
 | 208 | Now make sure that you have the permissions to install Mesa in the  | 
 | 209 | specified directories, for example, by becoming super user ("su") | 
 | 210 | Then run: | 
 | 211 |  | 
 | 212 | 	make install | 
 | 213 |  | 
 | 214 | Mesa is now installed. | 
 | 215 | Please don't move the installed files but rerun all installation | 
 | 216 | steps if you want to use other directories. | 
 | 217 |  | 
 | 218 |  | 
 | 219 | 3) To test whether Mesa works properly you might want to run the Mesa demos: | 
 | 220 |  | 
 | 221 | 	make check | 
 | 222 | 	 | 
 | 223 | Builds all demos. | 
 | 224 |  | 
 | 225 | 	make exec | 
 | 226 |  | 
 | 227 | Builds and executes all demos.	 | 
 | 228 | </pre> | 
 | 229 |  | 
 | 230 |  | 
 | 231 | <a name="old"> | 
 | 232 | <H2>OLD-STYLE compilation and installation</H2> | 
 | 233 |  | 
 | 234 | <p> | 
 | 235 | This procedure usually works when <code>./configure ; make</code> fails. | 
 | 236 | </p> | 
 | 237 |  | 
 | 238 | <p> | 
 | 239 | <b>Note</b>: If you tried <code>./configure ; make</code> but it failed, | 
 | 240 | first copy the top-level <code>Makefile.X11</code> file over | 
 | 241 | <code>Makefile</code>. | 
 | 242 | </p> | 
 | 243 |  | 
 | 244 | <p> | 
 | 245 | First, just type <code>make</code> alone. | 
 | 246 | You'll see a list of supported system configurations. | 
 | 247 | Choose one and type <code>make</code> <em>config</em>. | 
 | 248 | The Mesa libraries and demo programs will be compiled. | 
 | 249 | </p> | 
 | 250 |  | 
 | 251 | <H3>Header and library files</H3> | 
 | 252 |  | 
 | 253 | <p> | 
 | 254 | The standard location for the OpenGL header files on Unix-type systems is | 
 | 255 | in <code>/usr/include/GL/</code>. | 
 | 256 | The standard location for the libraries is <code>/usr/lib/</code>. | 
 | 257 | For more information see, the | 
 | 258 | <a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent"> | 
 | 259 | Linux/OpenGL ABI specification</a>. | 
 | 260 | </p> | 
 | 261 |  | 
 | 262 | <p> | 
 | 263 | If you'd like Mesa to co-exist with another implementation of OpenGL that's | 
 | 264 | already installed, you'll have to choose different directories, like | 
 | 265 | <code>/usr/local/include/GL/</code> and <code>/usr/local/lib/</code>. | 
 | 266 | </p> | 
 | 267 |  | 
 | 268 | <p> | 
 | 269 | To install the Mesa headers, do this: | 
 | 270 | <pre> | 
 | 271 | 	cp -r include/GL /usr/include | 
 | 272 | </pre> | 
 | 273 |  | 
 | 274 | <p> | 
 | 275 | To install the Mesa libraries, do this: | 
 | 276 | </p> | 
 | 277 | <pre> | 
 | 278 | 	cp -pd lib/* /usr/lib | 
 | 279 |  | 
 | 280 | 	(The -pd options preserve symbolic links) | 
 | 281 | </pre> | 
 | 282 |  | 
 | 283 | <H3>LD_LIBRARY_PATH</H3> | 
 | 284 |  | 
 | 285 | <p> | 
 | 286 | On Linux and similar operating systems the <code>LD_LIBRARY_PATH</code> | 
 | 287 | environment variable can be used to indicate a list of directories to | 
 | 288 | search for shared libraries. | 
 | 289 | If you don't install Mesa in <code>/usr/lib/</code> you may have to | 
 | 290 | set the <code>LD_LIBRARY_PATH</code> variable in order to use the Mesa | 
 | 291 | libraries. | 
 | 292 | </p> | 
 | 293 |  | 
 | 294 | </body> | 
 | 295 | </html> |