hppa: xfail scan-assembler-not check in g++.dg/cpp0x/initlist-const1.C
[official-gcc.git] / contrib / unicode / README
blob1f5fee6dc35056601b311bcb8fce4153a6b67b6c
1 This directory contains a mechanism for GCC to have its own internal
2 implementation of wcwidth functionality (cpp_wcwidth () in libcpp/charset.c),
3 as well as a mechanism to update the information about codepoints permitted in
4 identifiers, which is encoded in libcpp/ucnid.h, and mapping between Unicode
5 names and codepoints, which is encoded in libcpp/uname2c.h.
7 The idea is to produce the necessary lookup tables
8 (../../libcpp/{ucnid.h,uname2c.h,generated_cpp_wcwidth.h}) in a reproducible
9 way, starting from the following files that are distributed by the Unicode
10 Consortium:
12 ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
13 ftp://ftp.unicode.org/Public/UNIDATA/EastAsianWidth.txt
14 ftp://ftp.unicode.org/Public/UNIDATA/PropList.txt
15 ftp://ftp.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt
16 ftp://ftp.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt
17 ftp://ftp.unicode.org/Public/UNIDATA/NameAliases.txt
19 These files have been added to source control in this directory;
20 please see unicode-license.txt for the relevant copyright information.
22 In order to keep in sync with glibc's wcwidth as much as possible, it is
23 desirable for the logic that processes the Unicode data to be the same as
24 glibc's.  To that end, we also put in this directory, in the from_glibc/
25 directory, the glibc python code that implements their logic.  This code was
26 copied verbatim from glibc, and it can be updated at any time from the glibc
27 source code repository.  The files copied from that respository are:
29 localedata/unicode-gen/unicode_utils.py
30 localedata/unicode-gen/utf8_gen.py
32 And the most recent versions added to GCC are from glibc git commit:
33 71de3aead9fffe89556e80ebc94aa918d8ee7bca
35 The script gen_wcwidth.py found here contains the GCC-specific code to
36 map glibc's output to the lookup tables we require.  This script should not need
37 to change, unless there are structural changes to the Unicode data files or to
38 the glibc code.  Similarly, makeucnid.cc in ../../libcpp contains the logic to
39 produce ucnid.h.
41 The procedure to update GCC's Unicode support is the following:
43 1.  Update the six Unicode data files from the above URLs.
45 2.  Update the two glibc files in from_glibc/ from glibc's git.  Update
46     the commit number above in this README.
48 3.  Run ./gen_wcwidth.py X.Y > ../../libcpp/generated_cpp_wcwidth.h
49     (where X.Y is the version of the Unicode standard corresponding to the
50     Unicode data files being used, most recently, 15.1.0).
52 4.  Update Unicode Copyright years in libcpp/makeucnid.cc and in
53     libcpp/makeuname2c.cc up to the year in which the Unicode
54     standard has been released.
56 5.  Compile makeucnid, e.g. with:
57       g++ -O2 ../../libcpp/makeucnid.cc -o ../../libcpp/makeucnid
59 6.  Generate ucnid.h as follows:
60       ../../libcpp/makeucnid ../../libcpp/ucnid.tab UnicodeData.txt \
61         DerivedNormalizationProps.txt DerivedCoreProperties.txt \
62         > ../../libcpp/ucnid.h
64 7.  Read the corresponding Unicode's standard and update correspondingly
65     generated_ranges table in libcpp/makeuname2c.cc (in Unicode 15 all
66     the needed information was in Table 4-8).
68 8.  Compile makeuname2c, e.g. with:
69       g++ -O2 ../../libcpp/makeuname2c.cc -o ../../libcpp/makeuname2c
71 9:  Generate uname2c.h as follows:
72       ../../libcpp/makeuname2c UnicodeData.txt NameAliases.txt \
73         > ../../libcpp/uname2c.h