docs/2 - Installing crosstool-NG.txt
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
parent 2563 e17f35b05539
child 2834 0a0410dd0cb0
child 2912 6467c949c91c
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
yann@2076
     1
File.........: 2 - Installing crosstool-NG.txt
antony@2563
     2
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@anciens.enib.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@2076
    33
  ct-ng help
yann@2076
    34
yann@2076
    35
See below for complete usage.
yann@2076
    36
yann@2076
    37
yann@2076
    38
The Hacker's way |
yann@2076
    39
-----------------+
yann@2076
    40
yann@2076
    41
If you go the hacker's way, then the usage is a bit different, although very
yann@2076
    42
simple:
yann@2076
    43
  ./configure --local
yann@2076
    44
  make
yann@2076
    45
yann@2076
    46
Now, *do not* remove crosstool-NG sources. They are needed to run crosstool-NG!
yann@2076
    47
Stay in the directory holding the sources, and run:
yann@2076
    48
  ./ct-ng help
yann@2076
    49
yann@2076
    50
See below for complete usage.
yann@2076
    51
yann@2076
    52
Now, provided you used a clone of the repository, you can send me your changes.
antony@2564
    53
See the section titled CONTRIBUTING, below, for how to submit changes.
yann@2076
    54
yann@2076
    55
yann@2076
    56
Preparing for packaging |
yann@2076
    57
------------------------+
yann@2076
    58
yann@2076
    59
If you plan on packaging crosstool-NG, you surely don't want to install it
yann@2076
    60
in your root file system. The install procedure of crosstool-NG honors the
yann@2076
    61
DESTDIR variable:
yann@2076
    62
yann@2076
    63
  ./configure --prefix=/usr
yann@2076
    64
  make
yann@2076
    65
  make DESTDIR=/packaging/place install
yann@2076
    66
yann@2076
    67
yann@2076
    68
Shell completion |
yann@2076
    69
-----------------+
yann@2076
    70
yann@2076
    71
crosstool-NG comes with a shell script fragment that defines bash-compatible
yann@2076
    72
completion. That shell fragment is currently not installed automatically, but
yann@2076
    73
this is planned.
yann@2076
    74
yann@2076
    75
To install the shell script fragment, you have two options:
yann@2076
    76
 - install system-wide, most probably by copying ct-ng.comp into
yann@2076
    77
   /etc/bash_completion.d/
yann@2076
    78
 - install for a single user, by copying ct-ng.comp into ${HOME}/ and
yann@2076
    79
   sourcing this file from your ${HOME}/.bashrc
yann@2076
    80
yann@2076
    81
yann@2076
    82
Contributed code |
yann@2076
    83
-----------------+
yann@2076
    84
antony@2564
    85
Some people contributed code that couldn't get merged for various reasons. This
yann@2076
    86
code is available as lzma-compressed patches, in the contrib/ sub-directory.
yann@2076
    87
These patches are to be applied to the source of crosstool-NG, prior to
yann@2076
    88
installing, using something like the following:
yann@2076
    89
  lzcat contrib/foobar.patch.lzma |patch -p1
yann@2076
    90
antony@2564
    91
There is no guarantee that a particular contribution applies to the current
yann@2076
    92
version of crosstool-ng, or that it will work at all. Use contributions at
yann@2076
    93
your own risk.