Compilation and Installation using Autoconf
- -1. Basic Usage
+1. Basic Usage
The autoconf generated configure script can be used to guess your @@ -56,234 +55,203 @@ to your preference, type:
-This will produce libGL.so and several other libraries depending on the
+This will produce libGL.so and/or several other libraries depending on the
options you have chosen. Later, if you want to rebuild for a different
configuration run make realclean
before rebuilding.
Some of the generic autoconf options are used with Mesa: - -
-
-
--prefix=PREFIX
- This is the root directory where + +-
+
--prefix=PREFIX
+This is the root directory where files will be installed by
make install
. The default is -/usr/local
. -
---exec-prefix=EPREFIX
- This is the root directory +/usr/local
. + + + +--exec-prefix=EPREFIX
This is the root directory where architecture-dependent files will be installed. In Mesa, this is only used to derive the directory for the libraries. The default is -
${prefix}
. -
---libdir=LIBDIR
- This option specifies the directory +${prefix}
. + + + +--libdir=LIBDIR
This option specifies the directory where the GL libraries will be installed. The default is
${exec_prefix}/lib
. It also serves as the name of the library staging area in the source tree. For instance, if the option--libdir=/usr/local/lib64
is used, the libraries will be created in alib64
directory at the top of the Mesa source -tree. -
---enable-static, --disable-shared
- By default, Mesa +tree. + + + +--sysconfdir=DIR
+ +This option specifies the directory where the configuration +files will be installed. The default is
+${prefix}/etc
. +Currently there's only one config file provided when dri drivers are +enabled - it'sdrirc
. +--enable-static, --disable-shared
By default, Mesa will build shared libraries. Either of these options will force static libraries to be built. It is not currently possible to build static and -shared libraries in a single pass. -
-CC, CFLAGS, CXX, CXXFLAGS
- These environment variables +shared libraries in a single pass. + + + +CC, CFLAGS, CXX, CXXFLAGS
These environment variables control the C and C++ compilers used during the build. By default, -
gcc
andg++
are used with the options -"-g -O2"
. -
-LDFLAGS
- An environment variable specifying flags to -pass when linking programs. These are normally empty, but can be used -to direct the linker to use libraries in nonstandard directories. For -example,LDFLAGS="-L/usr/X11R6/lib"
. -
-PKG_CONFIG_PATH
- When available, the -pkg-config
utility is used to search for external libraries +gcc
andg++
are used and the debug/optimisation +level is left unchanged. + + + +LDFLAGS
+ +An environment variable specifying flags to +pass when linking programs. These should be empty and +
+PKG_CONFIG_PATH
is recommended to be used instead. If needed +it can be used to direct the linker to use libraries in nonstandard +directories. For example,LDFLAGS="-L/usr/X11R6/lib"
. +PKG_CONFIG_PATH
The +
pkg-config
utility is a hard requirement for configuring and +building mesa. It is used to search for external libraries on the system. This environment variable is used to control the search path forpkg-config
. For instance, settingPKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig
will search for package metadata in/usr/X11R6
before the standard -directories. -
-
There are also a few general options for altering the Mesa build: -
-
-
--with-x
- When the X11 development libraries are -needed, thepkg-config
utility will -be used for locating them. If they cannot be found through -pkg-config
a fallback routing usingimake
will -be used. In this case, the--with-x
, ---x-includes
and--x-libraries
options can -control the use of X for Mesa. -
---enable-gl-osmesa
- The OSMesa -library can be built on top of libGL for drivers that provide it. -This option controls whether to build libOSMesa. By default, this is -enabled for the Xlib driver and disabled otherwise. Note that this -option is different than using OSMesa as the driver. -
---enable-debug
- This option will enable compiler -options and macros to aid in debugging the Mesa libraries. -
---disable-asm
- There are assembly routines + +-
+
--enable-debug
+This option will set the compiler debug/optimisation levels (if the user +hasn't already set them via the CFLAGS/CXXFLAGS) and macros to aid in +debugging the Mesa libraries.
+ +Note that enabling this option can lead to noticeable loss of performance.
+ +--disable-asm
+There are assembly routines available for a few architectures. These will be used by default if one of these architectures is detected. This option ensures that -assembly will not be used. -
---enable-32-bit, --enable-64-bit
- By default, the -build will compile code as directed by the environment variables -CC
,CFLAGS
, etc. If the compiler is -gcc
, these options offer a helper to add the compiler flags -to force 32- or 64-bit code generation as used on the x86 and x86_64 -architectures. -
-
--build=
--host=
By default, the build will compile code for the architecture that +it's running on. In order to build cross-compile Mesa on a x86-64 machine +that is to run on a i686, one would need to set the options to:
+ +--build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu
PKG_CONFIG_PATH
as well.
-
-2. Driver Options
+ +In some cases a single compiler is capable of handling both architectures
+(multilib) in that case one would need to set the CC,CXX
variables
+appending the correct machine options. Seek your compiler documentation for
+further information -
+ gcc
+machine dependent options
In addition to specifying correct PKG_CONFIG_PATH
for the target
+architecture, the following should be sufficient to configure multilib Mesa
./configure CC="gcc -m32" CXX="g++ -m32" --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu ...
+2. GL Driver Options
There are several different driver modes that Mesa can use. These are
described in more detail in the basic
installation instructions. The Mesa driver is controlled through the
-configure option --with-driver. There are currently three supported
-options in the configure script.
+configure options --enable-glx
and --enable-osmesa
-
-
-
-
- Xlib - This is the default mode for building Mesa.
+
Xlib
It uses Xlib as a software renderer to do all rendering. It corresponds -to the option
--with-driver=xlib
. The libX11 and libXext -libraries, as well as the X11 development headers, will be need to -support the Xlib driver. -
-
-
- - DRI - This mode uses the DRI hardware drivers for
-accelerated OpenGL rendering. Enable the DRI drivers with the option
-
--with-driver=dri
. See the basic -installation instructions for details on prerequisites for the DRI -drivers. -
+to the option --with-dri-driverdir=DIR
- This option specifies the +-
+
--with-dri-driverdir=DIR
+This option specifies the location the DRI drivers will be installed to and the location libGL will search for DRI drivers. The default is
${libdir}/dri
. -
---with-dri-drivers=DRIVER,DRIVER,...
- This option +--with-dri-drivers=DRIVER,DRIVER,...
+This option allows a specific set of DRI drivers to be built. For example,
--with-dri-drivers="swrast,i965,radeon,nouveau"
. By default, the drivers will be chosen depending on the target platform. See the directorysrc/mesa/drivers/dri
in the source tree for available drivers. Beware that the swrast DRI driver is used by both libGL and the X.Org xserver GLX module to do software rendering, so you -may run into problems if it is not available.
+may run into problems if it is not available.
---disable-driglx-direct
- Disable direct rendering in +--disable-driglx-direct
+Disable direct rendering in GLX. Normally, direct hardware rendering through the DRI drivers and indirect software rendering are enabled in GLX. This option disables direct rendering entirely. It can be useful on architectures where kernel DRM modules are not available. -
---enable-glx-tls
- Enable Thread Local Storage (TLS) in +--enable-glx-tls
+Enable Thread Local Storage (TLS) in GLX. -
---with-expat=DIR
- The DRI-enabled libGL uses expat to -parse the DRI configuration files in/etc/drirc
and +--with-expat=DIR
+DEPRECATED, use
+PKG_CONFIG_PATH
instead.The DRI-enabled libGL uses expat to +parse the DRI configuration files in
${sysconfdir}/drirc
and~/.drirc
. This option allows a specific expat installation to be used. For example,--with-expat=/usr/local
will search for expat headers and libraries in/usr/local/include
and/usr/local/lib
, respectively. -
-- OSMesa - No libGL is built in this
+
OSMesa
No libGL is built in this mode. Instead, the driver code is built into the Off-Screen Mesa (OSMesa) library. See the Off-Screen Rendering -page for more details. -
+page for more details. It corresponds to the option
+ --with-osmesa-bits=BITS
- This option allows the size +-
+
--with-osmesa-bits=BITS
+This option allows the size of the color channel in bits to be specified. By default, an 8-bit channel will be used, and the driver will be named libOSMesa. Other options are 16- and 32-bit color channels, which will add the bit size to the library name. For example,
--with-osmesa-bits=16
will create the libOSMesa16 library with a 16-bit color channel. -
-
--enable-glx=xlib
or --enable-glx=gallium-xlib
.
+
+DRI
This mode uses the DRI hardware drivers for
+accelerated OpenGL rendering. To enable use --enable-glx=dri
+--enable-dri
.
-
-
-
-
--enable-osmesa
.
--
-
-
3. Library Options
+3. Library Options
-The configure script provides more fine grained control over the GL -libraries that will be built. More details on the specific GL libraries -can be found in the basic installation -instructions. - -
-
-
-
- GLU - The libGLU library will be built by default
-on all drivers. This can be disable with the option
-
--disable-glu
. -
-
-
- - GLw - The libGLw library will be built by default
-if libGLU has been enabled. This can be disable with the option
-
--disable-glw
. -
-
-
- - GLUT - The libglut library will be built by default
-if libGLU has been enabled and the glut source code from the MesaGLUT
-tarball is available. This can be disable with the option
-
--disable-glut
. -
-
4. Demo Program Options
- -
-There are many demonstration programs in the MesaDemos tarball. If the
-programs are available when ./configure
is run, a subset of
-the programs will be built depending on the driver and library options
-chosen. See the directory progs
for the full set of demos.
-
-
-
-
--with-demos=DEMOS,DEMOS,...
- This option allows a -specific set of demo programs to be built. For example, ---with-demos="xdemos,slang"
. Beware that if this option is -used, it will not be ensured that the necessary GL libraries will be -available. -
---without-demos
- This completely disables building the -demo programs. It is equivalent to--with-demos=no
. -
-