docs/2 - Installing crosstool-NG.txt
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 17:54:21 2011 +0200 (2011-07-17)
changeset 2888 dd71df95903a
parent 2564 5d4e91c0343e
child 2908 dcdb309b7967
permissions -rw-r--r--
cc/gcc: pass the companion libs prefix to cc_core

In case of canadian-cross, the companion libraries are not the same for
the core cc (they run on 'build') as they are for the final cc (they run
on 'host').

Prepare for this differentiation (coming later), while retaining the
current behavior (to use the same compblibs).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 File.........: 2 - Installing crosstool-NG.txt
     2 Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     3 License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
     4 
     5 
     6 Installing crosstool-NG  /
     7 ________________________/
     8 
     9 
    10 There are two ways you can use crosstool-NG:
    11  - build and install it, then get rid of the sources like you'd do for most
    12    programs,
    13  - or only build it and run from the source directory.
    14 
    15 The former should be used if you got crosstool-NG from a packaged tarball, see
    16 "Install method", below, while the latter is most useful for developers that
    17 use a clone of the repository, and want to submit patches, see "The Hacker's
    18 way", below.
    19 
    20 
    21 Install method |
    22 ---------------+
    23 
    24 If you go for the install, then you just follow the classical, but yet easy
    25 ./configure way:
    26   ./configure --prefix=/some/place
    27   make
    28   make install
    29   export PATH="${PATH}:/some/place/bin"
    30 
    31 You can then get rid of crosstool-NG source. Next create a directory to serve
    32 as a working place, cd in there and run:
    33   mkdir work-dir
    34   cd work-dir
    35   ct-ng help
    36 
    37 See below for complete usage.
    38 
    39 
    40 The Hacker's way |
    41 -----------------+
    42 
    43 If you go the hacker's way, then the usage is a bit different, although very
    44 simple. First, you need to generate the ./configure script from its autoconf
    45 template:
    46   ./bootstrap
    47 
    48 Then, you run ./configure for local execution of crosstool-NG:
    49   ./configure --enable-local
    50   make
    51 
    52 Now, *do not* remove crosstool-NG sources. They are needed to run crosstool-NG!
    53 Stay in the directory holding the sources, and run:
    54   ./ct-ng help
    55 
    56 See below for complete usage.
    57 
    58 Now, provided you used a clone of the repository, you can send me your changes.
    59 See the section titled CONTRIBUTING, below, for how to submit changes.
    60 
    61 
    62 Preparing for packaging |
    63 ------------------------+
    64 
    65 If you plan on packaging crosstool-NG, you surely don't want to install it
    66 in your root file system. The install procedure of crosstool-NG honors the
    67 DESTDIR variable:
    68 
    69   ./configure --prefix=/usr
    70   make
    71   make DESTDIR=/packaging/place install
    72 
    73 
    74 Shell completion |
    75 -----------------+
    76 
    77 crosstool-NG comes with a shell script fragment that defines bash-compatible
    78 completion. That shell fragment is currently not installed automatically, but
    79 this is planned.
    80 
    81 To install the shell script fragment, you have two options:
    82  - install system-wide, most probably by copying ct-ng.comp into
    83    /etc/bash_completion.d/
    84  - install for a single user, by copying ct-ng.comp into ${HOME}/ and
    85    sourcing this file from your ${HOME}/.bashrc
    86 
    87 
    88 Contributed code |
    89 -----------------+
    90 
    91 Some people contributed code that couldn't get merged for various reasons. This
    92 code is available as lzma-compressed patches, in the contrib/ sub-directory.
    93 These patches are to be applied to the source of crosstool-NG, prior to
    94 installing, using something like the following:
    95   lzcat contrib/foobar.patch.lzma |patch -p1
    96 
    97 There is no guarantee that a particular contribution applies to the current
    98 version of crosstool-ng, or that it will work at all. Use contributions at
    99 your own risk.