-be configured via the ``configure`` script. This script sets variables in the
-various ``*.in`` files, most notably ``llvm/Makefile.config`` and
-``llvm/include/Config/config.h``. It also populates *OBJ_ROOT* with the
-Makefiles needed to begin building LLVM.
-
-The following environment variables are used by the ``configure`` script to
-configure the build system:
-
-+------------+-----------------------------------------------------------+
-| Variable | Purpose |
-+============+===========================================================+
-| CC | Tells ``configure`` which C compiler to use. By default, |
-| | ``configure`` will check ``PATH`` for ``clang`` and GCC C |
-| | compilers (in this order). Use this variable to override |
-| | ``configure``\'s default behavior. |
-+------------+-----------------------------------------------------------+
-| CXX | Tells ``configure`` which C++ compiler to use. By |
-| | default, ``configure`` will check ``PATH`` for |
-| | ``clang++`` and GCC C++ compilers (in this order). Use |
-| | this variable to override ``configure``'s default |
-| | behavior. |
-+------------+-----------------------------------------------------------+
-
-The following options can be used to set or enable LLVM specific options:
-
-``--enable-optimized``
-
- Enables optimized compilation (debugging symbols are removed and GCC
- optimization flags are enabled). Note that this is the default setting if you
- are using the LLVM distribution. The default behavior of a Subversion
- checkout is to use an unoptimized build (also known as a debug build).
-
-``--enable-debug-runtime``
-
- Enables debug symbols in the runtime libraries. The default is to strip debug
- symbols from the runtime libraries.
-
-``--enable-jit``
-
- Compile the Just In Time (JIT) compiler functionality. This is not available
- on all platforms. The default is dependent on platform, so it is best to
- explicitly enable it if you want it.
-
-``--enable-targets=target-option``
-
- Controls which targets will be built and linked into llc. The default value
- for ``target_options`` is "all" which builds and links all available targets.
- The "host" target is selected as the target of the build host. You can also
- specify a comma separated list of target names that you want available in llc.
- The target names use all lower case. The current set of targets is:
-
- ``aarch64, arm, arm64, cpp, hexagon, mips, mipsel, mips64, mips64el, msp430,
- powerpc, nvptx, r600, sparc, systemz, x86, x86_64, xcore``.
-
-``--enable-doxygen``
-
- Look for the doxygen program and enable construction of doxygen based
- documentation from the source code. This is disabled by default because
- generating the documentation can take a long time and producess 100s of
- megabytes of output.
+be configured before being built. For instructions using autotools please see
+`Building LLVM With Autotools <BuildingLLVMWithAutotools.html>`_. The
+recommended process uses CMake. Unlinke the normal ``configure`` script, CMake
+generates the build files in whatever format you request as well as various
+``*.inc`` files, and ``llvm/include/Config/config.h``.
+
+Variables are passed to ``cmake`` on the command line using the format
+``-D<variable name>=<value>``. The following variables are some common options
+used by people developing LLVM.
+
++-------------------------+----------------------------------------------------+
+| Variable | Purpose |
++=========================+====================================================+
+| CMAKE_C_COMPILER | Tells ``cmake`` which C compiler to use. By |
+| | default, this will be /usr/bin/cc. |
++-------------------------+----------------------------------------------------+
+| CMAKE_CXX_COMPILER | Tells ``cmake`` which C++ compiler to use. By |
+| | default, this will be /usr/bin/c++. |
++-------------------------+----------------------------------------------------+
+| CMAKE_BUILD_TYPE | Tells ``cmake`` what type of build you are trying |
+| | to generate files for. Valid options are Debug, |
+| | Release, RelWithDebInfo, and MinSizeRel. Default |
+| | is Debug. |
++-------------------------+----------------------------------------------------+
+| CMAKE_INSTALL_PREFIX | Specifies the install directory to target when |
+| | running the install action of the build files. |
++-------------------------+----------------------------------------------------+
+| LLVM_TARGETS_TO_BUILD | A semicolon delimited list controlling which |
+| | targets will be built and linked into llc. This is |
+| | equivalent to the ``--enable-targets`` option in |
+| | the configure script. The default list is defined |
+| | as ``LLVM_ALL_TARGETS``, and can be set to include |
+| | out-of-tree targets. The default value includes: |
+| | ``AArch64, AMDGPU, ARM, BPF, CppBackend, Hexagon, |
+| | Mips, MSP430, NVPTX, PowerPC, Sparc, SystemZ |
+| | X86, XCore``. |
++-------------------------+----------------------------------------------------+
+| LLVM_ENABLE_DOXYGEN | Build doxygen-based documentation from the source |
+| | code This is disabled by default because it is |
+| | slow and generates a lot of output. |
++-------------------------+----------------------------------------------------+
+| LLVM_ENABLE_SPHINX | Build sphinx-based documentation from the source |
+| | code. This is disabled by default because it is |
+| | slow and generates a lot of output. |
++-------------------------+----------------------------------------------------+
+| LLVM_BUILD_LLVM_DYLIB | Generate libLLVM.so. This library contains a |
+| | default set of LLVM components that can be |
+| | overridden with ``LLVM_DYLIB_COMPONENTS``. The |
+| | default contains most of LLVM and is defined in |
+| | ``tools/llvm-shlib/CMakelists.txt``. |
++-------------------------+----------------------------------------------------+
+| LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during |
+| | the LLVM build. This can dramatically speed up |
+| | debug builds. |
++-------------------------+----------------------------------------------------+