docs/2 - Installing crosstool-NG.txt
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Mon Apr 16 15:25:36 2012 +0200 (2012-04-16)
changeset 2941 13e40098fffc
parent 2834 0a0410dd0cb0
permissions -rw-r--r--
cc/gcc: update Linaro GCC revisions to 2012.04

Update Linaro GCC with the latest available revisions.

The 4.7 revision is also released, but the infrastructure is not yet ready for
it in CT-NG.

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