si: Use util_blend_factor_uses_dest
[mesa.git] / docs / meson.rst
index 65d9b923965da4faafab521ca21b6fb3f4746a81..aa68094cd1af57228d7247709800f4077a24021d 100644 (file)
@@ -1,13 +1,6 @@
 Compilation and Installation Using Meson
 ========================================
 
--  `Introduction <#intro>`__
--  `Basic Usage <#basic>`__
--  `Advanced Usage <#advanced>`__
--  `Cross-compilation and 32-bit builds <#cross-compilation>`__
-
-.. _intro:
-
 1. Introduction
 ---------------
 
@@ -17,7 +10,14 @@ website <https://mesonbuild.com/>`__.
 **Mesa's Meson build system is generally considered stable and ready for
 production.**
 
-**Mesa requires Meson >= 0.52.0 to build.**
+.. note::
+
+   Mesa requires Meson >= 0.52.0 to build.
+
+   If your distribution doesn't have something recent enough in its
+   repositories, you can `try the methods suggested here
+   <https://mesonbuild.com/Getting-meson.html>`__ to install the
+   current version of Meson.
 
 The Meson build of Mesa is tested on Linux, macOS, Windows, Cygwin,
 Haiku, FreeBSD, DragonflyBSD, NetBSD, and should work on OpenBSD.
@@ -28,13 +28,13 @@ Unix-like OSes
 If Meson is not already installed on your system, you can typically
 install it with your package installer. For example:
 
-::
+.. code-block:: console
 
    sudo apt-get install meson   # Ubuntu
 
 or
 
-::
+.. code-block:: console
 
    sudo dnf install meson   # Fedora
 
@@ -54,28 +54,26 @@ modules (mako). You also need pkg-config (a hard dependency of meson),
 flex, and bison. The easiest way to install everything you need is with
 `chocolatey <https://chocolatey.org/>`__.
 
-::
+.. code-block:: console
 
    choco install python3 winflexbison pkgconfiglite
 
 You can even use chocolatey to install mingw and ninja (ninja can be
 used with MSVC as well)
 
-::
+.. code-block:: console
 
    choco install ninja mingw
 
 Then install meson using pip
 
-::
+.. code-block:: console
 
    py -3 -m pip install meson mako
 
 You may need to add the python3 scripts directory to your path for
 meson.
 
-.. _basic:
-
 2. Basic Usage
 --------------
 
@@ -92,7 +90,7 @@ for each configuration you might want to use.
 
 Basic configuration is done with:
 
-::
+.. code-block:: console
 
    meson build/
 
@@ -102,7 +100,7 @@ configuration option (see below).
 
 To review the options which Meson chose, run:
 
-::
+.. code-block:: console
 
    meson configure build/
 
@@ -118,7 +116,7 @@ With additional arguments ``meson configure`` can be used to change
 options for a previously configured build directory. All options passed
 to this command are in the form ``-D "option"="value"``. For example:
 
-::
+.. code-block:: console
 
    meson configure build/ -Dprefix=/tmp/install -Dglx=true
 
@@ -131,7 +129,7 @@ an empty list (``-D platforms=[]``).
 Once you've run the initial ``meson`` command successfully you can use
 your configured backend to build the project in your build directory:
 
-::
+.. code-block:: console
 
    ninja -C build/
 
@@ -139,18 +137,10 @@ The next step is to install the Mesa libraries, drivers, etc. This also
 finishes up some final steps of the build process (such as creating
 symbolic links for drivers). To install:
 
-::
+.. code-block:: console
 
    ninja -C build/ install
 
-Note: autotools automatically updated translation files (used by the DRI
-configuration tool) as part of the build process, Meson does not do
-this. Instead, you will need do this:
-
-::
-
-   ninja -C build/ xmlpool-pot xmlpool-update-po xmlpool-gmo
-
 Windows specific instructions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -171,13 +161,11 @@ visual studio integration or you just like msbuild, passing
 want to use ICL or clang-cl with the vsbackend you will need meson
 0.52.0 or greater. Older versions always use the microsoft compiler.
 
-.. _advanced:
-
 3. Advanced Usage
 -----------------
 
 Installation Location
-~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^
 
 Meson default to installing libGL.so in your system's main lib/
 directory and DRI drivers to a dri/ subdirectory.
@@ -186,7 +174,7 @@ Developers will often want to install Mesa to a testing directory rather
 than the system library directory. This can be done with the --prefix
 option. For example:
 
-::
+.. code-block:: console
 
    meson --prefix="${PWD}/build/install" build/
 
@@ -197,24 +185,24 @@ that location to run/test the driver.
 Meson also honors ``DESTDIR`` for installs.
 
 Compiler Options
-~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^
 
 Meson supports the common CFLAGS, CXXFLAGS, etc. environment variables
 but their use is discouraged because of the many caveats in using them.
 
-Instead, it is recomended to use ``-D${lang}_args`` and
+Instead, it is recommended to use ``-D${lang}_args`` and
 ``-D${lang}_link_args``. Among the benefits of these options is that
 they are guaranteed to persist across rebuilds and reconfigurations.
 
 This example sets -fmax-errors for compiling C sources and -DMAGIC=123
 for C++ sources:
 
-::
+.. code-block:: console
 
    meson builddir/ -Dc_args=-fmax-errors=10 -Dcpp_args=-DMAGIC=123
 
 Compiler Specification
-~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^
 
 Meson supports the standard CC and CXX environment variables for
 changing the default compiler. Note that Meson does not allow changing
@@ -224,7 +212,7 @@ build dir for a different compiler.
 This is an example of specifying the clang compilers and cleaning the
 build directory before reconfiguring with an extra C option:
 
-::
+.. code-block:: console
 
    CC=clang CXX=clang++ meson build-clang
    ninja -C build-clang
@@ -237,7 +225,7 @@ most of the popular compilers, a complete list is available
 `here <https://mesonbuild.com/Reference-tables.html#compiler-ids>`__.
 
 LLVM
-~~~~
+^^^^
 
 Meson includes upstream logic to wrap llvm-config using its standard
 dependency interface.
@@ -249,7 +237,7 @@ libraries, it will never find libllvm.so. There is also a
 ``-Dcmake_module_path`` option in this meson version, which points to
 the root of an alternative installation (the prefix). For example:
 
-::
+.. code-block:: console
 
    meson builddir -Dcmake_module_path=/home/user/mycmake/prefix
 
@@ -268,7 +256,7 @@ custom-llvm.ini
 
 Then configure meson:
 
-::
+.. code-block:: console
 
    meson builddir/ --native-file custom-llvm.ini
 
@@ -277,7 +265,7 @@ Meson < 0.49 doesn't support native files, so to specify a custom
 windows), which will be searched for ``llvm-config``,
 ``llvm-config$version``, and ``llvm-config-$version``:
 
-::
+.. code-block:: console
 
    PATH=/path/to/folder/with/llvm-config:$PATH meson build
 
@@ -298,11 +286,11 @@ Obviously, only cmake or llvm-config is required.
 
 Then configure meson:
 
-::
+.. code-block:: console
 
    meson builddir/ --cross-file cross-llvm.ini
 
-See the `Cross Compilation <#cross-compilation>`__ section for more
+See the :ref:`Cross Compilation <cross-compilation>` section for more
 information.
 
 On windows (and in other cases), using llvm-config or cmake may be
@@ -322,7 +310,7 @@ The wrap file must define the following:
 It may also define:
 
 -  ``irbuilder_h``: a ``files()`` object pointing to llvm/IR/IRBuilder.h
-   (this is requred for SWR)
+   (this is required for SWR)
 -  ``has_rtti``: a ``bool`` that declares whether LLVM was built with
    RTTI. Defaults to true
 
@@ -373,7 +361,7 @@ not, workarounds for the wrong version of LLVM might be used resulting
 in build failures.
 
 ``PKG_CONFIG_PATH``
-~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^
 
 The ``pkg-config`` utility is a hard requirement for configuring and
 building Mesa on Unix-like systems. It is used to search for external
@@ -383,7 +371,7 @@ the search path for ``pkg-config``. For instance, setting
 metadata in ``/usr/X11R6`` before the standard directories.
 
 Options
-~~~~~~~
+^^^^^^^
 
 One of the oddities of meson is that some options are different when
 passed to the ``meson`` than to ``meson configure``. These options are