referring to the official website http://clang.llvm.org/get_started.html, depends on a lot of things, compiling clang very slow, patiently waiting.
----------------------------------------------------------------------------------------------------------- ------------------
On unix-like Systems
If you are would like to check out and build clang, the current procedure is as follows:get the required tools. See getting started with the LLVM system-requirements. Note also this Python is needed for running the test suite. Get it at: http://www.python.org/download Checkout Llvm:change directory to where you want the LLVM directory placed . SVN co http://llvm.org/svn/llvm-project/llvm/trunk llvm Checkout CLANG:CD llvm/tools SVN co http://llvm.org/svn/ Llvm-project/cfe/trunk clang CD. /.. Checkout extra clang Tools: (optional) CD Llvm/tools/clang/tools SVN co http://llvm.org/svn/llvm-project/ Clang-tools-extra/trunk Extra CD. /.. /.. /.. Checkout COMPILER-RT:CD llvm/projects SVN co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt CD. /.. Build LLVM and Clang:mkdir build [for building without polluting the source dir] CD build ... /llvm/configure make this builds both LLVM and clang for debug mode. Note:for subsequent clang development, can just do MaKe at the clang directory level. It is also possible to use CMake instead of the makefiles. With CMake it are possible to generate project files for several ides:xcode, Eclipse CDT4, Codeblocks, qt-creator (Use the Codeblocks generator), KDEVELOP3. If you are intend to use clang ' C + + support, you'll be need to the tell it I find your C + + standard library headers. In general, Clang would detect the best version of libstdc++ headers available and use them-it'll look both for system Installations of libstdc++ as-installations adjacent to clang itself. If your configuration fits neither of these scenarios, your can use the --with-gcc-toolchain configure option to Tell Clang where the GCC containing the desired libstdc++ is installed. Try it out (assuming your add llvm/debug+asserts/bin to your path): clang--help clang (check for Correctness) clang file.c-s-emit-llvm-o- (print out unoptimized LLVM code) clang file.c-s-emit-llvm-o--O3 CLang file.c-s-o3-o- (output native machine code)
This is the C front-end uses LLVM, but does not depend on LLVM-GCC. If you are encounter problems with building clang, make sure you have the latest SVN version of LLVM. LLVM contains support libraries for clang of that'll be updated as as as the development on clang.
~not End