| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
subdir = intl |
| 21 |
|
| 22 |
include ../Makeconfig |
| 23 |
|
| 24 |
headers = libintl.h |
| 25 |
routines = bindtextdom dcgettext dgettext gettext \ |
| 26 |
dcigettext dcngettext dngettext ngettext \ |
| 27 |
finddomain loadmsgcat localealias textdomain |
| 28 |
aux = l10nflist explodename plural plural-exp hash-string |
| 29 |
|
| 30 |
multithread-test-srcs := tst-gettext4 tst-gettext5 tst-gettext6 |
| 31 |
test-srcs := tst-gettext tst-translit tst-gettext2 tst-codeset tst-gettext3 |
| 32 |
ifeq ($(have-thread-library),yes) |
| 33 |
test-srcs += $(multithread-test-srcs) |
| 34 |
endif |
| 35 |
tests = \ |
| 36 |
tst-gettext-c-utf8 \ |
| 37 |
tst-ngettext \ |
| 38 |
# tests |
| 39 |
|
| 40 |
before-compile += $(objpfx)msgs.h |
| 41 |
|
| 42 |
install-others = $(inst_localedir)/locale.alias |
| 43 |
|
| 44 |
generated += msgs.h mtrace-tst-gettext.out tst-gettext.mtrace plural.c |
| 45 |
generated-dirs += domaindir localedir |
| 46 |
|
| 47 |
$(objpfx)plural.c: plural.y |
| 48 |
$(make-target-directory) |
| 49 |
$(BISON) $(BISONFLAGS) $@ $^ |
| 50 |
|
| 51 |
$(objpfx)plural.o: $(objpfx)plural.c |
| 52 |
|
| 53 |
ifeq ($(run-built-tests),yes) |
| 54 |
ifeq (yes,$(build-shared)) |
| 55 |
ifneq ($(strip $(MSGFMT)),:) |
| 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 |
| 59 |
ifeq ($(have-thread-library),yes) |
| 60 |
tests-special += $(objpfx)tst-gettext4.out $(objpfx)tst-gettext5.out \ |
| 61 |
$(objpfx)tst-gettext6.out |
| 62 |
endif |
| 63 |
ifneq (no,$(PERL)) |
| 64 |
tests-special += $(objpfx)mtrace-tst-gettext.out |
| 65 |
endif |
| 66 |
endif |
| 67 |
endif |
| 68 |
endif |
| 69 |
|
| 70 |
include ../Rules |
| 71 |
|
| 72 |
ifeq ($(run-built-tests),yes) |
| 73 |
ifeq (yes,$(build-shared)) |
| 74 |
|
| 75 |
|
| 76 |
codeset_mo = $(objpfx)domaindir/de_DE/LC_MESSAGES/codeset.mo |
| 77 |
|
| 78 |
$(codeset_mo): tstcodeset.po |
| 79 |
$(make-target-directory) |
| 80 |
msgfmt -o $@T $< |
| 81 |
mv -f $@T $@ |
| 82 |
|
| 83 |
$(objpfx)mtrace-tst-gettext.out: $(objpfx)tst-gettext.out |
| 84 |
$(common-objpfx)malloc/mtrace $(objpfx)tst-gettext.mtrace > $@; \ |
| 85 |
$(evaluate-test) |
| 86 |
$(objpfx)tst-gettext.out: tst-gettext.sh $(objpfx)tst-gettext |
| 87 |
$(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
| 88 |
'$(run-program-env)' '$(test-program-prefix-after-env)' \ |
| 89 |
$(common-objpfx)intl/ $(objpfx)tst-gettext.mtrace; \ |
| 90 |
$(evaluate-test) |
| 91 |
$(objpfx)tst-translit.out: tst-translit.sh $(objpfx)tst-translit |
| 92 |
$(SHELL) $< $(common-objpfx) '$(test-program-prefix)' \ |
| 93 |
$(common-objpfx)intl/; \ |
| 94 |
$(evaluate-test) |
| 95 |
$(objpfx)tst-gettext2.out: tst-gettext2.sh $(objpfx)tst-gettext2 |
| 96 |
$(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
| 97 |
'$(run-program-env)' '$(test-program-prefix-after-env)' \ |
| 98 |
$(common-objpfx)intl/; \ |
| 99 |
$(evaluate-test) |
| 100 |
$(objpfx)tst-gettext4.out: tst-gettext4.sh $(objpfx)tst-gettext4 |
| 101 |
$(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \ |
| 102 |
$(evaluate-test) |
| 103 |
$(objpfx)tst-gettext6.out: tst-gettext6.sh $(objpfx)tst-gettext6 |
| 104 |
$(SHELL) $< $(common-objpfx) '$(test-program-prefix)' $(common-objpfx)intl/; \ |
| 105 |
$(evaluate-test) |
| 106 |
|
| 107 |
$(objpfx)tst-codeset.out: $(codeset_mo) |
| 108 |
$(objpfx)tst-gettext3.out: $(codeset_mo) |
| 109 |
$(objpfx)tst-gettext5.out: $(codeset_mo) |
| 110 |
endif |
| 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) |
| 123 |
$(objpfx)tst-gettext-c-utf8.out: $(gen-locales) |
| 124 |
$(objpfx)tst-translit.out: $(gen-locales) |
| 125 |
endif |
| 126 |
|
| 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 |
| 132 |
$(make-target-directory) |
| 133 |
LC_ALL=C $(AWK) -f $^ > $@ |
| 134 |
|
| 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)\" |
| 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 |
| 150 |
endif |
| 151 |
|
| 152 |
$(objpfx)tst-translit.out: $(objpfx)tst-gettext.out |
| 153 |
$(objpfx)tst-gettext2.out: $(objpfx)tst-gettext.out |
| 154 |
$(objpfx)tst-codeset.out: $(objpfx)tst-gettext.out |
| 155 |
$(objpfx)tst-gettext3.out: $(objpfx)tst-gettext.out |
| 156 |
$(objpfx)tst-gettext4.out: $(objpfx)tst-gettext.out |
| 157 |
$(objpfx)tst-gettext5.out: $(objpfx)tst-gettext.out |
| 158 |
$(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out |
| 159 |
|
| 160 |
CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \ |
| 161 |
-D'LOCALE_ALIAS_PATH="$(localedir)"' \ |
| 162 |
-Wno-unused-but-set-variable \ |
| 163 |
-Wno-implicit-fallthrough |
| 164 |
BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output |
| 165 |
|
| 166 |
$(inst_localedir)/locale.alias: locale.alias $(+force) |
| 167 |
$(do-install) |