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