clarify the purpose of this project
[nyanglibc.git] / make / iconvdata.sh
blob2ef4c260046fb054e96903ff80a80e3d7aac3f27
1 printf "\
2 ICONVDATA***********************************************************************\n"
3 mkdir -p $build_dir/iconvdata
4 #-------------------------------------------------------------------------------
5 # libKSC.so helper
6 printf 'BUILDING LIBKSC HELPER MODULE\n'
7 $as $src_dir/iconvdata/ksc5601.shared.s -o $build_dir/iconvdata/ksc5601.os
8 $ld \
9 -s \
10 -shared \
11 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
12 -z defs \
13 -L$build_dir/csu/ \
14 -z combreloc \
15 -z relro \
16 --hash-style=both \
17 -soname libKSC.so \
18 -L$build_dir \
19 -L$build_dir/math \
20 -L$build_dir/elf \
21 -L$build_dir/dlfcn \
22 -L$build_dir/nss \
23 -L$build_dir/nis \
24 -L$build_dir/rt \
25 -L$build_dir/resolv \
26 -L$build_dir/mathvec \
27 -L$build_dir/support \
28 -L$build_dir/crypt \
29 -L$build_dir/nptl \
30 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
31 -o $build_dir/iconvdata/libKSC.so \
32 -T $src_dir/shlib.lds \
33 $build_dir/csu/abi-note.o \
34 --as-needed \
35 $build_dir/iconvdata/ksc5601.os \
36 --no-as-needed \
37 --start-group \
38 $build_dir/libc.so \
39 $build_dir/libc_nonshared.a \
40 --as-needed \
41 $build_dir/elf/ld-linux-x86-64.so.2 \
42 --no-as-needed \
43 --end-group
44 #-------------------------------------------------------------------------------
45 # libJIS.so helper
46 printf 'BUILDING LIBJIS HELPER MODULE\n'
47 $as $src_dir/iconvdata/jis0201.shared.s -o $build_dir/iconvdata/jis0201.os
48 $as $src_dir/iconvdata/jis0208.shared.s -o $build_dir/iconvdata/jis0208.os
49 $as $src_dir/iconvdata/jis0212.shared.s -o $build_dir/iconvdata/jis0212.os
50 $ld \
51 -s \
52 -shared \
53 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
54 -z defs \
55 -L$build_dir/csu/ \
56 -z combreloc \
57 -z relro \
58 --hash-style=both \
59 -soname libJIS.so \
60 -L$build_dir \
61 -L$build_dir/math \
62 -L$build_dir/elf \
63 -L$build_dir/dlfcn \
64 -L$build_dir/nss \
65 -L$build_dir/nis \
66 -L$build_dir/rt \
67 -L$build_dir/resolv \
68 -L$build_dir/mathvec \
69 -L$build_dir/support \
70 -L$build_dir/crypt \
71 -L$build_dir/nptl \
72 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
73 -o $build_dir/iconvdata/libJIS.so \
74 -T $src_dir/shlib.lds \
75 $build_dir/csu/abi-note.o \
76 --as-needed \
77 $build_dir/iconvdata/jis0201.os \
78 $build_dir/iconvdata/jis0208.os \
79 $build_dir/iconvdata/jis0212.os \
80 --no-as-needed \
81 --start-group \
82 $build_dir/libc.so \
83 $build_dir/libc_nonshared.a \
84 --as-needed \
85 $build_dir/elf/ld-linux-x86-64.so.2 \
86 --no-as-needed \
87 --end-group
88 #-------------------------------------------------------------------------------
89 # libGB.so helper
90 printf 'BUILDING LIBGB HELPER MODULE\n'
91 $as $src_dir/iconvdata/gb2312.shared.s -o $build_dir/iconvdata/gb2312.os
92 $ld \
93 -s \
94 -shared \
95 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
96 -z defs \
97 -L$build_dir/csu/ \
98 -z combreloc \
99 -z relro \
100 --hash-style=both \
101 -soname libGB.so \
102 -L$build_dir \
103 -L$build_dir/math \
104 -L$build_dir/elf \
105 -L$build_dir/dlfcn \
106 -L$build_dir/nss \
107 -L$build_dir/nis \
108 -L$build_dir/rt \
109 -L$build_dir/resolv \
110 -L$build_dir/mathvec \
111 -L$build_dir/support \
112 -L$build_dir/crypt \
113 -L$build_dir/nptl \
114 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
115 -o $build_dir/iconvdata/libGB.so \
116 -T $src_dir/shlib.lds \
117 $build_dir/csu/abi-note.o \
118 --as-needed \
119 $build_dir/iconvdata/gb2312.os \
120 --no-as-needed \
121 --start-group \
122 $build_dir/libc.so \
123 $build_dir/libc_nonshared.a \
124 --as-needed \
125 $build_dir/elf/ld-linux-x86-64.so.2 \
126 --no-as-needed \
127 --end-group
128 #-------------------------------------------------------------------------------
129 # libCNS.so helper
130 printf 'BUILDING LIBCNS HELPER MODULE\n'
131 $as $src_dir/iconvdata/cns11643l1.shared.s -o $build_dir/iconvdata/cns11643l1.os
132 $as $src_dir/iconvdata/cns11643.shared.s -o $build_dir/iconvdata/cns11643.os
133 $ld \
134 -s \
135 -shared \
136 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
137 -z defs \
138 -L$build_dir/csu/ \
139 -z combreloc \
140 -z relro \
141 --hash-style=both \
142 -soname libCNS.so \
143 -L$build_dir \
144 -L$build_dir/math \
145 -L$build_dir/elf \
146 -L$build_dir/dlfcn \
147 -L$build_dir/nss \
148 -L$build_dir/nis \
149 -L$build_dir/rt \
150 -L$build_dir/resolv \
151 -L$build_dir/mathvec \
152 -L$build_dir/support \
153 -L$build_dir/crypt \
154 -L$build_dir/nptl \
155 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
156 -o $build_dir/iconvdata/libCNS.so \
157 -T $src_dir/shlib.lds \
158 $build_dir/csu/abi-note.o \
159 --as-needed \
160 $build_dir/iconvdata/cns11643l1.os \
161 $build_dir/iconvdata/cns11643.os \
162 --no-as-needed \
163 --start-group \
164 $build_dir/libc.so \
165 $build_dir/libc_nonshared.a \
166 --as-needed \
167 $build_dir/elf/ld-linux-x86-64.so.2 \
168 --no-as-needed \
169 --end-group
170 #-------------------------------------------------------------------------------
171 # libISOIR165.so helper
172 printf 'BUILDING LIBISOIR165 HELPER MODULE\n'
173 $as $src_dir/iconvdata/iso-ir-165.shared.s -o $build_dir/iconvdata/iso-ir-165.os
174 $ld \
175 -s \
176 -shared \
177 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
178 -z defs \
179 -L$build_dir/csu/ \
180 -z combreloc \
181 -z relro \
182 --hash-style=both \
183 -soname libISOIR165.so \
184 -L$build_dir/nss \
185 -L$build_dir/nis \
186 -L$build_dir/rt \
187 -L$build_dir/resolv \
188 -L$build_dir/mathvec \
189 -L$build_dir/support \
190 -L$build_dir/crypt \
191 -L$build_dir/nptl \
192 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
193 -o $build_dir/iconvdata/libISOIR165.so \
194 -T $src_dir/shlib.lds \
195 $build_dir/csu/abi-note.o \
196 --as-needed \
197 $build_dir/iconvdata/iso-ir-165.os \
198 --no-as-needed \
199 --start-group \
200 $build_dir/libc.so \
201 $build_dir/libc_nonshared.a \
202 --as-needed \
203 $build_dir/elf/ld-linux-x86-64.so.2 \
204 --no-as-needed \
205 --end-group
206 #-------------------------------------------------------------------------------
207 # libJISX0213.so helper
208 printf 'BUILDING LIBJISX0213 HELPER MODULE\n'
209 $as $src_dir/iconvdata/jisx0213.shared.s -o $build_dir/iconvdata/jisx0213.os
210 $ld \
211 -s \
212 -shared \
213 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
214 -z defs \
215 -L$build_dir/csu/ \
216 -z combreloc \
217 -z relro \
218 --hash-style=both \
219 -soname libJISX0213.so \
220 -L$build_dir/nss \
221 -L$build_dir/nis \
222 -L$build_dir/rt \
223 -L$build_dir/resolv \
224 -L$build_dir/mathvec \
225 -L$build_dir/support \
226 -L$build_dir/crypt \
227 -L$build_dir/nptl \
228 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
229 -o $build_dir/iconvdata/libJISX0213.so \
230 -T $src_dir/shlib.lds \
231 $build_dir/csu/abi-note.o \
232 --as-needed \
233 $build_dir/iconvdata/jisx0213.os \
234 --no-as-needed \
235 --start-group \
236 $build_dir/libc.so \
237 $build_dir/libc_nonshared.a \
238 --as-needed \
239 $build_dir/elf/ld-linux-x86-64.so.2 \
240 --no-as-needed \
241 --end-group
242 fns_shared="\
243 iso8859-1 \
244 iso8859-2 \
245 iso8859-3 \
246 iso8859-4 \
247 iso8859-5 \
248 iso8859-6 \
249 iso8859-7 \
250 iso8859-8 \
251 iso8859-9 \
252 iso8859-10 \
253 iso8859-11 \
254 iso8859-13 \
255 iso8859-14 \
256 iso8859-15 \
257 iso8859-16 \
258 t.61 \
259 iso_6937 \
260 sjis \
261 koi-8 \
262 hp-roman8 \
263 hp-roman9 \
264 ebcdic-at-de \
265 ebcdic-at-de-a \
266 ebcdic-ca-fr \
267 euc-kr \
268 uhc \
269 johab \
270 big5 \
271 euc-jp \
272 euc-cn \
273 euc-tw \
274 iso646 \
275 ebcdic-dk-no \
276 ebcdic-dk-no-a \
277 ebcdic-es \
278 ebcdic-es-a \
279 ebcdic-es-s \
280 ebcdic-fi-se \
281 ebcdic-fi-se-a \
282 ebcdic-fr \
283 ebcdic-is-friss \
284 ebcdic-it \
285 ebcdic-pt \
286 ebcdic-uk \
287 ebcdic-us \
288 ibm037 \
289 ibm038 \
290 ibm274 \
291 ibm275 \
292 ibm423 \
293 ibm500 \
294 ibm870 \
295 ibm871 \
296 ibm891 \
297 ibm903 \
298 ibm904 \
299 ibm905 \
300 ibm1047 \
301 ibm874 \
302 cp737 \
303 cp775 \
304 iso-2022-kr \
305 hp-turkish8 \
306 hp-thai8 \
307 hp-greek8 \
308 koi8-r \
309 latin-greek \
310 latin-greek-1 \
311 ibm256 \
312 ibm273 \
313 ibm277 \
314 ibm278 \
315 ibm280 \
316 ibm281 \
317 ibm284 \
318 ibm285 \
319 ibm290 \
320 ibm297 \
321 ibm420 \
322 ibm424 \
323 ibm437 \
324 ibm850 \
325 ibm851 \
326 ibm852 \
327 ibm855 \
328 ibm857 \
329 ibm858 \
330 ibm860 \
331 ibm861 \
332 ibm862 \
333 ibm863 \
334 ibm864 \
335 ibm865 \
336 ibm868 \
337 ibm869 \
338 ibm875 \
339 ibm880 \
340 ibm866 \
341 cp1258 \
342 ibm922 \
343 ibm1124 \
344 ibm1129 \
345 ibm932 \
346 ibm943 \
347 ibm856 \
348 ibm930 \
349 ibm933 \
350 ibm935 \
351 ibm937 \
352 ibm939 \
353 ibm1046 \
354 ibm1132 \
355 ibm1133 \
356 ibm1160 \
357 ibm1161 \
358 ibm1162 \
359 ibm1163 \
360 ibm1164 \
361 ibm918 \
362 ibm1004 \
363 ibm1026 \
364 cp1125 \
365 cp1250 \
366 cp1251 \
367 cp1252 \
368 cp1253 \
369 cp1254 \
370 cp1255 \
371 cp1256 \
372 cp1257 \
373 iso-2022-jp \
374 macintosh \
375 iec_p27-1 \
376 asmo_449 \
377 ansi_x3.110 \
378 csn_369103 \
379 cwi \
380 dec-mcs \
381 ecma-cyrillic \
382 gost_19768-74 \
383 greek-ccitt \
384 greek7 \
385 greek7-old \
386 inis \
387 inis-8 \
388 inis-cyrillic \
389 iso_6937-2 \
390 iso_2033 \
391 iso_5427 \
392 iso_5427-ext \
393 iso_5428 \
394 iso_10367-box \
395 mac-is \
396 mac-uk \
397 nats-dano \
398 nats-sefi \
399 sami-ws2 \
400 iso-ir-197 \
401 tis-620 \
402 koi8-u \
403 gbk \
404 isiri-3342 \
405 gbgbk \
406 iso-2022-cn \
407 utf-16 \
408 unicode \
409 utf-32 \
410 utf-7 \
411 big5hkscs \
412 gb18030 \
413 iso-2022-cn-ext \
414 viscii \
415 gbbig5 \
416 cp10007 \
417 koi8-t \
418 georgian-ps \
419 georgian-academy \
420 iso-ir-209 \
421 mac-sami \
422 armscii-8 \
423 tcvn5712-1 \
424 euc-jisx0213 \
425 shift_jisx0213 \
426 iso-2022-jp-3 \
427 tscii \
428 ibm866nav \
429 cp932 \
430 euc-jp-ms \
431 pt154 \
432 rk1048 \
433 ibm1025 \
434 ibm1122 \
435 ibm1137 \
436 ibm1153 \
437 ibm1154 \
438 ibm1155 \
439 ibm1156 \
440 ibm1157 \
441 ibm1158 \
442 ibm803 \
443 ibm901 \
444 ibm902 \
445 ibm921 \
446 ibm1008 \
447 ibm1008_420 \
448 ibm1097 \
449 ibm1112 \
450 ibm1123 \
451 ibm1130 \
452 ibm1140 \
453 ibm1141 \
454 ibm1142 \
455 ibm1143 \
456 ibm1144 \
457 ibm1145 \
458 ibm1146 \
459 ibm1147 \
460 ibm1148 \
461 ibm1149 \
462 ibm1166 \
463 ibm1167 \
464 ibm4517 \
465 ibm4899 \
466 ibm4909 \
467 ibm4971 \
468 ibm5347 \
469 ibm9030 \
470 ibm9066 \
471 ibm9448 \
472 ibm12712 \
473 ibm16804 \
474 ibm1364 \
475 ibm1371 \
476 ibm1388 \
477 ibm1390 \
478 ibm1399 \
479 iso_11548-1 \
480 mik \
481 brf \
482 mac-centraleurope \
483 koi8-ru \
484 iso8859-9e \
485 cp770 \
486 cp771 \
487 cp772 \
488 cp773 \
489 cp774 \
491 for fn in $fns_shared
493 printf "BUILDING $fn ICONV MODULE\n"
494 helper_modules=
495 rpath_origin=
496 if test "$fn" = "euc-kr" -o "$fn" = "uhc" -o "$fn" = "johab" \
497 -o "$fn" = "iso-2022-kr"; then
498 helper_modules="$build_dir/iconvdata/libKSC.so"
499 rpath_origin='-rpath \$ORIGIN'
501 if test "$fn" = "euc-jp" -o "$fn" = "euc-jp-ms"; then
502 helper_modules="$build_dir/iconvdata/libJIS.so"
503 rpath_origin='-rpath \$ORIGIN'
505 if test "$fn" = "euc-cn"; then
506 helper_modules="$build_dir/iconvdata/libGB.so"
507 rpath_origin='-rpath \$ORIGIN'
509 if test "$fn" = "euc-tw"; then
510 helper_modules="$build_dir/iconvdata/libCNS.so"
511 rpath_origin='-rpath \$ORIGIN'
513 if test "$fn" = "iso-2022-jp"; then
514 helper_modules="\
515 $build_dir/iconvdata/libJIS.so \
516 $build_dir/iconvdata/libGB.so \
517 $build_dir/iconvdata/libCNS.so \
518 $build_dir/iconvdata/libKSC.so \
520 rpath_origin='-rpath \$ORIGIN'
522 if test "$fn" = "iso-2022-cn"; then
523 helper_modules="\
524 $build_dir/iconvdata/libGB.so \
525 $build_dir/iconvdata/libCNS.so \
527 rpath_origin='-rpath \$ORIGIN'
529 if test "$fn" = "iso-2022-cn-ext"; then
530 helper_modules="\
531 $build_dir/iconvdata/libGB.so \
532 $build_dir/iconvdata/libCNS.so \
533 $build_dir/iconvdata/libISOIR165.so \
535 rpath_origin='-rpath \$ORIGIN'
537 if test "$fn" = "euc-jisx0213" -o "$fn" = "shift_jisx0213"; then
538 helper_modules="\
539 $build_dir/iconvdata/libJISX0213.so \
541 rpath_origin='-rpath \$ORIGIN'
543 if test "$fn" = "iso-2022-jp-3"; then
544 helper_modules="\
545 $build_dir/iconvdata/libJIS.so \
546 $build_dir/iconvdata/libJISX0213.so \
548 rpath_origin='-rpath \$ORIGIN'
550 $as $src_dir/iconvdata/$fn.shared.s -o $build_dir/iconvdata/$fn.os
551 # keep the upper case
552 module_name=$(printf "$fn" | tr '[a-z]' '[A-Z]').so
553 $ld \
554 -s \
555 -shared \
556 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 \
557 -z defs \
558 -L$build_dir/csu/ \
559 --version-script=$src_dir/gconv.map \
560 -z combreloc \
561 -z relro \
562 --hash-style=both \
563 $rpath_origin \
564 -L$build_dir \
565 -L$build_dir/math \
566 -L$build_dir/elf \
567 -L$build_dir/dlfcn \
568 -L$build_dir/nss \
569 -L$build_dir/nis \
570 -L$build_dir/rt \
571 -L$build_dir/resolv \
572 -L$build_dir/mathvec \
573 -L$build_dir/support \
574 -L$build_dir/crypt \
575 -L$build_dir/nptl \
576 -rpath-link=$build_dir:$build_dir/math:$build_dir/elf:$build_dir/dlfcn:$build_dir/nss:$build_dir/nis:$build_dir/rt:$build_dir/resolv:$build_dir/mathvec:$build_dir/support:$build_dir/crypt:$build_dir/nptl \
577 -o "$build_dir/iconvdata/$module_name" \
578 -T $src_dir/shlib.lds \
579 $build_dir/csu/abi-note.o \
580 --as-needed \
581 $build_dir/iconvdata/$fn.os \
582 $helper_modules \
583 --no-as-needed \
584 --start-group \
585 $build_dir/libc.so \
586 $build_dir/libc_nonshared.a \
587 --as-needed \
588 $build_dir/elf/ld-linux-x86-64.so.2 \
589 --no-as-needed \
590 --end-group
591 done