sparc64: Remove fcopysign{f} implementation
[glibc.git] / localedata / Makefile
blobd17da6844e11ed24a9f583f9a3eceab73d09a9b0
1 # Copyright (C) 1996-2022 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 Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the 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 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
18 # Makefile for installing locale data source files.
20 subdir := localedata
22 include ../Makeconfig
24 # List with all available character set descriptions.
25 charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*)
27 # List with all available character set descriptions.
28 locales := $(wildcard locales/*)
31 subdir-dirs = tests-mbwc
32 vpath %.c tests-mbwc
33 vpath %.h tests-mbwc
36 test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans \
37 tst-ctype tst-langinfo-newlocale tst-langinfo-setlocale \
38 tst-langinfo-newlocale-static tst-langinfo-setlocale-static \
39 tst-numeric
40 # List of test input files (list sorted alphabetically):
41 test-input := \
42 am_ET.UTF-8 \
43 az_AZ.UTF-8 \
44 be_BY.UTF-8 \
45 ber_DZ.UTF-8 \
46 ber_MA.UTF-8 \
47 bg_BG.UTF-8 \
48 br_FR.UTF-8 \
49 bs_BA.UTF-8 \
50 C.UTF-8 \
51 ckb_IQ.UTF-8 \
52 cmn_TW.UTF-8 \
53 crh_UA.UTF-8 \
54 cs_CZ.UTF-8 \
55 csb_PL.UTF-8 \
56 cv_RU.UTF-8 \
57 cy_GB.UTF-8 \
58 da_DK.ISO-8859-1 \
59 de_DE.ISO-8859-1 \
60 dsb_DE.UTF-8 \
61 dz_BT.UTF-8 \
62 en_US.ISO-8859-1 \
63 en_US.UTF-8 \
64 eo.UTF-8 \
65 es_ES.UTF-8 \
66 et_EE.UTF-8 \
67 fa_IR.UTF-8 \
68 fi_FI.UTF-8 \
69 fil_PH.UTF-8 \
70 fr_CA.UTF-8 \
71 fr_FR.UTF-8 \
72 fur_IT.UTF-8 \
73 gez_ER.UTF-8@abegede \
74 ha_NG.UTF-8 \
75 hr_HR.ISO-8859-2 \
76 hr_HR.UTF-8 \
77 hsb_DE.UTF-8 \
78 hu_HU.UTF-8 \
79 ig_NG.UTF-8 \
80 ik_CA.UTF-8 \
81 is_IS.UTF-8 \
82 kk_KZ.UTF-8 \
83 ku_TR.UTF-8 \
84 ky_KG.UTF-8 \
85 ln_CD.UTF-8 \
86 lt_LT.UTF-8 \
87 lv_LV.UTF-8 \
88 mi_NZ.UTF-8 \
89 ml_IN.UTF-8 \
90 mn_MN.UTF-8 \
91 mr_IN.UTF-8 \
92 mt_MT.UTF-8 \
93 nan_TW.UTF-8@latin \
94 nb_NO.UTF-8 \
95 om_KE.UTF-8 \
96 or_IN.UTF-8 \
97 os_RU.UTF-8 \
98 pl_PL.UTF-8 \
99 ps_AF.UTF-8 \
100 rif_MA.UTF-8 \
101 ro_RO.UTF-8 \
102 ru_RU.UTF-8 \
103 sah_RU.UTF-8 \
104 sc_IT.UTF-8 \
105 se_NO.UTF-8 \
106 si_LK.UTF-8 \
107 sq_AL.UTF-8 \
108 sr_RS.UTF-8 \
109 sv_SE.ISO-8859-1 \
110 sv_SE.UTF-8 \
111 szl_PL.UTF-8 \
112 tg_TJ.UTF-8 \
113 tk_TM.UTF-8 \
114 tr_TR.UTF-8 \
115 tt_RU.UTF-8 \
116 tt_RU.UTF-8@iqtelif \
117 ug_CN.UTF-8 \
118 uk_UA.UTF-8 \
119 uz_UZ.UTF-8 \
120 vi_VN.UTF-8 \
121 yi_US.UTF-8 \
122 yo_NG.UTF-8 \
123 zh_CN.UTF-8 \
124 $(NULL)
126 test-input-data = $(addsuffix .in, $(test-input))
127 test-output := $(foreach s, .out .xout, \
128 $(addsuffix $s, $(basename $(test-input))))
129 ld-test-names := test1 test2 test3 test4 test5 test6 test7
130 ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \
131 $(addsuffix .def,$(ld-test-names)) \
132 $(addsuffix .ds,test5 test6) \
133 test6.c trans.def)
135 fmon-tests = n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
136 y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
138 generated += $(test-input) $(test-output) sort-test.out tst-locale.out \
139 tst-leaks.mtrace mtrace-tst-leaks.out
140 generated-dirs += $(ld-test-names) tt_TT de_DE.437 \
141 $(addprefix tstfmon_,$(fmon-tests)) \
143 ifeq ($(run-built-tests),yes)
144 locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
145 tst_iswctype tst_iswdigit tst_iswgraph \
146 tst_iswlower tst_iswprint tst_iswpunct \
147 tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
148 tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
149 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
150 tst_swscanf tst_towctrans tst_towlower \
151 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
152 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
153 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
154 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
155 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
156 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
157 tst_wctype tst_wcwidth
159 tests = \
160 $(locale_test_suite) \
161 bug-iconv-trans \
162 bug-setlocale1 \
163 bug-usesetlocale \
164 tst-c-utf8-consistency \
165 tst-digits \
166 tst-iconv-math-trans \
167 tst-leaks \
168 tst-mbswcs1 \
169 tst-mbswcs2 \
170 tst-mbswcs3 \
171 tst-mbswcs4 \
172 tst-mbswcs5 \
173 tst-mbswcs6 \
174 tst-setlocale \
175 tst-setlocale2 \
176 tst-setlocale3 \
177 tst-sscanf \
178 tst-strfmon1 \
179 tst-wctype \
180 tst-xlocale1 \
181 tst-xlocale2 \
182 # tests
184 tests-static = bug-setlocale1-static
185 tests += $(tests-static)
186 ifeq (yes,$(build-shared))
187 ifneq (no,$(PERL))
188 tests-special += $(objpfx)mtrace-tst-leaks.out
189 endif
190 endif
191 endif
192 tests-container = \
193 tst-localedef-hardlinks
195 # Files to install.
196 ifeq ($(INSTALL_UNCOMPRESSED),yes)
197 # This option is for testing inside the testroot container, as the
198 # container does not include a working gunzip program.
199 install-others := $(addprefix $(inst_i18ndir)/, \
200 $(charmaps) \
201 $(locales))
202 else
203 install-others := $(addprefix $(inst_i18ndir)/, \
204 $(addsuffix .gz, $(charmaps)) \
205 $(locales))
206 endif
208 tests: $(objdir)/iconvdata/gconv-modules
210 tests-static += tst-langinfo-newlocale-static tst-langinfo-setlocale-static
212 ifeq ($(run-built-tests),yes)
213 tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \
214 $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \
215 $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \
216 $(objpfx)tst-langinfo-newlocale.out \
217 $(objpfx)tst-langinfo-setlocale.out \
218 $(objpfx)tst-langinfo-newlocale-static.out \
219 $(objpfx)tst-langinfo-setlocale-static.out \
220 $(objpfx)tst-numeric.out
221 # We have to generate locales (list sorted alphabetically)
222 LOCALES := \
223 am_ET.UTF-8 \
224 az_AZ.UTF-8 \
225 be_BY.UTF-8 \
226 ber_DZ.UTF-8 \
227 ber_MA.UTF-8 \
228 bg_BG.UTF-8 \
229 br_FR.UTF-8 \
230 bs_BA.UTF-8 \
231 C.UTF-8 \
232 ckb_IQ.UTF-8 \
233 cmn_TW.UTF-8 \
234 crh_UA.UTF-8 \
235 cs_CZ.UTF-8 \
236 csb_PL.UTF-8 \
237 cv_RU.UTF-8 \
238 cy_GB.UTF-8 \
239 da_DK.ISO-8859-1 \
240 de_DE.ISO-8859-1 \
241 de_DE.UTF-8 \
242 dsb_DE.UTF-8 \
243 dz_BT.UTF-8 \
244 en_GB.UTF-8 \
245 en_US.ANSI_X3.4-1968 \
246 en_US.ISO-8859-1\
247 en_US.UTF-8 \
248 eo.UTF-8 \
249 es_ES.UTF-8 \
250 et_EE.UTF-8 \
251 fa_IR.UTF-8 \
252 fi_FI.UTF-8 \
253 fil_PH.UTF-8 \
254 fr_CA.UTF-8 \
255 fr_FR.ISO-8859-1 \
256 fr_FR.UTF-8 \
257 fur_IT.UTF-8 \
258 gez_ER.UTF-8@abegede \
259 ha_NG.UTF-8 \
260 hr_HR.ISO-8859-2 \
261 hr_HR.UTF-8 \
262 hsb_DE.UTF-8 \
263 hu_HU.UTF-8 \
264 ig_NG.UTF-8 \
265 ik_CA.UTF-8 \
266 is_IS.UTF-8 \
267 ja_JP.EUC-JP \
268 ja_JP.SJIS \
269 ja_JP.UTF-8 \
270 kk_KZ.UTF-8 \
271 ku_TR.UTF-8 \
272 ky_KG.UTF-8 \
273 ln_CD.UTF-8 \
274 lt_LT.UTF-8 \
275 lv_LV.UTF-8 \
276 mi_NZ.UTF-8 \
277 ml_IN.UTF-8 \
278 mn_MN.UTF-8 \
279 mr_IN.UTF-8 \
280 mt_MT.UTF-8 \
281 nan_TW.UTF-8@latin \
282 nb_NO.ISO-8859-1 \
283 nb_NO.UTF-8 \
284 nl_NL.UTF-8 \
285 nn_NO.ISO-8859-1 \
286 om_KE.UTF-8 \
287 or_IN.UTF-8 \
288 os_RU.UTF-8 \
289 pl_PL.UTF-8 \
290 ps_AF.UTF-8 \
291 rif_MA.UTF-8 \
292 ro_RO.UTF-8 \
293 ru_RU.UTF-8 \
294 sah_RU.UTF-8 \
295 sc_IT.UTF-8 \
296 se_NO.UTF-8 \
297 si_LK.UTF-8 \
298 sq_AL.UTF-8 \
299 sr_RS.UTF-8 \
300 sv_SE.ISO-8859-1 \
301 sv_SE.UTF-8 \
302 szl_PL.UTF-8 \
303 tg_TJ.UTF-8 \
304 tk_TM.UTF-8 \
305 tr_TR.ISO-8859-9 \
306 tr_TR.UTF-8 \
307 tt_RU.UTF-8 \
308 tt_RU.UTF-8@iqtelif \
309 ug_CN.UTF-8 \
310 uk_UA.UTF-8 \
311 uz_UZ.UTF-8 \
312 vi_VN.UTF-8 \
313 yi_US.UTF-8 \
314 yo_NG.UTF-8 \
315 zh_CN.UTF-8 \
316 zh_TW.EUC-TW \
317 $(NULL)
319 include ../gen-locales.mk
321 $(objpfx)tst-iconv-math-trans.out: $(gen-locales)
322 endif
324 include ../Rules
326 ifeq ($(INSTALL_UNCOMPRESSED),yes)
327 # Install the charmap files as-is. This option is for testing inside
328 # the testroot container, as the container does not include a working
329 # gunzip program.
330 $(inst_i18ndir)/charmaps/%: charmaps/% $(+force)
331 $(make-target-directory)
332 rm -f $@
333 $(INSTALL_DATA) $< $@
334 else
335 # Install the charmap files in gzipped format.
336 $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
337 $(make-target-directory)
338 rm -f $(@:.gz=) $@
339 $(INSTALL_DATA) $< $(@:.gz=)
340 gzip -9n $(@:.gz=)
341 endif
343 # Install the locale source files in the appropriate directory.
344 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
346 ifeq ($(run-built-tests),yes)
347 generated-dirs += $(LOCALES)
349 $(addsuffix .out,$(addprefix $(objpfx),$(tests))): %: \
350 $(addprefix $(objpfx),$(CTYPE_FILES))
352 $(objpfx)sort-test.out: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
353 $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES))
354 $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
355 '$(run-program-env)' '$(test-program-prefix-after-env)' \
356 $(test-input) \
357 > $@; \
358 $(evaluate-test)
359 $(objpfx)tst-fmon.out: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data \
360 $(objpfx)sort-test.out \
361 $(addprefix $(objpfx),$(CTYPE_FILES))
362 $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
363 '$(run-program-env)' '$(run-program-prefix-after-env)' \
364 '$(test-program-prefix)' tst-fmon.data \
365 > $@; \
366 $(evaluate-test)
367 $(objpfx)tst-numeric.out: tst-numeric.sh $(objpfx)tst-numeric tst-numeric.data \
368 $(objpfx)sort-test.out \
369 $(addprefix $(objpfx),$(CTYPE_FILES))
370 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' tst-numeric.data \
371 > $@; \
372 $(evaluate-test)
373 $(objpfx)tst-locale.out: tst-locale.sh $(common-objpfx)locale/localedef \
374 $(ld-test-srcs) $(addprefix $(objpfx),$(CTYPE_FILES))
375 $(SHELL) $< $(common-objpfx) '$(built-program-cmd-before-env)' \
376 '$(run-program-env)' '$(built-program-cmd-after-env)' > $@; \
377 $(evaluate-test)
378 $(objpfx)tst-rpmatch.out: tst-rpmatch.sh $(objpfx)tst-rpmatch \
379 $(objpfx)tst-fmon.out \
380 $(addprefix $(objpfx),$(CTYPE_FILES))
381 $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \
382 $(evaluate-test)
383 $(objpfx)tst-trans.out: tst-trans.sh $(objpfx)tst-trans \
384 $(addprefix $(objpfx),$(CTYPE_FILES))
385 $(SHELL) $< $(common-objpfx) '$(run-program-prefix-before-env)' \
386 '$(run-program-env)' '$(run-program-prefix-after-env)' \
387 '$(test-program-prefix-before-env)' \
388 '$(test-program-prefix-after-env)'; \
389 $(evaluate-test)
390 $(objpfx)tst-ctype.out: tst-ctype.sh $(objpfx)tst-ctype \
391 $(objpfx)sort-test.out \
392 $(addprefix $(objpfx),$(CTYPE_FILES))
393 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
394 '$(run-program-env)' '$(test-program-cmd-after-env)'; \
395 $(evaluate-test)
396 $(objpfx)tst-langinfo-newlocale.out: tst-langinfo.sh \
397 $(objpfx)tst-langinfo-newlocale \
398 $(objpfx)sort-test.out \
399 $(addprefix $(objpfx),$(CTYPE_FILES))
400 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
401 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
402 $(evaluate-test)
403 $(objpfx)tst-langinfo-newlocale-static.out: tst-langinfo.sh \
404 $(objpfx)tst-langinfo-newlocale-static \
405 $(objpfx)sort-test.out \
406 $(addprefix $(objpfx),$(CTYPE_FILES))
407 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
408 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
409 $(evaluate-test)
410 # Static use of newlocale is known not to work. See Bug 23164.
411 test-xfail-tst-langinfo-newlocale-static = yes
413 $(objpfx)tst-langinfo-setlocale.out: tst-langinfo.sh \
414 $(objpfx)tst-langinfo-setlocale \
415 $(objpfx)sort-test.out \
416 $(addprefix $(objpfx),$(CTYPE_FILES))
417 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
418 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
419 $(evaluate-test)
420 $(objpfx)tst-langinfo-setlocale-static.out: tst-langinfo.sh \
421 $(objpfx)tst-langinfo-setlocale-static \
422 $(objpfx)sort-test.out \
423 $(addprefix $(objpfx),$(CTYPE_FILES))
424 $(SHELL) $< $(common-objpfx) '$(test-program-cmd-before-env)' \
425 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@; \
426 $(evaluate-test)
428 $(objpfx)tst-digits.out: $(objpfx)tst-locale.out
429 $(objpfx)tst-mbswcs6.out: $(addprefix $(objpfx),$(CTYPE_FILES))
430 endif
432 include SUPPORTED
434 INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
435 INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
437 # Sometimes the whole collection of locale files should be installed.
438 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
439 $(rtld-prefix) $(common-objpfx)locale/localedef
440 install-locales: install-locale-archive
442 # Create and install the locale-archive file.
443 install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
444 # Create and install the locales individually (no archive).
445 install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
447 install-locales-dir:
448 $(..)./scripts/mkinstalldirs $(inst_complocaledir)
450 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
451 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
452 # See localedata/gen-locale.sh for the same logic.
453 define build-one-locale
454 locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
455 charset=`echo $$locale | sed -e 's,.*/,,'`; \
456 locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
457 if [ "$$charset" = 'SHIFT_JIS' ] \
458 || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
459 flags="$$flags --no-warnings=ascii"; \
460 fi; \
461 echo -n `echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
462 echo -n ".$$charset"; \
463 echo -n `echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
464 echo -n '...'; \
465 input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
466 $(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
467 -i locales/$$input -f charmaps/$$charset \
468 $(addprefix --prefix=,$(install_root)) $$locale \
469 && echo ' done';
470 endef
472 $(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
473 @flags=""; \
474 $(build-one-locale)
476 $(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
477 @flags="--no-archive --no-hard-links"; \
478 $(build-one-locale)
480 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
481 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
483 tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace \
484 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
485 $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
486 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@; \
487 $(evaluate-test)
489 bug-setlocale1-ENV-only = LOCPATH=$(objpfx) LC_CTYPE=de_DE.UTF-8
490 bug-setlocale1-static-ENV-only = $(bug-setlocale1-ENV-only)
492 $(objdir)/iconvdata/gconv-modules:
493 $(MAKE) -C ../iconvdata subdir=iconvdata $@