diff options
Diffstat (limited to 'www/get_started.html')
| -rw-r--r-- | www/get_started.html | 107 |
1 files changed, 89 insertions, 18 deletions
diff --git a/www/get_started.html b/www/get_started.html index 437cb38808f8..86f6cef35c05 100644 --- a/www/get_started.html +++ b/www/get_started.html @@ -43,30 +43,44 @@ mailing list</a>.</p> <h2 id="build">Building Clang and Working with the Code</h2> +<h3 id="buildNix">On Unix-like Systems</h3> + <p>If you would like to check out and build Clang, the current procedure is as follows:</p> <ol> - <li><a href="http://www.llvm.org/docs/GettingStarted.html#checkout">Checkout - and build LLVM</a> from SVN head:</li> + <li>Get the required tools. + <ul> + <li>See + <a href="http://llvm.org/docs/GettingStarted.html#requirements"> + Getting Started with the LLVM System - Requirements</a>.</li> + <li>Note also that Python is needed for running the test suite. + Get it at: <a href="http://www.python.org/download"> + http://www.python.org/download</a></li> + </ul> + <li>Checkout LLVM:</li> <ul> + <li>Change directory to where you want the llvm directory placed.</li> <li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li> - <li><tt>cd llvm</tt></li> - <li><tt>./configure; make</tt></li> </ul> <li>Checkout Clang:</li> <ul> - <li>From within the <tt>llvm</tt> directory (where you - built llvm):</li> - <li><tt>cd tools</tt> - <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li> - + <li><tt>cd llvm/tools</tt> + <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li> + </ul> + <li>Build LLVM and Clang:</li> + <ul> + <li><tt>cd ..</tt> (back to llvm)</li> + <li><tt>./configure</tt></li> + <li><tt>make</tt></li> + <li>This builds both LLVM and Clang for debug mode.</li> + <li>Note: For subsequent Clang development, you can just do make at the + clang directory level.</li> </ul> <li>If you intend to work on Clang C++ support, you may need to tell it how to find your C++ standard library headers. If Clang cannot find your system libstdc++ headers, please follow these instructions:</li> - <ul> <li>'<tt>touch empty.cpp; gcc -v empty.cpp -fsyntax-only</tt>' to get the path.</li> @@ -74,13 +88,6 @@ follows:</p> hard-coded paths" in <tt>clang/lib/Frontend/InitHeaderSearch.cpp</tt> and change the lines below to include that path.</li> </ul> - - <li>Build Clang:</li> - <ul> - <li><tt>cd clang</tt> (assuming that you are in <tt>llvm/tools</tt>)</li> - <li><tt>make</tt> (this will give you a debug build)</li> - </ul> - <li>Try it out (assuming you add llvm/Debug/bin to your path):</li> <ul> <li><tt>clang-cc --help</tt></li> @@ -95,7 +102,6 @@ follows:</p> <li><tt>clang-cc file.c -emit-llvm -o - | llvm-as | opt -std-compile-opts | llc > file.s</tt> (output native machine code)</li> </ul> - <p><em>Note</em>: Here <tt>clang-cc</tt> is the "low-level" frontend executable that is similar in purpose to <tt>cc1</tt>. Clang also has a <a href="#driver">high-level compiler driver</a> that acts as a drop-in @@ -120,6 +126,71 @@ and all (possibly unrelated) projects inside it with <tt><b>make update</b></tt>. This will run <tt>svn update</tt> on all subdirectories related to subversion. </p> +<h3 id="buildWindows">Using Visual Studio</h3> + +<p>The following details setting up for and building Clang on Windows using +Visual Studio:</p> + +<ol> + <li>Get the required tools:</li> + <ul> + <li><b>Subversion</b>. Source code control program. Get it from: + <a href="http://subversion.tigris.org/getting.html"> + http://subversion.tigris.org/getting.html</a></li> + <li><b>cmake</b>. This is used for generating Visual Studio solution and + project files. Get it from: + <a href="http://www.cmake.org/cmake/resources/software.html"> + http://www.cmake.org/cmake/resources/software.html</a></li> + <li><b>Visual Studio 2005 or 2008</b></li> + <li><b>Python</b>. This is needed only if you will be running the tests + (which is essential, if you will be developing for clang). + Get it from: + <a href="http://www.python.org/download"> + http://www.python.org/download</a></li> + <li><b>GnuWin32 tools</b> + These are also necessary for running the tests. + (Note that the grep from MSYS or Cygwin doesn't work with the tests + because of embedded double-quotes in the search strings. The GNU + grep does work in this case.) + Get them from <a href="http://getgnuwin32.sourceforge.net"> + http://getgnuwin32.sourceforge.net</a>.</li> + </ul> + + <li>Checkout LLVM:</li> + <ul> + <li><tt>svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</tt></li> + </ul> + <li>Checkout Clang:</li> + <ul> + <li><tt>cd llvm\tools</tt> + <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li> + </ul> + <li>Run cmake to generate the Visual Studio solution and project files:</li> + <ul> + <li><tt>cd ..</tt> (Change directory back to the llvm top.)</li> + <li><tt>cmake .</tt></li> + <li>The above, if successful, will have created an LLVM.sln file in the + llvm directory. + </ul> + <li>Build Clang:</li> + <ul> + <li>Open LLVM.sln in Visual Studio.</li> + <li>Build the "clang-cc" project for just the compiler front end. + Alternatively, build the "clang" project for the compiler driver + (note that the driver is currently broken on Windows), + or the "ALL_BUILD" project to build everything, including tools.</li> + </ul> + <li>Try it out (assuming you added llvm/debug/bin to your path). (See the + running examples from above.)</li> + <li>See <a href="hacking.html#testingWindows"> + Hacking on clang - Testing using Visual Studio on Windows</a> for information + on running regression tests on Windows.</li> +</ol> + +<p>Note that once you have checked out both llvm and clang, to synchronize +to the latest code base, use the <tt>svn update</tt> command in both the +llvm and llvm\tools\clang directories, as they are separate repositories.</p> + <a name="driver"><h2>High-Level Compiler Driver (Drop-in Substitute for GCC)</h2></a> <p>While the <tt>clang-cc</tt> executable is a low-level frontend executable |
