]>
Commit | Line | Data |
---|---|---|
dff8da6b | 1 | # Copyright (C) 1995-2024 Free Software Foundation, Inc. |
91c7b85d | 2 | # This file is part of the GNU C Library. |
41cfadd6 | 3 | |
91c7b85d | 4 | # The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
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. | |
41cfadd6 | 8 | |
91c7b85d RM |
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 | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
41cfadd6 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
0c5ecdc4 UD |
17 | |
18 | # Makefile for intl subdirectory: message handling code from GNU gettext. | |
41cfadd6 | 19 | |
24906b43 | 20 | subdir = intl |
a5f891ac JM |
21 | |
22 | include ../Makeconfig | |
23 | ||
91c7b85d RM |
24 | headers = libintl.h |
25 | routines = bindtextdom dcgettext dgettext gettext \ | |
abbffdf9 | 26 | dcigettext dcngettext dngettext ngettext \ |
dd9423a6 UD |
27 | finddomain loadmsgcat localealias textdomain |
28 | aux = l10nflist explodename plural plural-exp hash-string | |
9a79284e | 29 | |
2ecc7d93 | 30 | multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6 |
9a79284e | 31 | test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3 |
8406a53a UD |
32 | ifeq ($(have-thread-library),yes) |
33 | test-srcs += $(multithread-test-srcs) | |
34 | endif | |
c52c2c32 FW |
35 | tests = \ |
36 | tst-gettext-c-utf8 \ | |
37 | tst-ngettext \ | |
38 | # tests | |
abbffdf9 | 39 | |
f08e9a26 | 40 | before-compile += $(objpfx)msgs.h |
7a12c6bb | 41 | |
314f6dee | 42 | install-others = $(inst_localedir)/locale.alias |
24906b43 | 43 | |
1faaf703 | 44 | generated += msgs.h mtrace-tst-gettext.out tst-gettext.mtrace plural.c |
f08e9a26 | 45 | generated-dirs += domaindir localedir |
a1d84548 | 46 | |
1faaf703 | 47 | $(objpfx)plural.c: plural.y |
ef9ecfa6 | 48 | $(make-target-directory) |
ae113383 | 49 | $(BISON) $(BISONFLAGS) $@ $^ |
1faaf703 JB |
50 | |
51 | $(objpfx)plural.o: $(objpfx)plural.c | |
abbffdf9 | 52 | |
03ac099f | 53 | ifeq ($(run-built-tests),yes) |
7d4de961 | 54 | ifeq (yes,$(build-shared)) |
328c5f65 | 55 | ifneq ($(strip $(MSGFMT)),:) |
f214606a JM |
56 | tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \ |
57 | $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \ | |
58 | $(objpfx)tst-gettext3.out | |
8406a53a | 59 | ifeq ($(have-thread-library),yes) |
f214606a JM |
60 | tests-special += $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \ |
61 | $(objpfx)tst-gettext6.out | |
8406a53a | 62 | endif |
89e89345 | 63 | ifneq (no,$(PERL)) |
0b20a9e8 | 64 | tests-special += $(objpfx)mtrace-tst-gettext.out |
f214606a JM |
65 | endif |
66 | endif | |
89e89345 | 67 | endif |
d4eaa8bb | 68 | endif |
d1f09384 | 69 | |
f214606a JM |
70 | include ../Rules |
71 | ||
72 | ifeq ($(run-built-tests),yes) | |
73 | ifeq (yes,$(build-shared)) | |
d1f09384 JL |
74 | # Multiple tests use this data. Create it once to avoid racing and |
75 | # spurious test failures. | |
76 | codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo | |
77 | ||
3bd9e993 | 78 | $(codeset_mo): tstcodeset.po |
d1f09384 | 79 | $(make-target-directory) |
3bd9e993 | 80 | msgfmt -o $@T $< |
d1f09384 JL |
81 | mv -f $@T $@ |
82 | ||
0b20a9e8 | 83 | $(objpfx)mtrace-tst-gettext.out: $(objpfx)tst-gettext.out |
f0881698 JM |
84 | $(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@; \ |
85 | $(evaluate-test) | |
4ab8e75a | 86 | $(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext |
8540f6d2 JM |
87 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
88 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
8f8052c2 | 89 | $(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace; \ |
f0881698 | 90 | $(evaluate-test) |
4ab8e75a | 91 | $(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit |
740b3dbe | 92 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
8f8052c2 | 93 | $(common-objpfx)intl/; \ |
f0881698 | 94 | $(evaluate-test) |
cdfb970d | 95 | $(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2 |
8540f6d2 JM |
96 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
97 | '$(run-program-env)' '$(test-program-prefix-after-env)' \ | |
8f8052c2 | 98 | $(common-objpfx)intl/; \ |
f0881698 | 99 | $(evaluate-test) |
8406a53a | 100 | $(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4 |
8f8052c2 | 101 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \ |
f0881698 | 102 | $(evaluate-test) |
2ecc7d93 | 103 | $(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6 |
8f8052c2 | 104 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \ |
f0881698 | 105 | $(evaluate-test) |
d1f09384 JL |
106 | |
107 | $(objpfx)tst-codeset.out: $(codeset_mo) | |
108 | $(objpfx)tst-gettext3.out: $(codeset_mo) | |
109 | $(objpfx)tst-gettext5.out: $(codeset_mo) | |
7d4de961 | 110 | endif |
f881f6ff AS |
111 | |
112 | LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 fr_FR.ISO-8859-1 \ | |
113 | ja_JP.UTF-8 | |
114 | include ../gen-locales.mk | |
115 | ||
116 | $(objpfx)tst-codeset.out: $(gen-locales) | |
117 | $(objpfx)tst-gettext.out: $(gen-locales) | |
118 | $(objpfx)tst-gettext2.out: $(gen-locales) | |
119 | $(objpfx)tst-gettext3.out: $(gen-locales) | |
120 | $(objpfx)tst-gettext4.out: $(gen-locales) | |
121 | $(objpfx)tst-gettext5.out: $(gen-locales) | |
122 | $(objpfx)tst-gettext6.out: $(gen-locales) | |
c52c2c32 | 123 | $(objpfx)tst-gettext-c-utf8.out: $(gen-locales) |
f881f6ff | 124 | $(objpfx)tst-translit.out: $(gen-locales) |
955ebce4 | 125 | endif |
abbffdf9 | 126 | |
56456a2a AJ |
127 | $(objpfx)tst-gettext-de.po: ../po/de.po |
128 | $(make-target-directory) | |
129 | LC_ALL=C $(AWK) '!/^"POT-Creation-Date: [0-9-]+ [0-9:+-]+\\n"$$/' $^ > $@ | |
130 | ||
131 | $(objpfx)msgs.h: po2test.awk $(objpfx)tst-gettext-de.po | |
4974d2b2 | 132 | $(make-target-directory) |
70d35b67 | 133 | LC_ALL=C $(AWK) -f $^ > $@ |
abbffdf9 | 134 | |
36975e8e L |
135 | CFLAGS-tst-gettext.c += -DTESTSTRS_H=\"$(objpfx)msgs.h\" |
136 | CFLAGS-tst-translit.c += -DOBJPFX=\"$(objpfx)\" | |
137 | CFLAGS-tst-gettext2.c += -DOBJPFX=\"$(objpfx)\" | |
138 | CFLAGS-tst-codeset.c += -DOBJPFX=\"$(objpfx)\" | |
139 | CFLAGS-tst-gettext3.c += -DOBJPFX=\"$(objpfx)\" | |
140 | CFLAGS-tst-gettext4.c += -DOBJPFX=\"$(objpfx)\" | |
141 | CFLAGS-tst-gettext5.c += -DOBJPFX=\"$(objpfx)\" | |
142 | CFLAGS-tst-gettext6.c += -DOBJPFX=\"$(objpfx)\" | |
8406a53a UD |
143 | |
144 | ifeq ($(have-thread-library),yes) | |
145 | ifeq (yes,$(build-shared)) | |
146 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(shared-thread-library) | |
147 | else | |
148 | $(addprefix $(objpfx),$(multithread-test-srcs)): $(static-thread-library) | |
149 | endif | |
8406a53a | 150 | endif |
abbffdf9 | 151 | |
c6df09ad | 152 | $(objpfx)tst-translit.out: $(objpfx)tst-gettext.out |
8f13e320 UD |
153 | $(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out |
154 | $(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out | |
9a79284e | 155 | $(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out |
8406a53a UD |
156 | $(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out |
157 | $(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out | |
2ecc7d93 | 158 | $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out |
c6df09ad | 159 | |
314f6dee | 160 | CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \ |
6ee5a976 AZ |
161 | -D'LOCALE_ALIAS_PATH="$(localedir)"' \ |
162 | -Wno-unused-but-set-variable | |
f8392bb7 | 163 | BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output |
7a12c6bb | 164 | |
314f6dee | 165 | $(inst_localedir)/locale.alias: locale.alias $(+force) |
7a12c6bb | 166 | $(do-install) |