]> git.ipfire.org Git - thirdparty/glibc.git/blob - iconvdata/Makefile
Update.
[thirdparty/glibc.git] / iconvdata / Makefile
1 # Copyright (C) 1997, 1998 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.
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 \
28 HP-ROMAN8 EBCDIC-AT-DE EBCDIC-AT-DE-A EBCDIC-CA-FR \
29 EUC-KR UHC JOHAB libJIS libKSC ISO646
30 modules.so := $(addsuffix .so, $(modules))
31
32
33 include ../Makeconfig
34
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 ISO646-routines := iso646
46 T.61-routines := t61
47 ISO_6937-routines := iso6937
48 SJIS-routines := sjis
49 KOI-8-routines := koi-8
50 KOI8-R-routines := koi8-r
51 LATIN-GREEK-routines := latin-greek
52 LATIN-GREEK-1-routines := latin-greek-1
53 HP-ROMAN8-routines := hp-roman8
54 EBCDIC-AT-DE-routines := ebcdic-at-de
55 EBCDIC-AT-DE-A-routines := ebcdic-at-de-a
56 EBCDIC-CA-FR-routines := ebcdic-ca-fr
57 EUC-KR-routines := euckr
58 JOHAB-routines := johab
59 UHC-routines := uhc
60 libJIS-routines := jis0201 jis0208 jis0212
61 libKSC-routines := ksc5601
62
63 LDFLAGS-EUC-KR.so = -Wl,-rpath,$(gconvdir)
64 $(objpfx)EUC-KR.so: $(objpfx)libKSC.so
65 LDFLAGS-JOHAB.so = -Wl,-rpath,$(gconvdir)
66 $(objpfx)JOHAB.so: $(objpfx)libKSC.so
67 LDFLAGS-UHC.so = -Wl,-rpath,$(gconvdir)
68 $(objpfx)UHC.so: $(objpfx)libKSC.so
69
70 LDFLAGS-libJIS.so = -Wl,-soname,$(@F)
71 LDFLAGS-libKSC.so = -Wl,-soname,$(@F)
72
73 distribute := 8bit-generic.c 8bit-gap.c gap.pl gaptab.pl gconv-modules \
74 iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \
75 iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c \
76 t61.c iso6937.c sjis.c jis0201.h jis0208.h jis0212.h \
77 koi-8.c koi8-r.c koi8-r.h hp-roman8.c latin-greek.c \
78 latin-greek.h latin-greek-1.c latin-greek-1.h ebcdic-at-de.c \
79 ebcdic-at-de-a.c ebcdic-ca-fr.c jis0201.c jis0208.c jis0212.c \
80 extra-module.mk euckr.c johab.c uhc.c ksc5601.c ksc5601.h \
81 iso646.c
82
83 # We build the transformation modules only when we build shared libs.
84 ifeq (yes,$(build-shared))
85
86 # This macro is similar to build-shlib but it does not define a soname
87 # and it does not depend on the destination name to start with `lib'.
88 define build-module
89 $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
90 -B$(csu-objpfx) $(load-map-file:%=-Wl,--version-script=%) \
91 $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \
92 -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
93 -Wl,--whole-archive \
94 $(filter-out $($(@F:.so=)-map) $(+preinit) $(+postinit),$^) \
95 $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so)
96 endef
97
98 # Rule to generate the shared objects.
99 extra-modules-left := $(modules)
100 include extra-module.mk
101
102
103 extra-objs += $(modules.so)
104 install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
105 $(inst_gconvdir)/gconv-modules
106
107 # If we have the localedata add-on available we can build the conversion
108 # tables for numerous charsets.
109 define generate-8bit-table
110 ( echo "static const wchar_t to_ucs4[256] = {"; \
111 sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \
112 echo "};"; \
113 echo "static const char from_ucs4[] = {"; \
114 sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' -e d $^ | sort -u; \
115 echo "};" ) > $@.new && rm -f $@ && mv $@.new $@
116 endef
117
118 sed-generated-headers := iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h \
119 iso8859-6.h iso8859-7.h iso8859-8.h iso8859-9.h \
120 iso8859-10.h koi-8.h hp-roman8.h ebcdic-at-de.h \
121 ebcdic-at-de-a.h ebcdic-ca-fr.h
122
123 define generate-8bit-gap-table
124 ( echo "static const wchar_t to_ucs4[256] = {"; \
125 sed -e '/^[^[:space:]]*[[:space:]]*.x00/d' -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \
126 echo "};"; \
127 echo "static struct gap from_idx[] = {"; \
128 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; \
129 echo " { start: 0xffff, end: 0xffff, idx: 0 }"; \
130 echo "};"; \
131 echo "static const char from_ucs4[] = {"; \
132 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; \
133 echo "};" ) > $@.new && rm -f $@ && mv $@.new $@
134 endef
135
136 perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h
137
138 # The headers must be generated before the compilation.
139 before-compile = $(sed-generated-headers) $(perl-generated-headers)
140
141
142 # Rules to generate the headers.
143 iso8859-2.h: ../localedata/charmaps/ISO-8859-2 Makefile
144 $(generate-8bit-table)
145 iso8859-3.h: ../localedata/charmaps/ISO-8859-3 Makefile
146 $(generate-8bit-table)
147 iso8859-4.h: ../localedata/charmaps/ISO-8859-4 Makefile
148 $(generate-8bit-table)
149 iso8859-5.h: ../localedata/charmaps/ISO-8859-5 Makefile
150 $(generate-8bit-table)
151 iso8859-6.h: ../localedata/charmaps/ISO-8859-6 Makefile
152 $(generate-8bit-table)
153 iso8859-7.h: ../localedata/charmaps/ISO-8859-7 Makefile
154 $(generate-8bit-table)
155 iso8859-8.h: ../localedata/charmaps/ISO-8859-8 Makefile
156 $(generate-8bit-table)
157 iso8859-9.h: ../localedata/charmaps/ISO-8859-9 Makefile
158 $(generate-8bit-table)
159 iso8859-10.h: ../localedata/charmaps/ISO-8859-10 Makefile
160 $(generate-8bit-table)
161
162 koi-8.h: ../localedata/charmaps/KOI-8 Makefile
163 $(generate-8bit-table)
164
165 hp-roman8.h: ../localedata/charmaps/HP-ROMAN8 Makefile
166 $(generate-8bit-table)
167
168 ebcdic-at-de.h: ../localedata/charmaps/EBCDIC-AT-DE Makefile
169 $(generate-8bit-table)
170 ebcdic-at-de-a.h: ../localedata/charmaps/EBCDIC-AT-DE-A Makefile
171 $(generate-8bit-table)
172 ebcdic-ca-fr.h: ../localedata/charmaps/EBCDIC-CA-FR Makefile
173 $(generate-8bit-table)
174
175 ifneq ($(PERL),no)
176 koi8-r.h: ../localedata/charmaps/KOI8-R Makefile
177 $(generate-8bit-gap-table)
178 latin-greek.h: ../localedata/charmaps/LATIN-GREEK Makefile
179 $(generate-8bit-gap-table)
180 latin-greek-1.h: ../localedata/charmaps/LATIN-GREEK-1 Makefile
181 $(generate-8bit-gap-table)
182 endif
183
184 headers: $(sed-generated-headers) $(perl-generated-headers)
185
186
187 $(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)%
188 $(do-install-program)
189 $(inst_gconvdir)/gconv-modules: gconv-modules
190 $(do-install)
191 endif
192
193 include ../Rules