1 # Copyright (C) 1997 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
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.
20 # Makefile for iconv data and code.
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 \
30 modules.so
:= $(addsuffix .so
, $(modules
))
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
46 ISO_6937-routines
:= iso6937
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
56 libJIS-routines
:= jis0201 jis0208 jis0212
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 \
67 # We build the transformation modules only when we build shared libs.
68 ifeq (yes
,$(build-shared
))
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'.
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
) \
78 $(filter-out $($(@F
:.so
=)-map
) $(+preinit
) $(+postinit
),$^
) \
79 $(no-whole-archive
) $(LDLIBS-
$(@F
:%.so
=%).so
)
82 # Rule to generate the shared objects.
83 extra-modules-left
:= $(modules
)
84 include extra-module.mk
87 extra-objs
+= $(modules.so
)
88 install-others
= $(addprefix $(inst_gconvdir
)/, $(modules.so
)) \
89 $(inst_gconvdir
)/gconv-modules
91 # If we have the localedata add-on available we can build the conversion
92 # tables for numerous charsets.
93 define generate-8bit-table
94 ( echo
"static const wchar_t to_ucs4[256] = {"; \
95 sed
-e
'/^[^[:space:]]*[[:space:]]*.x00/d' -e
's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d
$^ |
sort -u
; \
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
$@
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
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
; \
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 }"; \
115 echo
"static const char from_ucs4[] = {"; \
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
; \
117 echo
"};" ) > $@.new
&& rm -f
$@
&& mv
$@.new
$@
120 perl-generated-headers
:= koi8-r.h latin-greek.h latin-greek-1.h
122 # The headers must be generated before the compilation.
123 before-compile
= $(sed-generated-headers
) $(perl-generated-headers
)
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
134 $(generate-8bit-table
)
135 iso8859-6.h
: ..
/localedata
/charmaps
/ISO-8859-6 Makefile
136 $(generate-8bit-table
)
137 iso8859-7.h
: ..
/localedata
/charmaps
/ISO-8859-7 Makefile
138 $(generate-8bit-table
)
139 iso8859-8.h
: ..
/localedata
/charmaps
/ISO-8859-8 Makefile
140 $(generate-8bit-table
)
141 iso8859-9.h
: ..
/localedata
/charmaps
/ISO-8859-9 Makefile
142 $(generate-8bit-table
)
143 iso8859-10.h
: ..
/localedata
/charmaps
/ISO-8859-10 Makefile
144 $(generate-8bit-table
)
146 koi-8.h
: ..
/localedata
/charmaps
/KOI-8 Makefile
147 $(generate-8bit-table
)
149 hp-roman8.h
: ..
/localedata
/charmaps
/HP-ROMAN8 Makefile
150 $(generate-8bit-table
)
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
155 $(generate-8bit-table
)
156 ebcdic-ca-fr.h
: ..
/localedata
/charmaps
/EBCDIC-CA-FR Makefile
157 $(generate-8bit-table
)
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
)
168 headers
: $(sed-generated-headers
) $(perl-generated-headers
)
171 $(addprefix $(inst_gconvdir
)/, $(modules.so
)): $(inst_gconvdir
)/%: $(objpfx
)%
172 $(do-install-program
)
173 $(inst_gconvdir
)/gconv-modules
: gconv-modules