summaryrefslogtreecommitdiff
path: root/docs/2 - Installing crosstool-NG.txt
blob: 69909fe51f510bd5573ef659d2f1da60b643220a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
File.........: 2 - Installing crosstool-NG.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5


Installing crosstool-NG  /
________________________/


There are two ways you can use crosstool-NG:
 - build and install it, then get rid of the sources like you'd do for most
   programs,
 - or only build it and run from the source directory.

The former should be used if you got crosstool-NG from a packaged tarball, see
"Install method", below, while the latter is most useful for developers that
use a clone of the repository, and want to submit patches, see "The Hacker's
way", below.


Install method |
---------------+

If you go for the install, then you just follow the classical, but yet easy
./configure way:
  ./configure --prefix=/some/place
  make
  make install
  export PATH="${PATH}:/some/place/bin"

You can then get rid of crosstool-NG source. Next create a directory to serve
as a working place, cd in there and run:
  ct-ng help

See below for complete usage.


The Hacker's way |
-----------------+

If you go the hacker's way, then the usage is a bit different, although very
simple:
  ./configure --local
  make

Now, *do not* remove crosstool-NG sources. They are needed to run crosstool-NG!
Stay in the directory holding the sources, and run:
  ./ct-ng help

See below for complete usage.

Now, provided you used a clone of the repository, you can send me your changes.
See the section titled CONTRIBUTING, below, for how to submit changes.


Preparing for packaging |
------------------------+

If you plan on packaging crosstool-NG, you surely don't want to install it
in your root file system. The install procedure of crosstool-NG honors the
DESTDIR variable:

  ./configure --prefix=/usr
  make
  make DESTDIR=/packaging/place install


Shell completion |
-----------------+

crosstool-NG comes with a shell script fragment that defines bash-compatible
completion. That shell fragment is currently not installed automatically, but
this is planned.

To install the shell script fragment, you have two options:
 - install system-wide, most probably by copying ct-ng.comp into
   /etc/bash_completion.d/
 - install for a single user, by copying ct-ng.comp into ${HOME}/ and
   sourcing this file from your ${HOME}/.bashrc


Contributed code |
-----------------+

Some people contributed code that couldn't get merged for various reasons. This
code is available as lzma-compressed patches, in the contrib/ sub-directory.
These patches are to be applied to the source of crosstool-NG, prior to
installing, using something like the following:
  lzcat contrib/foobar.patch.lzma |patch -p1

There is no guarantee that a particular contribution applies to the current
version of crosstool-ng, or that it will work at all. Use contributions at
your own risk.