xref: /aoo42x/main/i18npool/Library_i18npool.mk (revision 52d905a6)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24$(eval $(call gb_Library_Library,i18npool))
25
26$(eval $(call gb_Library_add_package_headers,i18npool,i18npool_inc))
27
28$(eval $(call gb_Library_add_precompiled_header,i18npool,$(SRCDIR)/i18npool/inc/pch/precompiled_i18npool))
29
30$(eval $(call gb_Library_set_componentfile,i18npool,i18npool/util/i18npool))
31
32$(eval $(call gb_Library_set_include,i18npool,\
33	$$(INCLUDE) \
34	-I$(SRCDIR)/i18npool/inc \
35	-I$(SRCDIR)/i18npool/inc/pch \
36	-I$(WORKDIR)/CustomTarget/i18npool/source/collator \
37	-I$(OUTDIR)/inc \
38))
39
40$(eval $(call gb_Library_add_api,i18npool, \
41	offapi \
42	udkapi \
43))
44
45$(eval $(call gb_Library_add_defs,i18npool,\
46	-DI18NPOOL_DLLIMPLEMENTATION \
47))
48
49$(eval $(call gb_Library_add_linked_libs,i18npool,\
50	comphelper \
51	cppu \
52	cppuhelper \
53	i18nisolang1 \
54	i18nutil \
55	sal \
56	stl \
57	$(gb_STDLIBS) \
58))
59
60$(call gb_Library_use_external,i18npool,icui18n)
61$(call gb_Library_use_external,i18npool,icudata)
62$(call gb_Library_use_external,i18npool,icuuc)
63
64$(eval $(call gb_Library_add_exception_objects,i18npool,\
65	i18npool/source/registerservices/registerservices \
66	i18npool/source/breakiterator/breakiteratorImpl \
67	i18npool/source/breakiterator/breakiterator_cjk \
68	i18npool/source/breakiterator/breakiterator_ctl \
69	i18npool/source/breakiterator/breakiterator_th \
70	i18npool/source/breakiterator/breakiterator_unicode \
71	i18npool/source/breakiterator/xdictionary \
72	i18npool/source/characterclassification/characterclassificationImpl \
73	i18npool/source/characterclassification/cclass_unicode \
74	i18npool/source/characterclassification/cclass_unicode_parser \
75	i18npool/source/characterclassification/scripttypedetector \
76	i18npool/source/transliteration/transliteration_body \
77	i18npool/source/transliteration/transliteration_caseignore \
78	i18npool/source/transliteration/transliterationImpl \
79	i18npool/source/transliteration/transliteration_commonclass \
80	i18npool/source/transliteration/transliteration_OneToOne \
81	i18npool/source/transliteration/transliteration_Ignore \
82	i18npool/source/transliteration/transliteration_Numeric \
83	i18npool/source/transliteration/hiraganaToKatakana \
84	i18npool/source/transliteration/katakanaToHiragana \
85	i18npool/source/transliteration/ignoreKana \
86	i18npool/source/transliteration/halfwidthToFullwidth \
87	i18npool/source/transliteration/fullwidthToHalfwidth \
88	i18npool/source/transliteration/ignoreWidth \
89	i18npool/source/transliteration/smallToLarge_ja_JP \
90	i18npool/source/transliteration/largeToSmall_ja_JP \
91	i18npool/source/transliteration/ignoreSize_ja_JP \
92	i18npool/source/transliteration/ignoreMinusSign_ja_JP \
93	i18npool/source/transliteration/ignoreIterationMark_ja_JP \
94	i18npool/source/transliteration/ignoreTraditionalKana_ja_JP \
95	i18npool/source/transliteration/ignoreTraditionalKanji_ja_JP \
96	i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP \
97	i18npool/source/transliteration/ignoreZiZu_ja_JP \
98	i18npool/source/transliteration/ignoreBaFa_ja_JP \
99	i18npool/source/transliteration/ignoreTiJi_ja_JP \
100	i18npool/source/transliteration/ignoreHyuByu_ja_JP \
101	i18npool/source/transliteration/ignoreSeZe_ja_JP \
102	i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP \
103	i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP \
104	i18npool/source/transliteration/ignoreSeparator_ja_JP \
105	i18npool/source/transliteration/ignoreSpace_ja_JP \
106	i18npool/source/transliteration/ignoreMiddleDot_ja_JP \
107	i18npool/source/transliteration/textToPronounce_zh \
108	i18npool/source/transliteration/numtochar \
109	i18npool/source/transliteration/numtotext_cjk \
110	i18npool/source/transliteration/chartonum \
111	i18npool/source/transliteration/texttonum \
112	i18npool/source/calendar/calendarImpl \
113	i18npool/source/calendar/calendar_gregorian \
114	i18npool/source/calendar/calendar_hijri \
115	i18npool/source/calendar/calendar_jewish \
116	i18npool/source/numberformatcode/numberformatcode \
117	i18npool/source/defaultnumberingprovider/defaultnumberingprovider \
118	i18npool/source/nativenumber/nativenumbersupplier \
119	i18npool/source/inputchecker/inputsequencechecker \
120	i18npool/source/inputchecker/inputsequencechecker_th \
121	i18npool/source/inputchecker/inputsequencechecker_hi \
122	i18npool/source/ordinalsuffix/ordinalsuffix \
123	i18npool/source/localedata/localedata \
124	i18npool/source/indexentry/indexentrysupplier \
125	i18npool/source/indexentry/indexentrysupplier_asian \
126	i18npool/source/indexentry/indexentrysupplier_ja_phonetic \
127	i18npool/source/indexentry/indexentrysupplier_default \
128	i18npool/source/indexentry/indexentrysupplier_common \
129	i18npool/source/textconversion/textconversionImpl \
130	i18npool/source/textconversion/textconversion \
131	i18npool/source/textconversion/textconversion_ko \
132	i18npool/source/textconversion/textconversion_zh \
133	i18npool/source/collator/collatorImpl \
134	i18npool/source/collator/chaptercollator \
135	i18npool/source/collator/collator_unicode \
136))
137
138$(call gb_Library_get_headers_target,i18npool) : $(WORKDIR)/CustomTarget/i18npool/source/collator/lrl_include.hxx
139
140$(WORKDIR)/CustomTarget/i18npool/source/collator/lrl_include.hxx : $(wildcard $(SRCDIR)/i18npool/source/collator/data/*.txt)
141	mkdir -p $(dir $@) \
142	&& LOCAL_RULE_LANGS="$(sort $(foreach txt,$(wildcard $(SRCDIR)/i18npool/source/collator/data/*.txt),$(firstword $(subst _, ,$(notdir $(txt))))))" \
143	&& echo \#define LOCAL_RULE_LANGS \"$${LOCAL_RULE_LANGS}\" > $@
144
145
146# fdo#31271 ")" reclassified in more recent ICU/Unicode Standards
147include $(OUTDIR)/inc/icuversion.mk
148ICU_RECLASSIFIED_BRACKET := $(shell [ ${ICU_MAJOR} -ge 5 -o \( ${ICU_MAJOR} -eq 4 -a ${ICU_MINOR} -ge 4 \) ] && echo YES)
149
150
151$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%.txt : $(SRCDIR)/i18npool/source/breakiterator/data/%.txt
152ifeq ($(ICU_RECLASSIFIED_BRACKET),YES)
153	mkdir -p $(dir $@) && \
154	sed "s#\[:LineBreak =  Close_Punctuation:\]#\[\[:LineBreak =  Close_Punctuation:\] \[:LineBreak = Close_Parenthesis:\]\]#" $< > $@
155else
156	mkdir -p $(dir $@) && \
157	cp $< $@
158endif
159
160
161ifeq ($(SYSTEM_ICU),YES)
162GENCMN := $(SYSTEM_GENCMN)
163GENBRK := $(SYSTEM_GENBRK)
164GENCCODE := $(SYSTEM_GENCCODE)
165else
166GENCMN := $(gb_Augment_Library_Path) $(OUTDIR)/bin/gencmn$(gb_Executable_EXT)
167GENBRK := $(gb_Augment_Library_Path) $(OUTDIR)/bin/genbrk$(gb_Executable_EXT)
168GENCCODE := $(gb_Augment_Library_Path) $(OUTDIR)/bin/genccode$(gb_Executable_EXT)
169$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%.brk : $(OUTDIR)/bin/genbrk$(gb_Executable_EXT)
170$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%_brk.c: $(OUTDIR)/bin/genccode$(gb_Executable_EXT)
171$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/OpenOffice_dat.c : $(OUTDIR)/bin/gencmn$(gb_Executable_EXT)
172endif
173
174$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%.brk : $(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%.txt
175	$(GENBRK) -r $(call gb_Helper_convert_native,$<) -o $(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/$*.brk)
176
177$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%_brk.c : $(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/%.brk
178	$(GENCCODE) -n OpenOffice -d $(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data) $(call gb_Helper_convert_native,$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/$*.brk)
179
180# 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules.
181# The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools,
182# so the output (OpenOffice_icu_dat.c) is changed here to include a pragma to disable the warnings.
183# Output of gencmn is redirected to OpenOffice_icu_tmp.c with the -t switch.
184$(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/OpenOffice_dat.c : $(wildcard $(SRCDIR)/i18npool/source/breakiterator/data/*.txt)
185	RESPONSEFILE=$(call var2filecr,$(shell $(gb_MKTEMP)),1,$(foreach txt,$(wildcard $(SRCDIR)/i18npool/source/breakiterator/data/*.txt),$(notdir $(basename $(txt))).brk)) \
186	&& cat $${RESPONSEFILE} \
187	&& $(GENCMN) -n OpenOffice -t tmp -S -d $(call gb_Helper_convert_native,$(dir $@)) O $(call gb_Helper_convert_native,$${RESPONSEFILE}) \
188	&& echo "#ifdef _MSC_VER" > $@ \
189	&& echo "#pragma warning( disable : 4229 4668 )" >> $@ \
190	&& echo "#endif" >> $@ \
191	&& cat $(WORKDIR)/CustomTarget/i18npool/source/breakiterator/data/OpenOffice_tmp.c >> $@ \
192	&& rm -f $${RESPONSEFILE}
193
194#$(eval $(call gb_Library_add_generated_cobjects,i18npool,\
195#	$(foreach txt,$(wildcard $(SRCDIR)/i18npool/source/breakiterator/data/*.txt),CustomTarget/i18npool/source/breakiterator/data/$(notdir $(basename $(txt)))_brk) \
196#))
197
198$(foreach txt,$(wildcard $(SRCDIR)/i18npool/source/breakiterator/data/*.txt),$(eval $(call gb_Library_add_generated_cobject,i18npool,CustomTarget/i18npool/source/breakiterator/data/$(notdir $(basename $(txt)))_brk)))
199
200$(eval $(call gb_Library_add_generated_cobject,i18npool,CustomTarget/i18npool/source/breakiterator/data/OpenOffice_dat))
201
202# vim: set noet sw=4 ts=4:
203
204