]>
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. | |
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 | |
28 | modules.so := $(addsuffix .so, $(modules)) | |
29 | ||
30 | ||
31 | ISO8859-1-routines := iso8859-1 | |
32 | ISO8859-2-routines := iso8859-2 | |
33 | ISO8859-3-routines := iso8859-3 | |
34 | ISO8859-4-routines := iso8859-4 | |
35 | ISO8859-5-routines := iso8859-5 | |
36 | ISO8859-6-routines := iso8859-6 | |
37 | ISO8859-7-routines := iso8859-7 | |
38 | ISO8859-8-routines := iso8859-8 | |
39 | ISO8859-9-routines := iso8859-9 | |
40 | ISO8859-10-routines := iso8859-10 | |
41 | T.61-routines := t61 | |
42 | ISO_6937-routines := iso6937 | |
43 | ||
44 | distribute := iso8859-generic.c \ | |
45 | iso8859-1.c iso8859-2.c iso8859-3.c iso8859-4.c iso8859-5.c \ | |
46 | iso8859-6.c iso8859-7.c iso8859-8.c iso8859-9.c iso8859-10.c\ | |
47 | iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h iso8859-6.h \ | |
48 | iso8859-7.h iso8859-8.h iso8859-9.h iso8859-10.h t61.c \ | |
49 | iso6937.c | |
50 | ||
51 | include ../Makeconfig | |
52 | ||
53 | # We build the transformation modules only when we build shared libs. | |
54 | ifeq (yes,$(build-shared)) | |
55 | ||
56 | # This macro is similar to build-shlib but it does not define a soname | |
57 | # and it does not depend on the destination name to start with `lib'. | |
58 | define build-module | |
59 | $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \ | |
60 | -B$(csu-objpfx) $(load-map-file:%=-Wl,--version-script=%) \ | |
61 | $(LDFLAGS.so) $(LDFLAGS-$(@F:%.so=%).so) \ | |
62 | -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \ | |
63 | -Wl,--whole-archive \ | |
64 | $(filter-out $($(@F:.so=)-map) $(+preinit) $(+postinit),$^) \ | |
65 | $(no-whole-archive) $(LDLIBS-$(@F:%.so=%).so) | |
66 | endef | |
67 | ||
68 | # Rule to generate the shared objects. | |
69 | extra-modules-left := $(modules) | |
70 | include extra-module.mk | |
71 | ||
72 | ||
73 | extra-objs += $(modules.so) | |
74 | install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \ | |
75 | $(inst_gconvdir)/gconv-modules | |
76 | ||
77 | # If we have the localedata add-on available we can build the conversion | |
78 | # tables for numerous charsets. | |
79 | ifneq (,$(findstring localedata,$(add-ons))) | |
80 | define generate-8bit-table | |
81 | ( echo "static const wchar_t to_ucs4[256] = {"; \ | |
82 | sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\1] = 0x\2,/p' -e d $^ | sort -u; \ | |
83 | echo "};"; \ | |
84 | echo "static const char from_ucs4[] = {"; \ | |
85 | sed -e 's/^[^[:space:]]*[[:space:]]*.x\(..\)[[:space:]]*<U\(....\)>.*/ [0x\2] = 0x\1,/p' -e d $^ | sort -u; \ | |
86 | echo "};" ) > $@.new && rm -f $@ && mv $@.new $@ | |
87 | endef | |
88 | ||
89 | iso8859-2.h: ../localedata/charmaps/ISO-8859-2 | |
90 | $(generate-8bit-table) | |
91 | iso8859-3.h: ../localedata/charmaps/ISO-8859-3 | |
92 | $(generate-8bit-table) | |
93 | iso8859-4.h: ../localedata/charmaps/ISO-8859-4 | |
94 | $(generate-8bit-table) | |
95 | iso8859-5.h: ../localedata/charmaps/ISO-8859-5 | |
96 | $(generate-8bit-table) | |
97 | iso8859-6.h: ../localedata/charmaps/ISO-8859-6 | |
98 | $(generate-8bit-table) | |
99 | iso8859-7.h: ../localedata/charmaps/ISO-8859-7 | |
100 | $(generate-8bit-table) | |
101 | iso8859-8.h: ../localedata/charmaps/ISO-8859-8 | |
102 | $(generate-8bit-table) | |
103 | iso8859-9.h: ../localedata/charmaps/ISO-8859-9 | |
104 | $(generate-8bit-table) | |
105 | iso8859-10.h: ../localedata/charmaps/ISO-8859-10 | |
106 | $(generate-8bit-table) | |
107 | ||
108 | headers: iso8859-2.h iso8859-3.h iso8859-4.h iso8859-5.h iso8859-6.h \ | |
109 | iso8859-7.h iso8859-8.h iso8859-9.h iso8859-10.h | |
110 | endif | |
111 | ||
112 | ||
113 | $(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)% | |
114 | $(do-install-program) | |
115 | $(inst_gconvdir)/gconv_modules: gconv-modules | |
116 | $(do-install) | |
117 | endif | |
118 | ||
119 | include ../Rules |