summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-12-29 11:42:30 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-12-01 18:37:23 +0100
commited583bf8d553b145f83b66118253aaf7ac94fa1a (patch)
treee63a852a9f57505ad564e07ec4baf46d3d1307b0 /i18npool
parentb9c106d491d2c13d74760a47e424192a3291860a (diff)
gbuild: introduce plugin + loader concepts
This introduces two concepts: a plugin and its loader (library) LO currrently has dependency cycles for some libraries. There is scui, which depends on sc, while sc dlopen's scui. There are the various vclplug_*, i18npool plugins, filters/gie, acc, etc. Usually these plugins link to their loader library, because they use its symbols. But as a result there is no sensible way to express the runtime dependency of loaders on the plugins. In GNU libtool plugins are called modules and they are implemented in an IMHO more sensible way by allowing missing symbols at link time. This way you can have a dependency from the loader library to its plugins, as the plugins don't depend on the loader, but you lose the link time detection of missing symbols. While this is in theory possible in LO too, LO currently has plugins, like acc (accessibility), loaded by tk (toolkit), which depends on svt (svtools), which itself depends on tk, so dropping the tk dependency for acc on its own doesn't help :-( And while the dependency of the plugins on their loader is fine for the shared / DYNLOADING build, for the "static" builds you must (somehow) link the plugins into the executables. I also codeified a few rules into the build system along with it: * just plugins are allowed to depend / link other plugins * plugins aren't allowed to be linked into the merge lib * plugin loaders are "limited" to libraries At the high level, this is implemented via new gbuild calls: * gb_Library_set_plugin_for,lib,loader: declare a library to be a plugin of a loader library and add a dependeny from the plugin library to the loader library * gb_Library_set_plugin_for_nodep,lib,loader: ^^^^ without adding the library dependeny * gb_Helper_register_plugins_for_install: "plugin" replacement for gb_Helper_register_libraries_for_install to implement some additional checks in the build system In the end this patch just adds a bit syntactic sugar and nothing changes for any build. Change-Id: I7b01d9c384cbc5838bd2cc93aff18e4868939d6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126163 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/CustomTarget_breakiterator.mk3
-rw-r--r--i18npool/Library_collator_data.mk2
-rw-r--r--i18npool/Library_dict_ja.mk2
-rw-r--r--i18npool/Library_dict_zh.mk2
-rw-r--r--i18npool/Library_i18npool.mk2
-rw-r--r--i18npool/Library_index_data.mk2
-rw-r--r--i18npool/Library_localedata_en.mk2
-rw-r--r--i18npool/Library_localedata_es.mk2
-rw-r--r--i18npool/Library_localedata_euro.mk2
-rw-r--r--i18npool/Library_localedata_others.mk2
-rw-r--r--i18npool/Library_textconv_dict.mk2
-rw-r--r--i18npool/source/localedata/localedata.cxx4
12 files changed, 21 insertions, 6 deletions
diff --git a/i18npool/CustomTarget_breakiterator.mk b/i18npool/CustomTarget_breakiterator.mk
index 89827cfc6a92..e4c87238bdd1 100644
--- a/i18npool/CustomTarget_breakiterator.mk
+++ b/i18npool/CustomTarget_breakiterator.mk
@@ -25,7 +25,8 @@ $(i18npool_BIDIR)/dict_%.data : \
$(call gb_Helper_abbreviate_dirs,\
$(call gb_Helper_execute,gendict) $< $@ $(patsubst $(i18npool_BIDIR)/dict_%.cxx,%,$@))
$(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),DIC)
-else
+
+else # !iOS ANDROID
$(call gb_CustomTarget_get_target,i18npool/breakiterator) : \
$(i18npool_BIDIR)/dict_ja.cxx $(i18npool_BIDIR)/dict_zh.cxx $(i18npool_BIDIR)/OpenOffice_dat.c
diff --git a/i18npool/Library_collator_data.mk b/i18npool/Library_collator_data.mk
index 447985b43c3a..5aaadcb1d20b 100644
--- a/i18npool/Library_collator_data.mk
+++ b/i18npool/Library_collator_data.mk
@@ -13,6 +13,8 @@ i18npool_LCDTXTS := $(if $(i18npool_ICULT53), $(i18npool_LCDALL), $(filter-out %
$(eval $(call gb_Library_Library,collator_data))
+$(eval $(call gb_Library_set_plugin_for_nodep,collator_data,i18npool))
+
$(eval $(call gb_Library_add_generated_exception_objects,collator_data,\
$(foreach txt,$(i18npool_LCDTXTS),\
CustomTarget/i18npool/collator/collator_$(notdir $(basename $(txt)))) \
diff --git a/i18npool/Library_dict_ja.mk b/i18npool/Library_dict_ja.mk
index 398b768fe3c0..d2ae790f51f4 100644
--- a/i18npool/Library_dict_ja.mk
+++ b/i18npool/Library_dict_ja.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,dict_ja))
+$(eval $(call gb_Library_set_plugin_for_nodep,dict_ja,i18npool))
+
$(eval $(call gb_Library_add_generated_exception_objects,dict_ja,\
CustomTarget/i18npool/breakiterator/dict_ja \
))
diff --git a/i18npool/Library_dict_zh.mk b/i18npool/Library_dict_zh.mk
index 48c71c6f2a3a..60c515fca9d3 100644
--- a/i18npool/Library_dict_zh.mk
+++ b/i18npool/Library_dict_zh.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,dict_zh))
+$(eval $(call gb_Library_set_plugin_for_nodep,dict_zh,i18npool))
+
$(eval $(call gb_Library_add_generated_exception_objects,dict_zh,\
CustomTarget/i18npool/breakiterator/dict_zh \
))
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index 6bbab747d462..854b920bd9a4 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -130,7 +130,7 @@ $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_static.hxx :
$(call gb_CxxObject_get_target,i18npool/source/localedata/localedata) : \
INCLUDE += -I$(call gb_CustomTarget_get_workdir,i18npool/localedata)
-endif
+endif # DISABLE_DYNLOADING
# collator_unicode.cxx includes generated lrl_include.hxx
$(call gb_CxxObject_get_target,i18npool/source/collator/collator_unicode) : \
diff --git a/i18npool/Library_index_data.mk b/i18npool/Library_index_data.mk
index d0849b236237..b00ede9d50ab 100644
--- a/i18npool/Library_index_data.mk
+++ b/i18npool/Library_index_data.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,index_data))
+$(eval $(call gb_Library_set_plugin_for_nodep,index_data,i18npool))
+
$(eval $(call gb_Library_add_generated_exception_objects,index_data,\
$(foreach txt,$(wildcard $(SRCDIR)/i18npool/source/indexentry/data/*.txt),\
CustomTarget/i18npool/indexentry/$(notdir $(basename $(txt)))) \
diff --git a/i18npool/Library_localedata_en.mk b/i18npool/Library_localedata_en.mk
index c7d9ec0b0fe8..c6a9dff972e7 100644
--- a/i18npool/Library_localedata_en.mk
+++ b/i18npool/Library_localedata_en.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,localedata_en))
+$(eval $(call gb_Library_set_plugin_for_nodep,localedata_en,i18npool))
+
$(eval $(call gb_Library_add_generated_exception_objects,localedata_en,\
CustomTarget/i18npool/localedata/localedata_en_AU \
CustomTarget/i18npool/localedata/localedata_en_BW \
diff --git a/i18npool/Library_localedata_es.mk b/i18npool/Library_localedata_es.mk
index 3e8e520f1bd4..cd0b74f151ee 100644
--- a/i18npool/Library_localedata_es.mk
+++ b/i18npool/Library_localedata_es.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,localedata_es))
+$(eval $(call gb_Library_set_plugin_for_nodep,localedata_es,i18npool))
+
$(eval $(call gb_Library_use_libraries,localedata_es,\
localedata_en \
))
diff --git a/i18npool/Library_localedata_euro.mk b/i18npool/Library_localedata_euro.mk
index 14909ac59539..afe813ba747f 100644
--- a/i18npool/Library_localedata_euro.mk
+++ b/i18npool/Library_localedata_euro.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,localedata_euro))
+$(eval $(call gb_Library_set_plugin_for_nodep,localedata_euro,i18npool))
+
$(eval $(call gb_Library_use_libraries,localedata_euro,\
localedata_en \
))
diff --git a/i18npool/Library_localedata_others.mk b/i18npool/Library_localedata_others.mk
index d22d8b46e06b..5b2fa2c89e56 100644
--- a/i18npool/Library_localedata_others.mk
+++ b/i18npool/Library_localedata_others.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,localedata_others))
+$(eval $(call gb_Library_set_plugin_for_nodep,localedata_others,i18npool))
+
$(eval $(call gb_Library_use_libraries,localedata_others,\
localedata_en \
))
diff --git a/i18npool/Library_textconv_dict.mk b/i18npool/Library_textconv_dict.mk
index cebbb69c2d8e..f9cc2ef2ee6c 100644
--- a/i18npool/Library_textconv_dict.mk
+++ b/i18npool/Library_textconv_dict.mk
@@ -9,6 +9,8 @@
$(eval $(call gb_Library_Library,textconv_dict))
+$(eval $(call gb_Library_set_plugin_for_nodep,textconv_dict,i18npool))
+
$(eval $(call gb_Library_set_include,textconv_dict,\
$$(INCLUDE) \
-I$(SRCDIR)/i18npool/inc \
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 4caa7a05176a..6b02040efc0a 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -52,10 +52,6 @@ static const char *lcl_DATA_ES = "localedata_es";
static const char *lcl_DATA_EURO = "localedata_euro";
static const char *lcl_DATA_OTHERS = "localedata_others";
-#endif
-
-#ifndef DISABLE_DYNLOADING
-
const struct {
const char* pLocale;
const char* pLib;