blob: 1dedfa19c454f51bb6c22d906689798c9aa8ed18 [file] [log] [blame]
Brian Paul0b27ace2003-03-08 17:38:57 +00001<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>
10If you're not using a variant of Unix with X11, see the
11<a href="systems.html">Supported Systems and Drivers</a> section
12for instructions.
13</p>
14
15<p>
16There 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>
22Basically, type "./configure" followed by "make"
23This <em>should</em> work on most Unix-like operating systems.
24Unfortunately, autoconf/automake seems to seldom work reliably on non-Linux
25systems. 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>
31Simply type <code>make</code> and you'll see a list of supported
32system configurations. Pick one and type <code>make</code> <em>config</em>.
33More details below.
34</dd>
35</dl>
36
37<p>
38<B>NOTE</b>: The GLUT library and demonstrations programs are in the
39MesaDemos-x.y.z.tar.gz file. If you don't have GLUT or you want to
40run some demos, download the MesaDemos package too.
41</p>
42
43<p>
44In 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
50package)
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>
610) 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
711) Run the configure script
72
73 ./configure [options]
74
75For Linux, it is recommended that you use:
76 ./configure --prefix=/usr
77So that the headers and libs are located according to the Linux/OpenGL
78standard spec at http://oss.sgi.com/projects/ogl-sample/ABI/
79
80Possible 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
189User specific compiler options can be set using the shell variable
190CFLAGS. For instance,
191 CFLAGS="-g -O2" ./configure
192(on some systems: env CFLAGS="-g -O2" ./configure)
193sets the compiler flags to "-g -O2".
194
195For more options run "./configure --help" and read INSTALL.GNU.
196
1972) To build the Mesa libraries run:
198
199 make
200
201When finished, libGL.so will be in src/.libs/, libGLU.so will be in
202si-glu/.libs/, etc.
203
204Optionally, you can strip the libraries using
205
206 make strip
207
208Now make sure that you have the permissions to install Mesa in the
209specified directories, for example, by becoming super user ("su")
210Then run:
211
212 make install
213
214Mesa is now installed.
215Please don't move the installed files but rerun all installation
216steps if you want to use other directories.
217
218
2193) To test whether Mesa works properly you might want to run the Mesa demos:
220
221 make check
222
223Builds all demos.
224
225 make exec
226
227Builds and executes all demos.
228</pre>
229
230
231<a name="old">
232<H2>OLD-STYLE compilation and installation</H2>
233
234<p>
235This 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,
240first copy the top-level <code>Makefile.X11</code> file over
241<code>Makefile</code>.
242</p>
243
244<p>
245First, just type <code>make</code> alone.
246You'll see a list of supported system configurations.
247Choose one and type <code>make</code> <em>config</em>.
248The Mesa libraries and demo programs will be compiled.
249</p>
250
251<H3>Header and library files</H3>
252
253<p>
254The standard location for the OpenGL header files on Unix-type systems is
255in <code>/usr/include/GL/</code>.
256The standard location for the libraries is <code>/usr/lib/</code>.
257For more information see, the
258<a href="http://oss.sgi.com/projects/ogl-sample/ABI/" target="_parent">
259Linux/OpenGL ABI specification</a>.
260</p>
261
262<p>
263If you'd like Mesa to co-exist with another implementation of OpenGL that's
264already 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>
269To install the Mesa headers, do this:
270<pre>
271 cp -r include/GL /usr/include
272</pre>
273
274<p>
275To 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>
286On Linux and similar operating systems the <code>LD_LIBRARY_PATH</code>
287environment variable can be used to indicate a list of directories to
288search for shared libraries.
289If you don't install Mesa in <code>/usr/lib/</code> you may have to
290set the <code>LD_LIBRARY_PATH</code> variable in order to use the Mesa
291libraries.
292</p>
293
294</body>
295</html>