<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 13, 2015, at 1:29 AM, Justin Bogner <<a href="mailto:mail@justinbogner.com" class="">mail@justinbogner.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Chris Bieneman <</span><a href="mailto:beanz@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">beanz@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> writes:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Author: cbieneman<br class="">Date: Thu Mar 12 20:58:14 2015<br class="">New Revision: 232135<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232135&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=232135&view=rev</a><br class="">Log:<br class="">Updating GettingStarted documentation to reference CMake as the<br class="">preferred way to build LLVM.<br class=""><br class="">Reviewers: chandlerc, samsonov, echristo<br class=""><br class="">Reviewed By: samsonov<br class=""><br class="">Subscribers: emaste, joker.eph, llvm-commits<br class=""><br class="">Differential Revision: <a href="http://reviews.llvm.org/D8046" class="">http://reviews.llvm.org/D8046</a><br class=""><br class="">Added:<br class="">   llvm/trunk/docs/BuildingLLVMWithAutotools.rst<br class="">Modified:<br class="">   llvm/trunk/docs/GettingStarted.rst<br class="">   llvm/trunk/docs/index.rst<br class=""><br class="">Added: llvm/trunk/docs/BuildingLLVMWithAutotools.rst<br class="">URL:<br class=""><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/BuildingLLVMWithAutotools.rst?rev=232135&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/BuildingLLVMWithAutotools.rst?rev=232135&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/docs/BuildingLLVMWithAutotools.rst (added)<br class="">+++ llvm/trunk/docs/BuildingLLVMWithAutotools.rst Thu Mar 12 20:58:14 2015<br class="">@@ -0,0 +1,297 @@<br class="">+====================================<br class="">+Building LLVM With Autotools<br class="">+====================================<br class="">+<br class="">+.. contents::<br class="">+   :local:<br class="">+<br class="">+Overview<br class="">+========<br class="">+<br class="">+<br class="">+Local LLVM Configuration<br class="">+------------------------<br class="">+<br class="">+Once checked out from the Subversion repository, the LLVM suite source code must<br class="">+be configured via the ``configure`` script.  This script sets variables in the<br class="">+various ``*.in`` files, most notably ``llvm/Makefile.config`` and<br class="">+``llvm/include/Config/config.h``.  It also populates *OBJ_ROOT* with the<br class="">+Makefiles needed to begin building LLVM.<br class="">+<br class="">+The following environment variables are used by the ``configure`` script to<br class="">+configure the build system:<br class="">+<br class="">++------------+-----------------------------------------------------------+<br class="">+| Variable   | Purpose                                                   |<br class="">++============+===========================================================+<br class="">+| CC         | Tells ``configure`` which C compiler to use.  By default, |<br class="">+|            | ``configure`` will check ``PATH`` for ``clang`` and GCC C |<br class="">+|            | compilers (in this order).  Use this variable to override |<br class="">+|            | ``configure``\'s  default behavior.                       |<br class="">++------------+-----------------------------------------------------------+<br class="">+| CXX        | Tells ``configure`` which C++ compiler to use.  By        |<br class="">+|            | default, ``configure`` will check ``PATH`` for            |<br class="">+|            | ``clang++`` and GCC C++ compilers (in this order).  Use   |<br class="">+|            | this variable to override  ``configure``'s default        |<br class="">+|            | behavior.                                                 |<br class="">++------------+-----------------------------------------------------------+<br class="">+<br class="">+The following options can be used to set or enable LLVM specific options:<br class="">+<br class="">+``--enable-optimized``<br class="">+<br class="">+  Enables optimized compilation (debugging symbols are removed and GCC<br class="">+  optimization flags are enabled). Note that this is the default setting if you<br class="">+  are using the LLVM distribution. The default behavior of a Subversion<br class="">+  checkout is to use an unoptimized build (also known as a debug build).<br class="">+<br class="">+``--enable-debug-runtime``<br class="">+<br class="">+  Enables debug symbols in the runtime libraries. The default is to strip debug<br class="">+  symbols from the runtime libraries.<br class="">+<br class="">+``--enable-jit``<br class="">+<br class="">+  Compile the Just In Time (JIT) compiler functionality.  This is not available<br class="">+  on all platforms.  The default is dependent on platform, so it is best to<br class="">+  explicitly enable it if you want it.<br class="">+<br class="">+``--enable-targets=target-option``<br class="">+<br class="">+  Controls which targets will be built and linked into llc. The default value<br class="">+  for ``target_options`` is "all" which builds and links all available targets.<br class="">+  The "host" target is selected as the target of the build host. You can also<br class="">+  specify a comma separated list of target names that you want available in llc.<br class="">+  The target names use all lower case. The current set of targets is:<br class="">+<br class="">+    ``aarch64, arm, arm64, cpp, hexagon, mips, mipsel, mips64, mips64el, msp430,<br class="">+    powerpc, nvptx, r600, sparc, systemz, x86, x86_64, xcore``.<br class="">+<br class="">+``--enable-doxygen``<br class="">+<br class="">+  Look for the doxygen program and enable construction of doxygen based<br class="">+  documentation from the source code. This is disabled by default because<br class="">+  generating the documentation can take a long time and producess 100s of<br class="">+  megabytes of output.<br class="">+<br class="">+To configure LLVM, follow these steps:<br class="">+<br class="">+#. Change directory into the object root directory:<br class="">+<br class="">+   .. code-block:: console<br class="">+<br class="">+     % cd OBJ_ROOT<br class="">+<br class="">+#. Run the ``configure`` script located in the LLVM source tree:<br class="">+<br class="">+   .. code-block:: console<br class="">+<br class="">+     % SRC_ROOT/configure --prefix=/install/path [other options]<br class="">+<br class="">+Compiling the LLVM Suite Source Code<br class="">+------------------------------------<br class="">+<br class="">+Once you have configured LLVM, you can build it.  There are three types of<br class="">+builds:<br class="">+<br class="">+Debug Builds<br class="">+<br class="">+  These builds are the default when one is using a Subversion checkout and<br class="">+  types ``gmake`` (unless the ``--enable-optimized`` option was used during<br class="">+  configuration).  The build system will compile the tools and libraries with<br class="">+  debugging information.  To get a Debug Build using the LLVM distribution the<br class="">+  ``--disable-optimized`` option must be passed to ``configure``.<br class="">+<br class="">+Release (Optimized) Builds<br class="">+<br class="">+  These builds are enabled with the ``--enable-optimized`` option to<br class="">+  ``configure`` or by specifying ``ENABLE_OPTIMIZED=1`` on the ``gmake`` command<br class="">+  line.  For these builds, the build system will compile the tools and libraries<br class="">+  with GCC optimizations enabled and strip debugging information from the<br class="">+  libraries and executables it generates.  Note that Release Builds are default<br class="">+  when using an LLVM distribution.<br class="">+<br class="">+Profile Builds<br class="">+<br class="">+  These builds are for use with profiling.  They compile profiling information<br class="">+  into the code for use with programs like ``gprof``.  Profile builds must be<br class="">+  started by specifying ``ENABLE_PROFILING=1`` on the ``gmake`` command line.<br class="">+<br class="">+Once you have LLVM configured, you can build it by entering the *OBJ_ROOT*<br class="">+directory and issuing the following command:<br class="">+<br class="">+.. code-block:: console<br class="">+<br class="">+  % gmake<br class="">+<br class="">+If the build fails, please `check here <GettingStarted.html#check-here>`_<br class="">+to see if you are using a version of GCC that is known not to compile LLVM.<br class="">+<br class="">+If you have multiple processors in your machine, you may wish to use some of the<br class="">+parallel build options provided by GNU Make.  For example, you could use the<br class="">+command:<br class="">+<br class="">+.. code-block:: console<br class="">+<br class="">+  % gmake -j2<br class="">+<br class="">+There are several special targets which are useful when working with the LLVM<br class="">+source code:<br class="">+<br class="">+``gmake clean``<br class="">+<br class="">+  Removes all files generated by the build.  This includes object files,<br class="">+  generated C/C++ files, libraries, and executables.<br class="">+<br class="">+``gmake dist-clean``<br class="">+<br class="">+  Removes everything that ``gmake clean`` does, but also removes files generated<br class="">+  by ``configure``.  It attempts to return the source tree to the original state<br class="">+  in which it was shipped.<br class="">+<br class="">+``gmake install``<br class="">+<br class="">+  Installs LLVM header files, libraries, tools, and documentation in a hierarchy<br class="">+  under ``$PREFIX``, specified with ``./configure --prefix=[dir]``, which<br class="">+  defaults to ``/usr/local``.<br class="">+<br class="">+``gmake -C runtime install-bytecode``<br class="">+<br class="">+  Assuming you built LLVM into $OBJDIR, when this command is run, it will<br class="">+  install bitcode libraries into the GCC front end's bitcode library directory.<br class="">+  If you need to update your bitcode libraries, this is the target to use once<br class="">+  you've built them.<br class="">+<br class="">+Please see the `Makefile Guide <MakefileGuide.html>`_ for further details on<br class="">+these ``make`` targets and descriptions of other targets available.<br class="">+<br class="">+It is also possible to override default values from ``configure`` by declaring<br class="">+variables on the command line.  The following are some examples:<br class="">+<br class="">+``gmake ENABLE_OPTIMIZED=1``<br class="">+<br class="">+  Perform a Release (Optimized) build.<br class="">+<br class="">+``gmake ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1``<br class="">+<br class="">+  Perform a Release (Optimized) build without assertions enabled.<br class="">+<br class="">+``gmake ENABLE_OPTIMIZED=0``<br class="">+<br class="">+  Perform a Debug build.<br class="">+<br class="">+``gmake ENABLE_PROFILING=1``<br class="">+<br class="">+  Perform a Profiling build.<br class="">+<br class="">+``gmake VERBOSE=1``<br class="">+<br class="">+  Print what ``gmake`` is doing on standard output.<br class="">+<br class="">+``gmake TOOL_VERBOSE=1``<br class="">+<br class="">+  Ask each tool invoked by the makefiles to print out what it is doing on<br class="">+  the standard output. This also implies ``VERBOSE=1``.<br class="">+<br class="">+Every directory in the LLVM object tree includes a ``Makefile`` to build it and<br class="">+any subdirectories that it contains.  Entering any directory inside the LLVM<br class="">+object tree and typing ``gmake`` should rebuild anything in or below that<br class="">+directory that is out of date.<br class="">+<br class="">+This does not apply to building the documentation.<br class="">+LLVM's (non-Doxygen) documentation is produced with the<br class="">+`Sphinx <http://sphinx-doc.org/>`_ documentation generation system.<br class="">+There are some HTML documents that have not yet been converted to the new<br class="">+system (which uses the easy-to-read and easy-to-write<br class="">+`reStructuredText <http://sphinx-doc.org/rest.html>`_ plaintext markup<br class="">+language).<br class="">+The generated documentation is built in the ``SRC_ROOT/docs`` directory using<br class="">+a special makefile.<br class="">+For instructions on how to install Sphinx, see<br class="">+`Sphinx Introduction for LLVM Developers<br class="">+<http://lld.llvm.org/sphinx_intro.html>`_.<br class="">+After following the instructions there for installing Sphinx, build the LLVM<br class="">+HTML documentation by doing the following:<br class="">+<br class="">+.. code-block:: console<br class="">+<br class="">+  $ cd SRC_ROOT/docs<br class="">+  $ make -f Makefile.sphinx<br class="">+<br class="">+This creates a ``_build/html`` sub-directory with all of the HTML files, not<br class="">+just the generated ones.<br class="">+This directory corresponds to ``llvm.org/docs``.<br class="">+For example, ``_build/html/SphinxQuickstartTemplate.html`` corresponds to<br class="">+``llvm.org/docs/SphinxQuickstartTemplate.html``.<br class="">+The :doc:`SphinxQuickstartTemplate` is useful when creating a new document.<br class="">+<br class="">+Cross-Compiling LLVM<br class="">+--------------------<br class="">+<br class="">+It is possible to cross-compile LLVM itself. That is, you can create LLVM<br class="">+executables and libraries to be hosted on a platform different from the platform<br class="">+where they are built (a Canadian Cross build). To configure a cross-compile,<br class="">+supply the configure script with ``--build`` and ``--host`` options that are<br class="">+different. The values of these options must be legal target triples that your<br class="">+GCC compiler supports.<br class="">+<br class="">+The result of such a build is executables that are not runnable on on the build<br class="">+host (--build option) but can be executed on the compile host (--host option).<br class="">+<br class="">+Check :doc:`HowToCrossCompileLLVM` and `Clang docs on how to cross-compile in general<br class="">+<http://clang.llvm.org/docs/CrossCompilation.html>`_ for more information<br class="">+about cross-compiling.<br class="">+<br class="">+The Location of LLVM Object Files<br class="">+---------------------------------<br class="">+<br class="">+The LLVM build system is capable of sharing a single LLVM source tree among<br class="">+several LLVM builds.  Hence, it is possible to build LLVM for several different<br class="">+platforms or configurations using the same source tree.<br class="">+<br class="">+This is accomplished in the typical autoconf manner:<br class="">+<br class="">+* Change directory to where the LLVM object files should live:<br class="">+<br class="">+  .. code-block:: console<br class="">+<br class="">+    % cd OBJ_ROOT<br class="">+<br class="">+* Run the ``configure`` script found in the LLVM source directory:<br class="">+<br class="">+  .. code-block:: console<br class="">+<br class="">+    % SRC_ROOT/configure<br class="">+<br class="">+The LLVM build will place files underneath *OBJ_ROOT* in directories named after<br class="">+the build type:<br class="">+<br class="">+Debug Builds with assertions enabled (the default)<br class="">+<br class="">+  Tools<br class="">+<br class="">+    ``OBJ_ROOT/Debug+Asserts/bin``<br class="">+<br class="">+  Libraries<br class="">+<br class="">+    ``OBJ_ROOT/Debug+Asserts/lib``<br class="">+<br class="">+Release Builds<br class="">+<br class="">+  Tools<br class="">+<br class="">+    ``OBJ_ROOT/Release/bin``<br class="">+<br class="">+  Libraries<br class="">+<br class="">+    ``OBJ_ROOT/Release/lib``<br class="">+<br class="">+Profile Builds<br class="">+<br class="">+  Tools<br class="">+<br class="">+    ``OBJ_ROOT/Profile/bin``<br class="">+<br class="">+  Libraries<br class="">+<br class="">+    ``OBJ_ROOT/Profile/lib``<br class=""><br class="">Modified: llvm/trunk/docs/GettingStarted.rst<br class="">URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.rst?rev=232135&r1=232134&r2=232135&view=diff<br class="">==============================================================================<br class="">--- llvm/trunk/docs/GettingStarted.rst (original)<br class="">+++ llvm/trunk/docs/GettingStarted.rst Thu Mar 12 20:58:14 2015<br class="">@@ -61,7 +61,37 @@ Here's the short story for getting up an<br class="">   * ``cd llvm/projects``<br class="">   * ``svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite``<br class=""><br class="">-#. Configure and build LLVM and Clang:<br class="">+#. Configure and build LLVM and Clang (Recommended process using CMake):<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">The "(Recommended process using CMake)" blurb is just confusing at this</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">point. Better to go with something like so I think:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   #. Configure and build LLVM and Clang:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   The usual build uses `CMake <CMake.html>`_. If you would rather use</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   autotools, see `Building LLVM with autotools <...html>`.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Good point. I’ll make this change.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+<br class="">+   * ``cd where you want to build llvm``<br class="">+   * ``mkdir build``<br class="">+   * ``cd build``<br class="">+   * ``cmake -G <generator> [options] <path to llvm sources>``<br class="">+<br class="">+     Some common generators are:<br class="">+<br class="">+     * ``Unix Makefiles`` --- for generating make-compatible parallel makefiles.<br class="">+     * ``Ninja`` --- for generating `Ninja <<a href="http://martine.github.io/ninja/" class="">http://martine.github.io/ninja/</a>>`<br class="">+        build files.<br class="">+     * ``Visual Studio`` --- for generating Visual Studio projects and<br class="">+        solutions.<br class="">+     * ``Xcode`` --- for generating Xcode projects.<br class="">+<br class="">+     Some Common options:<br class="">+<br class="">+     * ``-DCMAKE_INSTALL_PREFIX=directory`` --- Specify for *directory* the full<br class="">+       pathname of where you want the LLVM tools and libraries to be installed<br class="">+       (default ``/usr/local``).<br class="">+<br class="">+     * ``-DCMAKE_BUILD_TYPE=type`` --- Valid options for *type* are Debug,<br class="">+       Release, RelWithDebInfo, and MinSizeRel. Default is Debug.<br class="">+<br class="">+     * ``-DLLVM_ENABLE_ASSERTIONS=On`` --- Compile with assertion checks enabled<br class="">+       (default is Yes for Debug builds, No for all other build types).<br class="">+<br class="">+   * For more information see `CMake <CMake.html>`_<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">While this is kind of required knowledge to use cmake at all, I find it</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">a bit verbose for a getting started section. Could we instead give a</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">concrete example of something useful and explain where to learn about</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">customization? Ie,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   * ``cmake -G Ninja -DCMAKE_BUILD_TYPE=Release <path to llvm sources>``</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">     To use ``make`` or an IDE, or to customize the build type and</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">     options, see …</span></div></blockquote><div><br class=""></div><div>I actually like it this way. This is consistent with the way the documentation was in the past, and there are more concrete examples further down.</div><div><br class=""></div><div>Anyone from the community want to be a tie breaker?</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+<br class="">+#. Configure and build LLVM and Clang (Alternate process using configure):<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Why isn't this just part of the "building with autotools" doc now?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>I can move that too. I had wanted to keep the most basic documentation in GettingStarted, but if we’re going to be pushing CMake I should probably move that off too.</div><div><br class=""></div><div>-Chris</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">   * ``cd where-you-want-to-build-llvm``<br class="">   * ``mkdir build`` (for building without polluting the source dir)<br class="">@@ -87,11 +117,6 @@ Here's the short story for getting up an<br class="">   * ``make check-all`` --- This run the regression tests to ensure everything<br class="">     is in working order.<br class=""><br class="">-   * It is also possible to use `CMake <CMake.html>`_ instead of the makefiles.<br class="">-     With CMake it is possible to generate project files for several IDEs:<br class="">-     Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks<br class="">-     generator), KDevelop3.<br class="">-<br class="">   * If you get an "internal compiler error (ICE)" or test failures, see<br class="">     `below`.<br class=""><br class="">@@ -134,7 +159,8 @@ Windows x64        x86-64<br class="">  #. Code generation supported for Pentium processors and up<br class="">  #. Code generation supported for 32-bit ABI only<br class="">  #. To use LLVM modules on Win32-based system, you may configure LLVM<br class="">-     with ``--enable-shared``.<br class="">+     with ``-DBUILD_SHARED_LIBS=On`` for CMake builds or ``--enable-shared``<br class="">+     for configure builds.<br class="">  #. MCJIT not working well pre-v7, old JIT engine not supported any more.<br class=""><br class="">Note that you will need about 1-3 GB of space for a full LLVM build in Debug<br class="">@@ -435,7 +461,7 @@ follows:<br class=""><br class="">* ``cd where-you-want-llvm-to-live``<br class="">* Read-Only: ``svn co <a href="http://llvm.org/svn/llvm-project/llvm/trunk" class="">http://llvm.org/svn/llvm-project/llvm/trunk</a> llvm``<br class="">-* Read-Write:``svn co <a href="https://user@llvm.org/svn/llvm-project/llvm/trunk" class="">https://user@llvm.org/svn/llvm-project/llvm/trunk</a> llvm``<br class="">+* Read-Write: ``svn co <a href="https://user@llvm.org/svn/llvm-project/llvm/trunk" class="">https://user@llvm.org/svn/llvm-project/llvm/trunk</a> llvm``<br class=""><br class="">This will create an '``llvm``' directory in the current directory and fully<br class="">populate it with the LLVM source code, Makefiles, test directories, and local<br class="">@@ -664,66 +690,61 @@ Local LLVM Configuration<br class="">------------------------<br class=""><br class="">Once checked out from the Subversion repository, the LLVM suite source code must<br class="">-be configured via the ``configure`` script.  This script sets variables in the<br class="">-various ``*.in`` files, most notably ``llvm/Makefile.config`` and<br class="">-``llvm/include/Config/config.h``.  It also populates *OBJ_ROOT* with the<br class="">-Makefiles needed to begin building LLVM.<br class="">-<br class="">-The following environment variables are used by the ``configure`` script to<br class="">-configure the build system:<br class="">-<br class="">-+------------+-----------------------------------------------------------+<br class="">-| Variable   | Purpose                                                   |<br class="">-+============+===========================================================+<br class="">-| CC         | Tells ``configure`` which C compiler to use.  By default, |<br class="">-|            | ``configure`` will check ``PATH`` for ``clang`` and GCC C |<br class="">-|            | compilers (in this order).  Use this variable to override |<br class="">-|            | ``configure``\'s  default behavior.                       |<br class="">-+------------+-----------------------------------------------------------+<br class="">-| CXX        | Tells ``configure`` which C++ compiler to use.  By        |<br class="">-|            | default, ``configure`` will check ``PATH`` for            |<br class="">-|            | ``clang++`` and GCC C++ compilers (in this order).  Use   |<br class="">-|            | this variable to override  ``configure``'s default        |<br class="">-|            | behavior.                                                 |<br class="">-+------------+-----------------------------------------------------------+<br class="">-<br class="">-The following options can be used to set or enable LLVM specific options:<br class="">-<br class="">-``--enable-optimized``<br class="">-<br class="">-  Enables optimized compilation (debugging symbols are removed and GCC<br class="">-  optimization flags are enabled). Note that this is the default setting if you<br class="">-  are using the LLVM distribution. The default behavior of a Subversion<br class="">-  checkout is to use an unoptimized build (also known as a debug build).<br class="">-<br class="">-``--enable-debug-runtime``<br class="">-<br class="">-  Enables debug symbols in the runtime libraries. The default is to strip debug<br class="">-  symbols from the runtime libraries.<br class="">-<br class="">-``--enable-jit``<br class="">-<br class="">-  Compile the Just In Time (JIT) compiler functionality.  This is not available<br class="">-  on all platforms.  The default is dependent on platform, so it is best to<br class="">-  explicitly enable it if you want it.<br class="">-<br class="">-``--enable-targets=target-option``<br class="">-<br class="">-  Controls which targets will be built and linked into llc. The default value<br class="">-  for ``target_options`` is "all" which builds and links all available targets.<br class="">-  The "host" target is selected as the target of the build host. You can also<br class="">-  specify a comma separated list of target names that you want available in llc.<br class="">-  The target names use all lower case. The current set of targets is:<br class="">-<br class="">-    ``aarch64, arm, arm64, cpp, hexagon, mips, mipsel, mips64, mips64el, msp430,<br class="">-    powerpc, nvptx, r600, sparc, systemz, x86, x86_64, xcore``.<br class="">-<br class="">-``--enable-doxygen``<br class="">-<br class="">-  Look for the doxygen program and enable construction of doxygen based<br class="">-  documentation from the source code. This is disabled by default because<br class="">-  generating the documentation can take a long time and producess 100s of<br class="">-  megabytes of output.<br class="">+be configured before being built. For instructions using autotools please see<br class="">+`Building LLVM With Autotools <BuildingLLVMWithAutotools.html>`_. The<br class="">+recommended process uses CMake. Unlinke the normal ``configure`` script, CMake<br class="">+generates the build files in whatever format you request as well as various<br class="">+``*.inc`` files, and ``llvm/include/Config/config.h``.<br class="">+<br class="">+Variables are passed to ``cmake`` on the command line using the format<br class="">+``-D<variable name>=<value>``. The following variables are some common options<br class="">+used by people developing LLVM.<br class="">+<br class="">++-------------------------+----------------------------------------------------+<br class="">+| Variable                | Purpose                                            |<br class="">++=========================+====================================================+<br class="">+| CMAKE_C_COMPILER        | Tells ``cmake`` which C compiler to use. By        |<br class="">+|                         | default, this will be /usr/bin/cc.                 |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| CMAKE_CXX_COMPILER      | Tells ``cmake`` which C++ compiler to use. By      |<br class="">+|                         | default, this will be /usr/bin/c++.                |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| CMAKE_BUILD_TYPE        | Tells ``cmake`` what type of build you are trying  |<br class="">+|                         | to generate files for. Valid options are Debug,    |<br class="">+|                         | Release, RelWithDebInfo, and MinSizeRel. Default   |<br class="">+|                         | is Debug.                                          |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| CMAKE_INSTALL_PREFIX    | Specifies the install directory to target when     |<br class="">+|                         | running the install action of the build files.     |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| LLVM_TARGETS_TO_BUILD   | A semicolon delimited list controlling which       |<br class="">+|                         | targets will be built and linked into llc. This is |<br class="">+|                         | equivalent to the ``--enable-targets`` option in   |<br class="">+|                         | the configure script. The default list is defined  |<br class="">+|                         | as ``LLVM_ALL_TARGETS``, and can be set to include |<br class="">+|                         | out-of-tree targets. The default value includes:   |<br class="">+|                         | ``AArch64, ARM, CppBackend, Hexagon,               |<br class="">+|                         | Mips, MSP430, NVPTX, PowerPC, R600, Sparc,         |<br class="">+|                         | SystemZ, X86, XCore``.                             |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| LLVM_ENABLE_DOXYGEN     | Build doxygen-based documentation from the source  |<br class="">+|                         | code This is disabled by default because it is     |<br class="">+|                         | slow and generates a lot of output.                |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| LLVM_ENABLE_SPHINX      | Build sphinx-based documentation from the source   |<br class="">+|                         | code. This is disabled by default because it is    |<br class="">+|                         | slow and generates a lot of output.                |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| LLVM_BUILD_LLVM_DYLIB   | Generate libLLVM.so. This library contains a       |<br class="">+|                         | default set of LLVM components that can be         |<br class="">+|                         | overridden with ``LLVM_DYLIB_COMPONENTS``. The     |<br class="">+|                         | default contains most of LLVM and is defined in    |<br class="">+|                         | ``tools/llvm-shlib/CMakelists.txt``.               |<br class="">++-------------------------+----------------------------------------------------+<br class="">+| LLVM_OPTIMIZED_TABLEGEN | Builds a release tablegen that gets used during    |<br class="">+|                         | the LLVM build. This can dramatically speed up     |<br class="">+|                         | debug builds.                                      |<br class="">++-------------------------+----------------------------------------------------+<br class=""><br class="">To configure LLVM, follow these steps:<br class=""><br class="">@@ -733,47 +754,52 @@ To configure LLVM, follow these steps:<br class=""><br class="">     % cd OBJ_ROOT<br class=""><br class="">-#. Run the ``configure`` script located in the LLVM source tree:<br class="">+#. Run the ``cmake``:<br class=""><br class="">   .. code-block:: console<br class=""><br class="">-     % SRC_ROOT/configure --prefix=/install/path [other options]<br class="">+     % cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=prefix=/install/path<br class="">+       [other options] SRC_ROOT<br class=""><br class="">Compiling the LLVM Suite Source Code<br class="">------------------------------------<br class=""><br class="">-Once you have configured LLVM, you can build it.  There are three types of<br class="">-builds:<br class="">+Unlike with autotools, with CMake your build type is defined at configuration.<br class="">+If you want to change your build type, you can re-run cmake with the following<br class="">+invocation:<br class="">+<br class="">+   .. code-block:: console<br class="">+<br class="">+     % cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=type SRC_ROOT<br class="">+<br class="">+Between runs, CMake preserves the values set for all options. CMake has the<br class="">+following build types defined:<br class="">+<br class="">+Debug<br class="">+<br class="">+  These builds are the default. The build system will compile the tools and<br class="">+  libraries unoptimized, with debugging information, and asserts enabled.<br class="">+<br class="">+Release<br class="">+<br class="">+  For these builds, the build system will compile the tools and libraries<br class="">+  with optimizations enabled and not generate debug info. CMakes default<br class="">+  optimization level is -O3. This can be configured by setting the<br class="">+  ``CMAKE_CXX_FLAGS_RELEASE`` variable on the CMake command line.<br class=""><br class="">-Debug Builds<br class="">+RelWithDebInfo<br class=""><br class="">-  These builds are the default when one is using a Subversion checkout and<br class="">-  types ``gmake`` (unless the ``--enable-optimized`` option was used during<br class="">-  configuration).  The build system will compile the tools and libraries with<br class="">-  debugging information.  To get a Debug Build using the LLVM distribution the<br class="">-  ``--disable-optimized`` option must be passed to ``configure``.<br class="">-<br class="">-Release (Optimized) Builds<br class="">-<br class="">-  These builds are enabled with the ``--enable-optimized`` option to<br class="">-  ``configure`` or by specifying ``ENABLE_OPTIMIZED=1`` on the ``gmake`` command<br class="">-  line.  For these builds, the build system will compile the tools and libraries<br class="">-  with GCC optimizations enabled and strip debugging information from the<br class="">-  libraries and executables it generates.  Note that Release Builds are default<br class="">-  when using an LLVM distribution.<br class="">-<br class="">-Profile Builds<br class="">-<br class="">-  These builds are for use with profiling.  They compile profiling information<br class="">-  into the code for use with programs like ``gprof``.  Profile builds must be<br class="">-  started by specifying ``ENABLE_PROFILING=1`` on the ``gmake`` command line.<br class="">+  These builds are useful when debugging. They generate optimized binaries with<br class="">+  debug information. CMakes default optimization level is -O2. This can be<br class="">+  configured by setting the ``CMAKE_CXX_FLAGS_RELWITHDEBINFO`` variable on the<br class="">+  CMake command line.<br class=""><br class="">Once you have LLVM configured, you can build it by entering the *OBJ_ROOT*<br class="">directory and issuing the following command:<br class=""><br class="">.. code-block:: console<br class=""><br class="">-  % gmake<br class="">+  % make<br class=""><br class="">If the build fails, please `check here`_ to see if you are using a version of<br class="">GCC that is known not to compile LLVM.<br class="">@@ -784,110 +810,51 @@ command:<br class=""><br class="">.. code-block:: console<br class=""><br class="">-  % gmake -j2<br class="">+  % make -j2<br class=""><br class="">There are several special targets which are useful when working with the LLVM<br class="">source code:<br class=""><br class="">-``gmake clean``<br class="">+``make clean``<br class=""><br class="">  Removes all files generated by the build.  This includes object files,<br class="">  generated C/C++ files, libraries, and executables.<br class=""><br class="">-``gmake dist-clean``<br class="">-<br class="">-  Removes everything that ``gmake clean`` does, but also removes files generated<br class="">-  by ``configure``.  It attempts to return the source tree to the original state<br class="">-  in which it was shipped.<br class="">-<br class="">-``gmake install``<br class="">+``make install``<br class=""><br class="">  Installs LLVM header files, libraries, tools, and documentation in a hierarchy<br class="">-  under ``$PREFIX``, specified with ``./configure --prefix=[dir]``, which<br class="">+  under ``$PREFIX``, specified with ``CMAKE_INSTALL_PREFIX``, which<br class="">  defaults to ``/usr/local``.<br class=""><br class="">-``gmake -C runtime install-bytecode``<br class="">-<br class="">-  Assuming you built LLVM into $OBJDIR, when this command is run, it will<br class="">-  install bitcode libraries into the GCC front end's bitcode library directory.<br class="">-  If you need to update your bitcode libraries, this is the target to use once<br class="">-  you've built them.<br class="">-<br class="">-Please see the `Makefile Guide <MakefileGuide.html>`_ for further details on<br class="">-these ``make`` targets and descriptions of other targets available.<br class="">-<br class="">-It is also possible to override default values from ``configure`` by declaring<br class="">-variables on the command line.  The following are some examples:<br class="">-<br class="">-``gmake ENABLE_OPTIMIZED=1``<br class="">-<br class="">-  Perform a Release (Optimized) build.<br class="">-<br class="">-``gmake ENABLE_OPTIMIZED=1 DISABLE_ASSERTIONS=1``<br class="">-<br class="">-  Perform a Release (Optimized) build without assertions enabled.<br class="">-<br class="">-``gmake ENABLE_OPTIMIZED=0``<br class="">-<br class="">-  Perform a Debug build.<br class="">-<br class="">-``gmake ENABLE_PROFILING=1``<br class="">-<br class="">-  Perform a Profiling build.<br class="">-<br class="">-``gmake VERBOSE=1``<br class="">+``make docs-llvm-html``<br class=""><br class="">-  Print what ``gmake`` is doing on standard output.<br class="">-<br class="">-``gmake TOOL_VERBOSE=1``<br class="">-<br class="">-  Ask each tool invoked by the makefiles to print out what it is doing on<br class="">-  the standard output. This also implies ``VERBOSE=1``.<br class="">-<br class="">-Every directory in the LLVM object tree includes a ``Makefile`` to build it and<br class="">-any subdirectories that it contains.  Entering any directory inside the LLVM<br class="">-object tree and typing ``gmake`` should rebuild anything in or below that<br class="">-directory that is out of date.<br class="">-<br class="">-This does not apply to building the documentation.<br class="">-LLVM's (non-Doxygen) documentation is produced with the<br class="">-`Sphinx <<a href="http://sphinx-doc.org/" class="">http://sphinx-doc.org/</a>>`_ documentation generation system.<br class="">-There are some HTML documents that have not yet been converted to the new<br class="">-system (which uses the easy-to-read and easy-to-write<br class="">-`reStructuredText <<a href="http://sphinx-doc.org/rest.html" class="">http://sphinx-doc.org/rest.html</a>>`_ plaintext markup<br class="">-language).<br class="">-The generated documentation is built in the ``SRC_ROOT/docs`` directory using<br class="">-a special makefile.<br class="">-For instructions on how to install Sphinx, see<br class="">-`Sphinx Introduction for LLVM Developers<br class="">-<<a href="http://lld.llvm.org/sphinx_intro.html" class="">http://lld.llvm.org/sphinx_intro.html</a>>`_.<br class="">-After following the instructions there for installing Sphinx, build the LLVM<br class="">-HTML documentation by doing the following:<br class="">-<br class="">-.. code-block:: console<br class="">-<br class="">-  $ cd SRC_ROOT/docs<br class="">-  $ make -f Makefile.sphinx<br class="">-<br class="">-This creates a ``_build/html`` sub-directory with all of the HTML files, not<br class="">-just the generated ones.<br class="">-This directory corresponds to ``<a href="http://llvm.org/docs``" class="">llvm.org/docs``</a>.<br class="">-For example, ``_build/html/SphinxQuickstartTemplate.html`` corresponds to<br class="">-``<a href="http://llvm.org/docs/SphinxQuickstartTemplate.html``" class="">llvm.org/docs/SphinxQuickstartTemplate.html``</a>.<br class="">-The :doc:`SphinxQuickstartTemplate` is useful when creating a new document.<br class="">+  If configured with ``-DLLVM_ENABLE_SPHINX=On``, this will generate a directory<br class="">+  at ``OBJ_ROOT/docs/html`` which contains the HTML formatted documentation.<br class=""><br class="">Cross-Compiling LLVM<br class="">--------------------<br class=""><br class="">It is possible to cross-compile LLVM itself. That is, you can create LLVM<br class="">executables and libraries to be hosted on a platform different from the platform<br class="">-where they are built (a Canadian Cross build). To configure a cross-compile,<br class="">-supply the configure script with ``--build`` and ``--host`` options that are<br class="">-different. The values of these options must be legal target triples that your<br class="">-GCC compiler supports.<br class="">+where they are built (a Canadian Cross build). To generate build files for<br class="">+cross-compiling CMake provides a variable ``CMAKE_TOOLCHAIN_FILE`` which can<br class="">+define compiler flags and variables used during the CMake test operations.<br class=""><br class="">The result of such a build is executables that are not runnable on on the build<br class="">-host (--build option) but can be executed on the compile host (--host option).<br class="">+host but can be executed on the target. As an example the following CMake<br class="">+invocation can generate build files targeting iOS. This will work on Mac OS X<br class="">+with the latest Xcode:<br class="">+<br class="">+.. code-block:: console<br class="">+<br class="">+  % cmake -G "Ninja" -DCMAKE_OSX_ARCHITECTURES=“armv7;armv7s;arm64"<br class="">+    -DCMAKE_TOOLCHAIN_FILE=<PATH_TO_LLVM>/cmake/platforms/iOS.cmake<br class="">+    -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_RUNTIME=Off -DLLVM_INCLUDE_TESTS=Off<br class="">+    -DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_ENABLE_BACKTRACES=Off [options]<br class="">+    <PATH_TO_LLVM><br class="">+<br class="">+Note: There are some additional flags that need to be passed when building for<br class="">+iOS due to limitations in the iOS SDK.<br class=""><br class="">Check :doc:`HowToCrossCompileLLVM` and `Clang docs on how to cross-compile in general<br class=""><<a href="http://clang.llvm.org/docs/CrossCompilation.html" class="">http://clang.llvm.org/docs/CrossCompilation.html</a>>`_ for more information<br class="">@@ -908,44 +875,25 @@ This is accomplished in the typical auto<br class=""><br class="">    % cd OBJ_ROOT<br class=""><br class="">-* Run the ``configure`` script found in the LLVM source directory:<br class="">+* Run ``cmake``:<br class=""><br class="">  .. code-block:: console<br class=""><br class="">-    % SRC_ROOT/configure<br class="">-<br class="">-The LLVM build will place files underneath *OBJ_ROOT* in directories named after<br class="">-the build type:<br class="">+    % cmake -G "Unix Makefiles" SRC_ROOT<br class=""><br class="">-Debug Builds with assertions enabled (the default)<br class="">+The LLVM build will create a structure underneath *OBJ_ROOT* that matches the<br class="">+LLVM source tree. At each level where source files are present in the source<br class="">+tree there will be a corresponding ``CMakeFiles`` directory in the *OBJ_ROOT*.<br class="">+Underneath that directory there is another directory with a name ending in<br class="">+``.dir`` under which you'll find object files for each source.<br class=""><br class="">-  Tools<br class="">+For example:<br class=""><br class="">-    ``OBJ_ROOT/Debug+Asserts/bin``<br class="">-<br class="">-  Libraries<br class="">-<br class="">-    ``OBJ_ROOT/Debug+Asserts/lib``<br class="">-<br class="">-Release Builds<br class="">-<br class="">-  Tools<br class="">-<br class="">-    ``OBJ_ROOT/Release/bin``<br class="">-<br class="">-  Libraries<br class="">-<br class="">-    ``OBJ_ROOT/Release/lib``<br class="">-<br class="">-Profile Builds<br class="">-<br class="">-  Tools<br class="">-<br class="">-    ``OBJ_ROOT/Profile/bin``<br class="">-<br class="">-  Libraries<br class="">-<br class="">-    ``OBJ_ROOT/Profile/lib``<br class="">+  .. code-block:: console<br class="">+<br class="">+    % cd llvm_build_dir<br class="">+    % find lib/Support/ -name APFloat*<br class="">+    lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o<br class=""><br class="">Optional Configuration Items<br class="">----------------------------<br class=""><br class="">Modified: llvm/trunk/docs/index.rst<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.rst?rev=232135&r1=232134&r2=232135&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.rst?rev=232135&r1=232134&r2=232135&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/docs/index.rst (original)<br class="">+++ llvm/trunk/docs/index.rst Thu Mar 12 20:58:14 2015<br class="">@@ -70,6 +70,7 @@ representation.<br class="">   CommandGuide/index<br class="">   GettingStarted<br class="">   GettingStartedVS<br class="">+   BuildingLLVMWithAutotools<br class="">   FAQ<br class="">   Lexicon<br class="">   HowToAddABuilder<br class="">@@ -105,6 +106,10 @@ representation.<br class="">   An addendum to the main Getting Started guide for those using Visual Studio<br class="">   on Windows.<br class=""><br class="">+:doc:`BuildingLLVMWithAutotools`<br class="">+   An addendum to the Getting Started guide with instructions for building LLVM<br class="">+   with the Autotools build system.<br class="">+<br class="">:doc:`tutorial/index`<br class="">   Tutorials about using LLVM. Includes a tutorial about making a custom<br class="">   language with LLVM.<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br class=""></body></html>