]>
Commit | Line | Data |
---|---|---|
f4017d20 UD |
1 | # Copyright (C) 1997 Free Software Foundation, Inc. |
2 | # This file is part of the GNU C Library. | |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU Library General Public License as | |
6 | # published by the Free Software Foundation; either version 2 of the | |
7 | # License, or (at your option) any later version. | |
8 | ||
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | # Library General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU Library General Public | |
15 | # License along with the GNU C Library; see the file COPYING.LIB. If | |
16 | # not, write to the Free Software Foundation, Inc., | |
17 | # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
18 | ||
19 | # | |
20 | # Makefile for iconv data and code. | |
21 | # | |
22 | subdir := iconvdata | |
23 | ||
24 | # Names of all the shared objects which implement the transformations. | |
04be94a8 UD |
25 | modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \ |
26 | ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \ | |
27 | T.61 ISO_6937 SJIS KOI-8 KOI8-R LATIN-GREEK LATIN-GREEK-1 \ | |
61952351 UD |
28 | HP-ROMAN8 EBCDIC-AT-DE EBCDIC-AT-DE-A EBCDIC-CA-FR \ |
29 | libJIS | |
f4017d20 UD |
30 | modules.so := $(addsuffix .so, $(modules)) |
31 | ||
32 | ||
04be94a8 UD |
33 | include ../Makeconfig |
34 | ||
f4017d20 UD |
35 | ISO8859-1-routines := iso8859-1 |
36 | ISO8859-2-routines := iso8859-2 | |
37 | ISO8859-3-routines := iso8859-3 | |
38 | ISO8859-4-routines := iso8859-4 | |
39 | ISO8859-5-routines := iso8859-5 | |
40 | ISO8859-6-routines := iso8859-6 | |
41 | ISO8859-7-routines := iso8859-7 | |
42 | ISO8859-8-routines := iso8859-8 | |
43 | ISO8859-9-routines := iso8859-9 | |
44 | ISO8859-10-routines := iso8859-10 | |
45 | T.61-routines := t61 | |
46 | ISO_6937-routines := iso6937 | |
04be94a8 UD |
47 | SJIS-routines := sjis |
48 | KOI-8-routines := koi-8 | |
49 | KOI8-R-routines := koi8-r | |
50 | LATIN-GREEK-routines := latin-greek | |
51 | LATIN-GREEK-1-routines := latin-greek-1 | |
52 | HP-ROMAN8-routines := hp-roman8 | |
53 | EBCDIC-AT-DE-routines := ebcdic-at-de | |
54 | EBCDIC-AT-DE-A-routines := ebcdic-at-de-a | |
55 | EBCDIC-CA-FR-routines := ebcdic-ca-fr | |
04be94a8 | 56 | libJIS-routines := jis0201 jis0208 jis0212 |
04be94a8 | 57 | |
b9b49b44 UD |
58 | distribute := 8bit-generic.c 8bit-gap.c gap.pl gaptab.pl gconv-modules \ |
59 | iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \ | |
60 | iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c \ | |
61 | t61.c iso6937.c sjis.c jis0201.h jis0208.h jis0212.h \ | |
62 | koi-8.c koi8-r.c koi8-r.h hp-roman8.c latin-greek.c \ | |
63 | latin-greek.h latin-greek-1.c latin-greek-1.h ebcdic-at-de.c \ | |
64 | ebcdic-at-de-a.c ebcdic-ca-fr.c jis0201.c jis0208.c jis0212.c \ | |
65 | extra-module.mk | |
f4017d20 UD |
66 | |
67 | # We build the transformation modules only when we build shared libs. | |
68 | ifeq (yes,$(build-shared)) | |
69 | ||
70 | # This macro is similar to build-shlib but it does not define a soname | |
71 | # and it does not depend on the destination name to start with `lib'. | |
72 | define build-module | |
73 | $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ | |
74 | -B$(csu-objpfx) $(load-map-file:%=-Wl,--version-script=%) \ | |
75 | $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ | |
76 | -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ | |
77 | -Wl,--whole-archive \ | |
78 | $(filter-out $($(@F:.so=)-map) $(+preinit) $(+postinit),$^) \ | |
79 | $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so) | |
80 | endef | |
81 | ||
82 | # Rule to generate the shared objects. | |
83 | extra-modules-left := $(modules) | |
84 | include extra-module.mk | |
85 | ||
86 | ||
87 | extra-objs += $(modules.so) | |
88 | install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \ | |
89 | $(inst_gconvdir)/gconv-modules | |
90 | ||
91 | # If we have the localedata add-on available we can build the conversion | |
92 | # tables for numerous charsets. | |
f4017d20 UD |
93 | define generate-8bit-table |
94 | ( echo "static const wchar_t to_ucs4[256] = {"; \ | |
04be94a8 UD |
95 | sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \ |
96 | echo "};"; \ | |
97 | echo "static const char from_ucs4[] = {"; \ | |
98 | sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' -e d $^ | sort -u; \ | |
99 | echo "};" ) > $@.new && rm -f $@ && mv $@.new $@ | |
100 | endef | |
101 | ||
102 | sed-generated-headers := iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h \ | |
103 | iso8859-6.h iso8859-7.h iso8859-8.h iso8859-9.h \ | |
104 | iso8859-10.h koi-8.h hp-roman8.h ebcdic-at-de.h \ | |
105 | ebcdic-at-de-a.h ebcdic-ca-fr.h | |
106 | ||
107 | define generate-8bit-gap-table | |
108 | ( echo "static const wchar_t to_ucs4[256] = {"; \ | |
109 | sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \ | |
110 | echo "};"; \ | |
111 | echo "static struct gap from_idx[] = {"; \ | |
112 | sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' -e d $^ | sort -u | $(PERL) gap.pl; \ | |
113 | echo " { start: 0xffff, end: 0xffff, idx: 0 }"; \ | |
f4017d20 UD |
114 | echo "};"; \ |
115 | echo "static const char from_ucs4[] = {"; \ | |
04be94a8 | 116 | sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/0x\2 0x\1/p' -e d $^ | sort -u | $(PERL) gaptab.pl; \ |
f4017d20 UD |
117 | echo "};" ) > $@.new && rm -f $@ && mv $@.new $@ |
118 | endef | |
119 | ||
04be94a8 UD |
120 | perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h |
121 | ||
122 | # The headers must be generated before the compilation. | |
123 | before-compile = $(sed-generated-headers) $(perl-generated-headers) | |
124 | ||
125 | ||
126 | # Rules to generate the headers. | |
127 | iso8859-2.h: ../localedata/charmaps/ISO-8859-2 Makefile | |
128 | $(generate-8bit-table) | |
129 | iso8859-3.h: ../localedata/charmaps/ISO-8859-3 Makefile | |
130 | $(generate-8bit-table) | |
131 | iso8859-4.h: ../localedata/charmaps/ISO-8859-4 Makefile | |
132 | $(generate-8bit-table) | |
133 | iso8859-5.h: ../localedata/charmaps/ISO-8859-5 Makefile | |
f4017d20 | 134 | $(generate-8bit-table) |
04be94a8 | 135 | iso8859-6.h: ../localedata/charmaps/ISO-8859-6 Makefile |
f4017d20 | 136 | $(generate-8bit-table) |
04be94a8 | 137 | iso8859-7.h: ../localedata/charmaps/ISO-8859-7 Makefile |
f4017d20 | 138 | $(generate-8bit-table) |
04be94a8 | 139 | iso8859-8.h: ../localedata/charmaps/ISO-8859-8 Makefile |
f4017d20 | 140 | $(generate-8bit-table) |
04be94a8 | 141 | iso8859-9.h: ../localedata/charmaps/ISO-8859-9 Makefile |
f4017d20 | 142 | $(generate-8bit-table) |
04be94a8 | 143 | iso8859-10.h: ../localedata/charmaps/ISO-8859-10 Makefile |
f4017d20 | 144 | $(generate-8bit-table) |
04be94a8 UD |
145 | |
146 | koi-8.h: ../localedata/charmaps/KOI-8 Makefile | |
147 | $(generate-8bit-table) | |
148 | ||
149 | hp-roman8.h: ../localedata/charmaps/HP-ROMAN8 Makefile | |
f4017d20 | 150 | $(generate-8bit-table) |
04be94a8 UD |
151 | |
152 | ebcdic-at-de.h: ../localedata/charmaps/EBCDIC-AT-DE Makefile | |
153 | $(generate-8bit-table) | |
154 | ebcdic-at-de-a.h: ../localedata/charmaps/EBCDIC-AT-DE-A Makefile | |
f4017d20 | 155 | $(generate-8bit-table) |
04be94a8 | 156 | ebcdic-ca-fr.h: ../localedata/charmaps/EBCDIC-CA-FR Makefile |
f4017d20 UD |
157 | $(generate-8bit-table) |
158 | ||
04be94a8 UD |
159 | ifneq ($(PERL),no) |
160 | koi8-r.h: ../localedata/charmaps/KOI8-R Makefile | |
161 | $(generate-8bit-gap-table) | |
162 | latin-greek.h: ../localedata/charmaps/LATIN-GREEK Makefile | |
163 | $(generate-8bit-gap-table) | |
164 | latin-greek-1.h: ../localedata/charmaps/LATIN-GREEK-1 Makefile | |
165 | $(generate-8bit-gap-table) | |
f4017d20 UD |
166 | endif |
167 | ||
04be94a8 UD |
168 | headers: $(sed-generated-headers) $(perl-generated-headers) |
169 | ||
f4017d20 UD |
170 | |
171 | $(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)% | |
172 | $(do-install-program) | |
bd355af0 | 173 | $(inst_gconvdir)/gconv-modules: gconv-modules |
f4017d20 UD |
174 | $(do-install) |
175 | endif | |
176 | ||
177 | include ../Rules |