1 # Copyright (C) 1996-2019 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.
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
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 \
40 # List of test input files (list sorted alphabetically):
71 gez_ER.UTF-8@abegede \
112 tt_RU.UTF-8@iqtelif \
122 test-input-data
= $(addsuffix .in
, $(test-input
))
123 test-output
:= $(foreach s
, .out .xout
, \
124 $(addsuffix $s, $(basename $(test-input
))))
125 ld-test-names
:= test1 test2 test3 test4 test5 test6 test7
126 ld-test-srcs
:= $(addprefix tests
/,$(addsuffix .cm
,$(ld-test-names
)) \
127 $(addsuffix .def
,$(ld-test-names
)) \
128 $(addsuffix .ds
,test5 test6
) \
131 fmon-tests
= n01y12 n02n40 n10y31 n11y41 n12y11 n20n32 n30y20 n41n00 \
132 y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21
134 generated
+= $(test-input
) $(test-output
) sort-test.out tst-locale.out \
135 tst-leaks.mtrace mtrace-tst-leaks.out
136 generated-dirs
+= $(ld-test-names
) tt_TT de_DE
.437 \
137 $(addprefix tstfmon_
,$(fmon-tests
)) \
139 ifeq ($(run-built-tests
),yes
)
140 locale_test_suite
:= tst_iswalnum tst_iswalpha tst_iswcntrl \
141 tst_iswctype tst_iswdigit tst_iswgraph \
142 tst_iswlower tst_iswprint tst_iswpunct \
143 tst_iswspace tst_iswupper tst_iswxdigit tst_mblen \
144 tst_mbrlen tst_mbrtowc tst_mbsrtowcs tst_mbstowcs \
145 tst_mbtowc tst_strcoll tst_strfmon tst_strxfrm \
146 tst_swscanf tst_towctrans tst_towlower \
147 tst_towupper tst_wcrtomb tst_wcscat tst_wcschr \
148 tst_wcscmp tst_wcscoll tst_wcscpy tst_wcscspn \
149 tst_wcslen tst_wcsncat tst_wcsncmp tst_wcsncpy \
150 tst_wcspbrk tst_wcsrtombs tst_wcsspn tst_wcsstr \
151 tst_wcstod tst_wcstok tst_wcstombs tst_wcswidth \
152 tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
153 tst_wctype tst_wcwidth
155 tests
= $(locale_test_suite
) tst-digits tst-setlocale bug-iconv-trans \
156 tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
157 tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
158 tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \
159 tst-wctype tst-iconv-math-trans
160 tests-static
= bug-setlocale1-static
161 tests
+= $(tests-static
)
162 ifeq (yes
,$(build-shared
))
164 tests-special
+= $(objpfx
)mtrace-tst-leaks.out
170 ifeq ($(INSTALL_UNCOMPRESSED
),yes
)
171 # This option is for testing inside the testroot container, as the
172 # container does not include a working gunzip program.
173 install-others
:= $(addprefix $(inst_i18ndir
)/, \
177 install-others
:= $(addprefix $(inst_i18ndir
)/, \
178 $(addsuffix .gz
, $(charmaps
)) \
182 tests
: $(objdir
)/iconvdata
/gconv-modules
184 tests-static
+= tst-langinfo-newlocale-static tst-langinfo-setlocale-static
186 ifeq ($(run-built-tests
),yes
)
187 tests-special
+= $(objpfx
)sort-test.out
$(objpfx
)tst-fmon.out \
188 $(objpfx
)tst-locale.out
$(objpfx
)tst-rpmatch.out \
189 $(objpfx
)tst-trans.out
$(objpfx
)tst-ctype.out \
190 $(objpfx
)tst-langinfo-newlocale.out \
191 $(objpfx
)tst-langinfo-setlocale.out \
192 $(objpfx
)tst-langinfo-newlocale-static.out \
193 $(objpfx
)tst-langinfo-setlocale-static.out \
194 $(objpfx
)tst-numeric.out
195 # We have to generate locales (list sorted alphabetically)
217 en_US.ANSI_X3.4
-1968 \
230 gez_ER.UTF-8@abegede \
278 tt_RU.UTF-8@iqtelif \
289 include ..
/gen-locales.mk
291 $(objpfx
)tst-iconv-math-trans.out
: $(gen-locales
)
296 ifeq ($(INSTALL_UNCOMPRESSED
),yes
)
297 # Install the charmap files as-is. This option is for testing inside
298 # the testroot container, as the container does not include a working
300 $(inst_i18ndir
)/charmaps
/%: charmaps
/% $(+force)
301 $(make-target-directory
)
303 $(INSTALL_DATA
) $< $@
305 # Install the charmap files in gzipped format.
306 $(inst_i18ndir
)/charmaps
/%.gz
: charmaps
/% $(+force)
307 $(make-target-directory
)
309 $(INSTALL_DATA
) $< $(@
:.gz
=)
313 # Install the locale source files in the appropriate directory.
314 $(inst_i18ndir
)/locales
/%: locales
/% $(+force); $(do-install
)
316 ifeq ($(run-built-tests
),yes
)
317 generated-dirs
+= $(LOCALES
)
319 $(addsuffix .out
,$(addprefix $(objpfx
),$(tests
))): %: \
320 $(addprefix $(objpfx
),$(CTYPE_FILES
))
322 $(objpfx
)sort-test.out
: sort-test.sh
$(objpfx
)collate-test
$(objpfx
)xfrm-test \
323 $(test-input-data
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
324 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix-before-env)' \
325 '$(run-program-env)' '$(test-program-prefix-after-env)' \
329 $(objpfx
)tst-fmon.out
: tst-fmon.sh
$(objpfx
)tst-fmon tst-fmon.data \
330 $(objpfx
)sort-test.out \
331 $(addprefix $(objpfx
),$(CTYPE_FILES
))
332 $(SHELL
) $< $(common-objpfx
) '$(run-program-prefix-before-env)' \
333 '$(run-program-env)' '$(run-program-prefix-after-env)' \
334 '$(test-program-prefix)' tst-fmon.data \
337 $(objpfx
)tst-numeric.out
: tst-numeric.sh
$(objpfx
)tst-numeric tst-numeric.data \
338 $(objpfx
)sort-test.out \
339 $(addprefix $(objpfx
),$(CTYPE_FILES
))
340 $(SHELL
) $< $(common-objpfx
) '$(test-program-prefix)' tst-numeric.data \
343 $(objpfx
)tst-locale.out
: tst-locale.sh
$(common-objpfx
)locale
/localedef \
344 $(ld-test-srcs
) $(addprefix $(objpfx
),$(CTYPE_FILES
))
345 $(SHELL
) $< $(common-objpfx
) '$(built-program-cmd-before-env)' \
346 '$(run-program-env)' '$(built-program-cmd-after-env)' > $@
; \
348 $(objpfx
)tst-rpmatch.out
: tst-rpmatch.sh
$(objpfx
)tst-rpmatch \
349 $(objpfx
)tst-fmon.out \
350 $(addprefix $(objpfx
),$(CTYPE_FILES
))
351 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd)' > $@
; \
353 $(objpfx
)tst-trans.out
: tst-trans.sh
$(objpfx
)tst-trans \
354 $(addprefix $(objpfx
),$(CTYPE_FILES
))
355 $(SHELL
) $< $(common-objpfx
) '$(run-program-prefix-before-env)' \
356 '$(run-program-env)' '$(run-program-prefix-after-env)' \
357 '$(test-program-prefix-before-env)' \
358 '$(test-program-prefix-after-env)' > $@
; \
360 $(objpfx
)tst-ctype.out
: tst-ctype.sh
$(objpfx
)tst-ctype \
361 $(objpfx
)sort-test.out \
362 $(addprefix $(objpfx
),$(CTYPE_FILES
))
363 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
364 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
366 $(objpfx
)tst-langinfo-newlocale.out
: tst-langinfo.sh \
367 $(objpfx
)tst-langinfo-newlocale \
368 $(objpfx
)sort-test.out \
369 $(addprefix $(objpfx
),$(CTYPE_FILES
))
370 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
371 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
373 $(objpfx
)tst-langinfo-newlocale-static.out
: tst-langinfo.sh \
374 $(objpfx
)tst-langinfo-newlocale-static \
375 $(objpfx
)sort-test.out \
376 $(addprefix $(objpfx
),$(CTYPE_FILES
))
377 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
378 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
380 # Static use of newlocale is known not to work. See Bug 23164.
381 test-xfail-tst-langinfo-newlocale-static
= yes
383 $(objpfx
)tst-langinfo-setlocale.out
: tst-langinfo.sh \
384 $(objpfx
)tst-langinfo-setlocale \
385 $(objpfx
)sort-test.out \
386 $(addprefix $(objpfx
),$(CTYPE_FILES
))
387 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
388 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
390 $(objpfx
)tst-langinfo-setlocale-static.out
: tst-langinfo.sh \
391 $(objpfx
)tst-langinfo-setlocale-static \
392 $(objpfx
)sort-test.out \
393 $(addprefix $(objpfx
),$(CTYPE_FILES
))
394 $(SHELL
) $< $(common-objpfx
) '$(test-program-cmd-before-env)' \
395 '$(run-program-env)' '$(test-program-cmd-after-env)' > $@
; \
398 $(objpfx
)tst-digits.out
: $(objpfx
)tst-locale.out
399 $(objpfx
)tst-mbswcs6.out
: $(addprefix $(objpfx
),$(CTYPE_FILES
))
404 INSTALL-SUPPORTED-LOCALE-ARCHIVE
=$(addprefix install-archive-
, $(SUPPORTED-LOCALES
))
405 INSTALL-SUPPORTED-LOCALE-FILES
=$(addprefix install-files-
, $(SUPPORTED-LOCALES
))
407 # Sometimes the whole collection of locale files should be installed.
408 LOCALEDEF
=I18NPATH
=. GCONV_PATH
=$(common-objpfx
)iconvdata LC_ALL
=C \
409 $(rtld-prefix
) $(common-objpfx
)locale
/localedef
410 install-locales
: install-locale-archive
412 # Create and install the locale-archive file.
413 install-locale-archive
: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE
)
414 # Create and install the locales individually (no archive).
415 install-locale-files
: $(INSTALL-SUPPORTED-LOCALE-FILES
)
418 $(..
).
/scripts
/mkinstalldirs
$(inst_complocaledir
)
420 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
421 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
422 # See localedata/gen-locale.sh for the same logic.
423 define build-one-locale
424 locale
=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
425 charset
=`echo $$locale | sed -e 's,.*/,,'`; \
426 locale
=`echo $$locale | sed -e 's,/[^/]*,,'`; \
427 if
[ "$$charset" = 'SHIFT_JIS' ] \
428 ||
[ "$$charset" = 'SHIFT_JISX0213' ]; then \
429 flags
="$$flags --no-warnings=ascii"; \
431 echo
-n
`echo $$locale | sed 's/\([^.\@]*\).*/\1/'`; \
432 echo
-n
".$$charset"; \
433 echo
-n
`echo $$locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
435 input
=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
436 $(LOCALEDEF
) $$flags --alias-file
=..
/intl
/locale.alias \
437 -i locales
/$$input -f charmaps
/$$charset \
438 $(addprefix --prefix=,$(install_root
)) $$locale \
442 $(INSTALL-SUPPORTED-LOCALE-ARCHIVE
): install-locales-dir
446 $(INSTALL-SUPPORTED-LOCALE-FILES
): install-locales-dir
447 @flags
="-c --no-archive --no-hard-links"; \
450 tst-setlocale-ENV
= LC_ALL
=ja_JP.EUC-JP
451 tst-wctype-ENV
= LC_ALL
=ja_JP.EUC-JP
453 tst-leaks-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks.mtrace
454 $(objpfx
)mtrace-tst-leaks.out
: $(objpfx
)tst-leaks.out
455 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks.mtrace
> $@
; \
458 bug-setlocale1-ENV-only
= LOCPATH
=$(objpfx
) LC_CTYPE
=de_DE.UTF-8
459 bug-setlocale1-static-ENV-only
= $(bug-setlocale1-ENV-only
)
461 $(objdir
)/iconvdata
/gconv-modules
:
462 $(MAKE
) -C ..
/iconvdata subdir
=iconvdata
$@