]> git.ipfire.org Git - thirdparty/glibc.git/blame - iconvdata/Makefile
Update.
[thirdparty/glibc.git] / iconvdata / Makefile
CommitLineData
a44d2393 1# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
f4017d20
UD
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#
22subdir := iconvdata
23
24# Names of all the shared objects which implement the transformations.
04be94a8
UD
25modules := 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 28 HP-ROMAN8 EBCDIC-AT-DE EBCDIC-AT-DE-A EBCDIC-CA-FR \
d2374599 29 EUC-KR UHC JOHAB libJIS libKSC ISO646
f4017d20
UD
30modules.so := $(addsuffix .so, $(modules))
31
32
04be94a8
UD
33include ../Makeconfig
34
f4017d20
UD
35ISO8859-1-routines := iso8859-1
36ISO8859-2-routines := iso8859-2
37ISO8859-3-routines := iso8859-3
38ISO8859-4-routines := iso8859-4
39ISO8859-5-routines := iso8859-5
40ISO8859-6-routines := iso8859-6
41ISO8859-7-routines := iso8859-7
42ISO8859-8-routines := iso8859-8
43ISO8859-9-routines := iso8859-9
44ISO8859-10-routines := iso8859-10
d2374599 45ISO646-routines := iso646
f4017d20
UD
46T.61-routines := t61
47ISO_6937-routines := iso6937
04be94a8
UD
48SJIS-routines := sjis
49KOI-8-routines := koi-8
50KOI8-R-routines := koi8-r
51LATIN-GREEK-routines := latin-greek
52LATIN-GREEK-1-routines := latin-greek-1
53HP-ROMAN8-routines := hp-roman8
54EBCDIC-AT-DE-routines := ebcdic-at-de
55EBCDIC-AT-DE-A-routines := ebcdic-at-de-a
56EBCDIC-CA-FR-routines := ebcdic-ca-fr
71bedb76
UD
57EUC-KR-routines := euckr
58JOHAB-routines := johab
cab24c37 59UHC-routines := uhc
04be94a8 60libJIS-routines := jis0201 jis0208 jis0212
a44d2393 61libKSC-routines := ksc5601
04be94a8 62
e784ad6a
UD
63LDFLAGS-EUC-KR.so = -Wl,-rpath,$(gconvdir)
64$(objpfx)EUC-KR.so: $(objpfx)libKSC.so
65LDFLAGS-JOHAB.so = -Wl,-rpath,$(gconvdir)
66$(objpfx)JOHAB.so: $(objpfx)libKSC.so
cab24c37
UD
67LDFLAGS-UHC.so = -Wl,-rpath,$(gconvdir)
68$(objpfx)UHC.so: $(objpfx)libKSC.so
e784ad6a 69
cab24c37
UD
70LDFLAGS-libJIS.so = -Wl,-soname,$(@F)
71LDFLAGS-libKSC.so = -Wl,-soname,$(@F)
71bedb76 72
b9b49b44
UD
73distribute := 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 \
d2374599
UD
80 extra-module.mk euckr.c johab.c uhc.c ksc5601.c ksc5601.h \
81 iso646.c
f4017d20
UD
82
83# We build the transformation modules only when we build shared libs.
84ifeq (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'.
88define 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)
96endef
97
98# Rule to generate the shared objects.
99extra-modules-left := $(modules)
100include extra-module.mk
101
102
103extra-objs += $(modules.so)
104install-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.
f4017d20
UD
109define generate-8bit-table
110( echo "static const wchar_t to_ucs4[256] = {"; \
04be94a8
UD
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 $@
116endef
117
118sed-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
123define 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 }"; \
f4017d20
UD
130 echo "};"; \
131 echo "static const char from_ucs4[] = {"; \
04be94a8 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; \
f4017d20
UD
133 echo "};" ) > $@.new && rm -f $@ && mv $@.new $@
134endef
135
04be94a8
UD
136perl-generated-headers := koi8-r.h latin-greek.h latin-greek-1.h
137
138# The headers must be generated before the compilation.
139before-compile = $(sed-generated-headers) $(perl-generated-headers)
140
141
142# Rules to generate the headers.
143iso8859-2.h: ../localedata/charmaps/ISO-8859-2 Makefile
144 $(generate-8bit-table)
145iso8859-3.h: ../localedata/charmaps/ISO-8859-3 Makefile
146 $(generate-8bit-table)
147iso8859-4.h: ../localedata/charmaps/ISO-8859-4 Makefile
148 $(generate-8bit-table)
149iso8859-5.h: ../localedata/charmaps/ISO-8859-5 Makefile
f4017d20 150 $(generate-8bit-table)
04be94a8 151iso8859-6.h: ../localedata/charmaps/ISO-8859-6 Makefile
f4017d20 152 $(generate-8bit-table)
04be94a8 153iso8859-7.h: ../localedata/charmaps/ISO-8859-7 Makefile
f4017d20 154 $(generate-8bit-table)
04be94a8 155iso8859-8.h: ../localedata/charmaps/ISO-8859-8 Makefile
f4017d20 156 $(generate-8bit-table)
04be94a8 157iso8859-9.h: ../localedata/charmaps/ISO-8859-9 Makefile
f4017d20 158 $(generate-8bit-table)
04be94a8 159iso8859-10.h: ../localedata/charmaps/ISO-8859-10 Makefile
f4017d20 160 $(generate-8bit-table)
04be94a8
UD
161
162koi-8.h: ../localedata/charmaps/KOI-8 Makefile
163 $(generate-8bit-table)
164
165hp-roman8.h: ../localedata/charmaps/HP-ROMAN8 Makefile
f4017d20 166 $(generate-8bit-table)
04be94a8
UD
167
168ebcdic-at-de.h: ../localedata/charmaps/EBCDIC-AT-DE Makefile
169 $(generate-8bit-table)
170ebcdic-at-de-a.h: ../localedata/charmaps/EBCDIC-AT-DE-A Makefile
f4017d20 171 $(generate-8bit-table)
04be94a8 172ebcdic-ca-fr.h: ../localedata/charmaps/EBCDIC-CA-FR Makefile
f4017d20
UD
173 $(generate-8bit-table)
174
04be94a8
UD
175ifneq ($(PERL),no)
176koi8-r.h: ../localedata/charmaps/KOI8-R Makefile
177 $(generate-8bit-gap-table)
178latin-greek.h: ../localedata/charmaps/LATIN-GREEK Makefile
179 $(generate-8bit-gap-table)
180latin-greek-1.h: ../localedata/charmaps/LATIN-GREEK-1 Makefile
181 $(generate-8bit-gap-table)
f4017d20
UD
182endif
183
04be94a8
UD
184headers: $(sed-generated-headers) $(perl-generated-headers)
185
f4017d20 186
73237de3
UD
187$(addprefix $(inst_gconvdir)/, $(modules.so)): \
188 $(inst_gconvdir)/%: $(objpfx)% $(+force)
f4017d20 189 $(do-install-program)
73237de3 190$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
f4017d20
UD
191 $(do-install)
192endif
193
194include ../Rules