Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autoconf.html 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <html>
  2. <title>Compilation and Installation using Autoconf</title>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <body>
  5. <h1>Compilation and Installation using Autoconf</h1>
  6. <ol>
  7. <li><a href="#basic">Basic Usage</a></li>
  8. <li><a href="#driver">Driver Options</a></li>
  9. <ul>
  10. <li><a href="#xlib">Xlib Driver Options</a></li>
  11. <li><a href="#dri">DRI Driver Options</a></li>
  12. <li><a href="#osmesa">OSMesa Driver Options</a></li>
  13. </ul>
  14. <li><a href="#library">Library Options</a></li>
  15. <ul>
  16. <li><a href="#glu">GLU</a></li>
  17. <li><a href="#glw">GLw</a></li>
  18. <li><a href="#glut">GLUT</a></li>
  19. </ul>
  20. <li><a href="#demos">Demo Program Options</a></li>
  21. </ol>
  22. <a name="basic">
  23. <h2>1. Basic Usage</h2>
  24. <p>
  25. The autoconf generated configure script can be used to guess your
  26. platform and change various options for building Mesa. To use the
  27. configure script, type:
  28. </p>
  29. <pre>
  30. ./configure
  31. </pre>
  32. <p>
  33. To see a short description of all the options, type <code>./configure
  34. --help</code>. If you are using a development snapshot and the configure
  35. script does not exist, type <code>./autogen.sh</code> to generate it
  36. first. If you know the options you want to pass to
  37. <code>configure</code>, you can pass them to <code>autogen.sh</code>. It
  38. will run <code>configure</code> with these options after it is
  39. generated. Once you have run <code>configure</code> and set the options
  40. to your preference, type:
  41. </p>
  42. <pre>
  43. make
  44. </pre>
  45. <p>
  46. This will produce libGL.so and several other libraries depending on the
  47. options you have chosen. Later, if you want to rebuild for a different
  48. configuration run <code>make realclean</code> before rebuilding.
  49. </p>
  50. <p>
  51. Some of the generic autoconf options are used with Mesa:
  52. <ul>
  53. <li><code>--prefix=PREFIX</code> - This is the root directory where
  54. files will be installed by <code>make install</code>. The default is
  55. <code>/usr/local</code>.
  56. </li>
  57. <li><code>--exec-prefix=EPREFIX</code> - This is the root directory
  58. where architecture-dependent files will be installed. In Mesa, this is
  59. only used to derive the directory for the libraries. The default is
  60. <code>${prefix}</code>.
  61. </li>
  62. <li><code>--libdir=LIBDIR</code> - This option specifies the directory
  63. where the GL libraries will be installed. The default is
  64. <code>${exec_prefix}/lib</code>. It also serves as the name of the
  65. library staging area in the source tree. For instance, if the option
  66. <code>--libdir=/usr/local/lib64</code> is used, the libraries will be
  67. created in a <code>lib64</code> directory at the top of the Mesa source
  68. tree.
  69. </li>
  70. <li><code>--enable-static, --disable-shared</code> - By default, Mesa
  71. will build shared libraries. Either of these options will force static
  72. libraries to be built. It is not currently possible to build static and
  73. shared libraries in a single pass.
  74. </li>
  75. <li><code>CC, CFLAGS, CXX, CXXFLAGS</code> - These environment variables
  76. control the C and C++ compilers used during the build. By default,
  77. <code>gcc</code> and <code>g++</code> are used with the options
  78. <code>"-g -O2"</code>.
  79. </li>
  80. <li><code>LDFLAGS</code> - An environment variable specifying flags to
  81. pass when linking programs. These are normally empty, but can be used
  82. to direct the linker to use libraries in nonstandard directories. For
  83. example, <code>LDFLAGS="-L/usr/X11R6/lib"</code>.
  84. </li>
  85. <li><code>PKG_CONFIG_PATH</code> - When available, the
  86. <code>pkg-config</code> utility is used to search for external libraries
  87. on the system. This environment variable is used to control the search
  88. path for <code>pkg-config</code>. For instance, setting
  89. <code>PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig</code> will search for
  90. package metadata in <code>/usr/X11R6</code> before the standard
  91. directories.
  92. </li>
  93. </ul>
  94. </p>
  95. <p>
  96. There are also a few general options for altering the Mesa build:
  97. <ul>
  98. <li><code>--with-x</code> - When the X11 development libraries are
  99. needed, the <code>pkg-config</code> utility <a href="#pkg-config">will
  100. be used</a> for locating them. If they cannot be found through
  101. <code>pkg-config</code> a fallback routing using <code>imake</code> will
  102. be used. In this case, the <code>--with-x</code>,
  103. <code>--x-includes</code> and <code>--x-libraries</code> options can
  104. control the use of X for Mesa.
  105. </li>
  106. <li><code>--enable-gl-osmesa</code> - The <a href="osmesa.html">OSMesa
  107. library</a> can be built on top of libGL for drivers that provide it.
  108. This option controls whether to build libOSMesa. By default, this is
  109. enabled for the Xlib driver and disabled otherwise. Note that this
  110. option is different than using OSMesa as the driver.
  111. </li>
  112. <li><code>--enable-debug</code> - This option will enable compiler
  113. options and macros to aid in debugging the Mesa libraries.
  114. </li>
  115. <li><code>--disable-asm</code> - There are assembly routines
  116. available for a few architectures. These will be used by default if
  117. one of these architectures is detected. This option ensures that
  118. assembly will not be used.
  119. </li>
  120. <li><code>--enable-32-bit, --enable-64-bit</code> - By default, the
  121. build will compile code as directed by the environment variables
  122. <code>CC</code>, <code>CFLAGS</code>, etc. If the compiler is
  123. <code>gcc</code>, these options offer a helper to add the compiler flags
  124. to force 32- or 64-bit code generation as used on the x86 and x86_64
  125. architectures.
  126. </li>
  127. </ul>
  128. </p>
  129. <a name="driver">
  130. <h2>2. Driver Options</h2>
  131. <p>
  132. There are several different driver modes that Mesa can use. These are
  133. described in more detail in the <a href="install.html">basic
  134. installation instructions</a>. The Mesa driver is controlled through the
  135. configure option --with-driver. There are currently three supported
  136. options in the configure script.
  137. </p>
  138. <ul>
  139. <a name="xlib">
  140. <li><b><em>Xlib</em></b> - This is the default mode for building Mesa.
  141. It uses Xlib as a software renderer to do all rendering. It corresponds
  142. to the option <code>--with-driver=xlib</code>. The libX11 and libXext
  143. libraries, as well as the X11 development headers, will be need to
  144. support the Xlib driver.
  145. </li>
  146. <a name="dri">
  147. <li><b><em>DRI</em></b> - This mode uses the DRI hardware drivers for
  148. accelerated OpenGL rendering. Enable the DRI drivers with the option
  149. <code>--with-driver=dri</code>. See the <a href="install.html">basic
  150. installation instructions</a> for details on prerequisites for the DRI
  151. drivers.
  152. </li>
  153. <!-- DRI specific options -->
  154. <p>
  155. <ul>
  156. <li><code>--with-dri-driverdir=DIR</code> - This option specifies the
  157. location the DRI drivers will be installed to and the location libGL
  158. will search for DRI drivers. The default is <code>${libdir}/dri</code>.
  159. </li>
  160. <li><code>--with-dri-drivers=DRIVER,DRIVER,...</code> - This option
  161. allows a specific set of DRI drivers to be built. For example,
  162. <code>--with-dri-drivers="swrast,i965,radeon,nouveau"</code>. By
  163. default, the drivers will be chosen depending on the target platform.
  164. See the directory <code>src/mesa/drivers/dri</code> in the source tree
  165. for available drivers. Beware that the swrast DRI driver is used by both
  166. libGL and the X.Org xserver GLX module to do software rendering, so you
  167. may run into problems if it is not available.</li>
  168. <!-- This explanation might be totally bogus. Kristian? -->
  169. <li><code>--disable-driglx-direct</code> - Disable direct rendering in
  170. GLX. Normally, direct hardware rendering through the DRI drivers and
  171. indirect software rendering are enabled in GLX. This option disables
  172. direct rendering entirely. It can be useful on architectures where
  173. kernel DRM modules are not available.
  174. </li>
  175. <li><code>--enable-glx-tls</code> - Enable Thread Local Storage (TLS) in
  176. GLX.
  177. </li>
  178. <li><code>--with-expat=DIR</code> - The DRI-enabled libGL uses expat to
  179. parse the DRI configuration files in <code>/etc/drirc</code> and
  180. <code>~/.drirc</code>. This option allows a specific expat installation
  181. to be used. For example, <code>--with-expat=/usr/local</code> will
  182. search for expat headers and libraries in <code>/usr/local/include</code>
  183. and <code>/usr/local/lib</code>, respectively.
  184. </li>
  185. </ul>
  186. </p>
  187. <a name="osmesa">
  188. <li><b><em>OSMesa</em></b> - No libGL is built in this
  189. mode. Instead, the driver code is built into the Off-Screen Mesa
  190. (OSMesa) library. See the <a href="osmesa.html">Off-Screen Rendering</a>
  191. page for more details.
  192. </li>
  193. <!-- OSMesa specific options -->
  194. <p>
  195. <ul>
  196. <li><code>--with-osmesa-bits=BITS</code> - This option allows the size
  197. of the color channel in bits to be specified. By default, an 8-bit
  198. channel will be used, and the driver will be named libOSMesa. Other
  199. options are 16- and 32-bit color channels, which will add the bit size
  200. to the library name. For example, <code>--with-osmesa-bits=16</code>
  201. will create the libOSMesa16 library with a 16-bit color channel.
  202. </li>
  203. </ul>
  204. </p>
  205. </ul>
  206. <a name="library">
  207. <h2>3. Library Options</h2>
  208. <p>
  209. The configure script provides more fine grained control over the GL
  210. libraries that will be built. More details on the specific GL libraries
  211. can be found in the <a href="install.html">basic installation
  212. instructions</a>.
  213. <ul>
  214. <a name="glu">
  215. <li><b><em>GLU</em></b> - The libGLU library will be built by default
  216. on all drivers. This can be disable with the option
  217. <code>--disable-glu</code>.
  218. </li>
  219. <a name="glw">
  220. <li><b><em>GLw</em></b> - The libGLw library will be built by default
  221. if libGLU has been enabled. This can be disable with the option
  222. <code>--disable-glw</code>.
  223. </li>
  224. <a name="glut">
  225. <li><b><em>GLUT</em></b> - The libglut library will be built by default
  226. if libGLU has been enabled and the glut source code from the MesaGLUT
  227. tarball is available. This can be disable with the option
  228. <code>--disable-glut</code>.
  229. </li>
  230. </ul>
  231. </p>
  232. <a name="demos">
  233. <h2>4. Demo Program Options</h2>
  234. <p>
  235. There are many demonstration programs in the MesaDemos tarball. If the
  236. programs are available when <code>./configure</code> is run, a subset of
  237. the programs will be built depending on the driver and library options
  238. chosen. See the directory <code>progs</code> for the full set of demos.
  239. <ul>
  240. <li><code>--with-demos=DEMOS,DEMOS,...</code> - This option allows a
  241. specific set of demo programs to be built. For example,
  242. <code>--with-demos="xdemos,slang"</code>. Beware that if this option is
  243. used, it will not be ensured that the necessary GL libraries will be
  244. available.
  245. </li>
  246. <li><code>--without-demos</code> - This completely disables building the
  247. demo programs. It is equivalent to <code>--with-demos=no</code>.
  248. </li>
  249. </ul>
  250. </p>
  251. </body>
  252. </html>