| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
subdir := locale |
| 22 |
|
| 23 |
include ../Makeconfig |
| 24 |
|
| 25 |
headers = \ |
| 26 |
bits/locale.h \ |
| 27 |
bits/types/__locale_t.h \ |
| 28 |
bits/types/locale_t.h \ |
| 29 |
langinfo.h \ |
| 30 |
locale.h \ |
| 31 |
# headers |
| 32 |
routines = \ |
| 33 |
duplocale \ |
| 34 |
findlocale \ |
| 35 |
freelocale \ |
| 36 |
loadarchive \ |
| 37 |
loadlocale \ |
| 38 |
localeconv \ |
| 39 |
mb_cur_max \ |
| 40 |
newlocale \ |
| 41 |
nl_langinfo \ |
| 42 |
nl_langinfo_l \ |
| 43 |
setlocale \ |
| 44 |
uselocale |
| 45 |
|
| 46 |
tests = \ |
| 47 |
tst-C-locale \ |
| 48 |
tst-duplocale \ |
| 49 |
tst-locname \ |
| 50 |
# tests |
| 51 |
tests-container = \ |
| 52 |
tst-localedef-path-norm \ |
| 53 |
# tests-container |
| 54 |
categories = \ |
| 55 |
address \ |
| 56 |
collate \ |
| 57 |
ctype \ |
| 58 |
identification \ |
| 59 |
measurement \ |
| 60 |
messages \ |
| 61 |
monetary \ |
| 62 |
name \ |
| 63 |
numeric \ |
| 64 |
paper \ |
| 65 |
telephone \ |
| 66 |
time \ |
| 67 |
# categories |
| 68 |
aux = \ |
| 69 |
$(categories:%=C-%) \ |
| 70 |
$(categories:%=lc-%) \ |
| 71 |
C_name \ |
| 72 |
SYS_libc \ |
| 73 |
coll-lookup \ |
| 74 |
global-locale \ |
| 75 |
localename \ |
| 76 |
xlocale \ |
| 77 |
# aux |
| 78 |
others = \ |
| 79 |
locale \ |
| 80 |
localedef \ |
| 81 |
# others |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
install-bin = \ |
| 87 |
locale \ |
| 88 |
localedef \ |
| 89 |
# install-bin |
| 90 |
extra-objs = \ |
| 91 |
$(lib-modules:=.o) \ |
| 92 |
$(locale-modules:=.o) \ |
| 93 |
$(localedef-aux:=.o) \ |
| 94 |
$(localedef-modules:=.o) \ |
| 95 |
# extra-objs |
| 96 |
generated += C-translit.h |
| 97 |
before-compile += $(objpfx)C-translit.h |
| 98 |
|
| 99 |
extra-libs = libBrokenLocale |
| 100 |
extra-libs-others = $(extra-libs) |
| 101 |
|
| 102 |
libBrokenLocale-routines = broken_cur_max |
| 103 |
|
| 104 |
subdir-dirs = programs |
| 105 |
vpath %.c programs |
| 106 |
vpath %.h programs |
| 107 |
vpath %.gperf programs |
| 108 |
|
| 109 |
localedef-modules := \ |
| 110 |
charmap \ |
| 111 |
linereader \ |
| 112 |
localedef $(categories:%=ld-%) \ |
| 113 |
locarchive \ |
| 114 |
locfile \ |
| 115 |
repertoire \ |
| 116 |
# localedef-modules |
| 117 |
localedef-aux := md5 |
| 118 |
locale-modules := \ |
| 119 |
locale \ |
| 120 |
locale-spec \ |
| 121 |
# locale-modules |
| 122 |
lib-modules := \ |
| 123 |
charmap-dir \ |
| 124 |
record-status \ |
| 125 |
simple-hash \ |
| 126 |
xasprintf \ |
| 127 |
xmalloc \ |
| 128 |
xstrdup \ |
| 129 |
# lib-modules |
| 130 |
|
| 131 |
GPERF = gperf |
| 132 |
GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C |
| 133 |
|
| 134 |
ifeq ($(run-built-tests),yes) |
| 135 |
tests-special += $(objpfx)tst-locale-locpath.out |
| 136 |
endif |
| 137 |
|
| 138 |
include ../Rules |
| 139 |
|
| 140 |
programs/%-kw.h: programs/%-kw.gperf |
| 141 |
cd programs \ |
| 142 |
&& $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new |
| 143 |
mv -f [email protected] $@ |
| 144 |
|
| 145 |
$(objpfx)localedef: $(localedef-modules:%=$(objpfx)%.o) |
| 146 |
$(objpfx)localedef: $(localedef-aux:%=$(objpfx)%.o) |
| 147 |
$(objpfx)locale: $(locale-modules:%=$(objpfx)%.o) |
| 148 |
$(objpfx)localedef $(objpfx)locale: $(lib-modules:%=$(objpfx)%.o) |
| 149 |
|
| 150 |
$(objpfx)C-translit.h: C-translit.h.in gen-translit.py |
| 151 |
$(make-target-directory) |
| 152 |
$(PYTHON) gen-translit.py < $< > [email protected] |
| 153 |
mv -f [email protected] $@ |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
localepath = "$(complocaledir):$(i18ndir)" |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \ |
| 164 |
-DLOCALE_ALIAS_PATH='"$(localedir)"' \ |
| 165 |
-Iprograms |
| 166 |
|
| 167 |
CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \ |
| 168 |
-DCHARMAP_PATH='"$(i18ndir)/charmaps"' \ |
| 169 |
-DREPERTOIREMAP_PATH='"$(i18ndir)/repertoiremaps"' \ |
| 170 |
-DLOCSRCDIR='"$(i18ndir)/locales"' |
| 171 |
|
| 172 |
CFLAGS-charmap.c += -Wno-write-strings -Wno-char-subscripts |
| 173 |
CFLAGS-locfile.c += -Wno-write-strings -Wno-char-subscripts |
| 174 |
CFLAGS-charmap-dir.c += -Wno-write-strings |
| 175 |
|
| 176 |
|
| 177 |
cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \ |
| 178 |
$(lib-modules) |
| 179 |
lib := locale-programs |
| 180 |
include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) |
| 181 |
|
| 182 |
$(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale |
| 183 |
$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \ |
| 184 |
'$(run-program-env)' '$(rpath-link)' > $@; \ |
| 185 |
$(evaluate-test) |
| 186 |
|
| 187 |
$(objpfx)tst-localedef-path-norm: $(shared-thread-library) |