X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCFEBuildInstrs.html;h=8cdb197cbc20332f9e3d8ed8fb91547d9b0257b8;hb=a1ace76c70ae5332d6f33fce5c0c1e2fdb8cca11;hp=e3ade88c78732d276588c4bf28d56e98c254ddf6;hpb=15bfd89b995e9b8a4fe4f321b3ea29b546c94bac;p=oota-llvm.git diff --git a/docs/CFEBuildInstrs.html b/docs/CFEBuildInstrs.html index e3ade88c787..8cdb197cbc2 100644 --- a/docs/CFEBuildInstrs.html +++ b/docs/CFEBuildInstrs.html @@ -5,252 +5,11 @@ Building the LLVM C/C++ Front-End + -
- Building the LLVM GCC Front-End -
- -
    -
  1. Building llvm-gcc from Source
  2. -
  3. License Information
  4. -
- -
-

Written by the LLVM Team

-
- - -
- Building llvm-gcc from Source -
- - -
- -

This section describes how to acquire and build llvm-gcc 4.0 and 4.2, which are -based on the GCC 4.0.1/4.2.1 front-ends respectively. Both front-ends support C, -C++, Objective-C and Objective-C++. The 4.2 front-end also supports Ada and -Fortran to some extent. Note that the instructions for building these front-ends -are completely different (and much easier!) than those for building llvm-gcc3 in -the past.

- -
    -
  1. Retrieve the appropriate llvm-gcc4.x-y.z.source.tar.gz archive from the - llvm web site.

    - -

    It is also possible to download the sources of the llvm-gcc front end - from a read-only mirror using subversion. To check out the 4.0 code - for first time use:

    - -
    -
    -svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk dst-directory
    -
    -
    - -

    To check out the 4.2 code use:

    - -
    -
    -svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk dst-directory
    -
    -
    - -

    After that, the code can be be updated in the destination directory - using:

    - -
    -
    svn update
    -
    - -

    The mirror is brought up to date every evening.

  2. - -
  3. Follow the directions in the top-level README.LLVM file for - up-to-date instructions on how to build llvm-gcc. See below for building - with support for Ada or Fortran. -
- -
- - -
- Building the Ada front-end -
- -
-

Building with support for Ada amounts to following the directions in the -top-level README.LLVM file, adding ",ada" to EXTRALANGS, for example: -EXTRALANGS=,ada

- -

There are some complications however:

- -
    -
  1. The only platform for which the Ada front-end is known to build is - 32 bit intel x86 running linux. It is unlikely to build for other - systems without some work.

  2. -
  3. The build requires having a compiler that supports Ada, C and C++. - The Ada front-end is written in Ada so an Ada compiler is needed to - build it. The LLVM parts of llvm-gcc are written in C++ so a C++ - compiler is needed to build them. The rest of gcc is written in C. - Some linux distributions provide a version of gcc that supports all - three languages (the Ada part often comes as an add-on package to - the rest of gcc). Otherwise it is possible to combine two versions - of gcc, one that supports Ada and C (such as - GNAT GPL Edition) and another - which supports C++, see below.

  4. -
- -

Supposing appropriate compilers are available, llvm-gcc with Ada support can - be built using the following recipe:

- -
    -
  1. Download the LLVM source - and unpack it:

    - -
    -
    wget http://llvm.org/releases/2.2/llvm-2.2.tar.gz
    -tar xzf llvm-2.2.tar.gz
    -mv llvm-2.2 llvm
    -
    - -

    or check out the - latest version from subversion:

    - -
    -
    svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
    -
    -
  2. - -
  3. Download the - llvm-gcc-4.2 source - and unpack it:

    - -
    -
    wget http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz
    -tar xzf llvm-gcc4.2-2.2.source.tar.gz
    -mv llvm-gcc4.2-2.2.source llvm-gcc-4.2
    -
    - -

    or check out the - latest version from subversion:

    - -
    -
    svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk llvm-gcc-4.2
    -
    -
  4. - -
  5. Make a build directory llvm-objects for llvm and make it the - current directory:

    - -
    -
    mkdir llvm-objects
    -cd llvm-objects
    -
    -
  6. - -
  7. Configure LLVM (here it is configured to install into /usr/local):

    - -
    -
    ../llvm/configure --prefix=/usr/local
    -
    - -

    If you have a multi-compiler setup and the C++ compiler is not the - default, then you can configure like this:

    - -
    -
    CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local
    -
    -
  8. - -
  9. Build LLVM:

    - -
    -
    make
    -
    -
  10. - -
  11. Install LLVM (optional):

    - -
    -
    make install
    -
    -
  12. - -
  13. Make a build directory llvm-gcc-4.2-objects for llvm-gcc and make it the - current directory:

    - -
    -
    -cd ..
    -mkdir llvm-gcc-4.2-objects
    -cd llvm-gcc-4.2-objects
    -
    -
  14. - -
  15. Configure llvm-gcc (here it is configured to install into /usr/local). - Additional languages can be appended to the --enable-languages switch, - for example --enable-languages=ada,c,c++.

    - -
    -
    ../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    -
    - -

    If you have a multi-compiler setup, then you can configure like this:

    -
    - -
    -export CC=PATH_TO_C_AND_ADA_COMPILER
    -export CXX=PATH_TO_C++_COMPILER
    -../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
    -
    -
  16. - -
  17. Build and install the compiler:

    - -
    -
    make
    -make install
    -
    -
  18. -
- -
- - -
- Building the Fortran front-end -
- -
-

-To build with support for Fortran, follow the directions in the top-level -README.LLVM file, adding ",fortran" to EXTRALANGS, for example:

- -
-
-EXTRALANGS=,fortran
-
-
- -
- - -
- License Information -
- -
-

-The LLVM GCC frontend is licensed to you under the GNU General Public License -and the GNU Lesser General Public License. Please see the files COPYING and -COPYING.LIB for more details. -

- -

-More information is available in the FAQ. -

+This page has moved here.
@@ -263,7 +22,7 @@ More information is available in the FAQ. src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
- Last modified: $Date$ + Last modified: $Date: 2008-02-13 17:46:10 +0100 (Wed, 13 Feb 2008) $