Repository.mk | 85 +++++++++++++++++++----------- accessibility/Library_acc.mk | 3 - bridges/Library_cpp_uno.mk | 4 + cui/Library_cui.mk | 3 - filter/Library_icg.mk | 2 i18npool/CustomTarget_breakiterator.mk | 3 - i18npool/Library_collator_data.mk | 2 i18npool/Library_dict_ja.mk | 2 i18npool/Library_dict_zh.mk | 2 i18npool/Library_i18npool.mk | 2 i18npool/Library_index_data.mk | 2 i18npool/Library_localedata_en.mk | 2 i18npool/Library_localedata_es.mk | 2 i18npool/Library_localedata_euro.mk | 2 i18npool/Library_localedata_others.mk | 2 i18npool/Library_textconv_dict.mk | 2 i18npool/source/localedata/localedata.cxx | 4 - sal/Library_sal_textenc.mk | 6 -- sc/Library_scui.mk | 3 - sd/Library_sdui.mk | 3 - solenv/gbuild/Helper.mk | 7 ++ solenv/gbuild/Library.mk | 18 ++++++ solenv/gbuild/LinkTarget.mk | 42 ++++++++++++++ sw/Library_swui.mk | 3 - vcl/Library_vclplug_gen.mk | 3 - vcl/Library_vclplug_gtk3.mk | 3 - vcl/Library_vclplug_gtk3_kde5.mk | 3 - vcl/Library_vclplug_gtk4.mk | 3 - vcl/Library_vclplug_kf5.mk | 3 - vcl/Library_vclplug_osx.mk | 3 - vcl/Library_vclplug_qt5.mk | 3 - vcl/Library_vclplug_qt6.mk | 3 - vcl/Library_vclplug_win.mk | 3 - 33 files changed, 177 insertions(+), 56 deletions(-)
New commits: commit ed583bf8d553b145f83b66118253aaf7ac94fa1a Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Tue Dec 29 11:42:30 2020 +0100 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Wed Dec 1 18:37:23 2021 +0100 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 <glo...@fbihome.de> diff --git a/Repository.mk b/Repository.mk index ec763106f30e..5b867ca478bc 100644 --- a/Repository.mk +++ b/Repository.mk @@ -256,12 +256,15 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \ sc \ scd \ scfilt \ - scui \ wpftcalc \ solver \ $(call gb_Helper_optional,SCRIPTING,vbaobj) \ )) +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,calc, \ + scui \ +)) + $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,graphicfilter, \ svgfilter \ wpftdraw \ @@ -284,21 +287,28 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,onlineupdate, \ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,gnome, \ $(if $(ENABLE_EVOAB2),evoab) \ - $(if $(ENABLE_GTK3),vclplug_gtk3) \ - $(if $(ENABLE_GTK4),vclplug_gtk4) \ $(if $(ENABLE_GIO),losessioninstall) \ $(if $(ENABLE_GIO),ucpgio1) \ )) +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,gnome, \ + $(if $(ENABLE_GTK3),vclplug_gtk3) \ + $(if $(ENABLE_GTK4),vclplug_gtk4) \ +)) + $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,kde, \ $(if $(ENABLE_KF5),kf5be1) \ - $(if $(USING_X11), \ - $(if $(ENABLE_KF5),vclplug_kf5) \ - $(if $(ENABLE_QT5),vclplug_qt5) \ - $(if $(ENABLE_QT6),vclplug_qt6) \ - $(if $(ENABLE_GTK3_KDE5),vclplug_gtk3_kde5) \ - ) \ )) + +ifneq (,$(USING_X11)) +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,kde, \ + $(if $(ENABLE_KF5),vclplug_kf5) \ + $(if $(ENABLE_QT5),vclplug_qt5) \ + $(if $(ENABLE_QT6),vclplug_qt6) \ + $(if $(ENABLE_GTK3_KDE5),vclplug_gtk3_kde5) \ +)) +endif + ifneq ($(ENABLE_GTK3_KDE5),) $(eval $(call gb_Helper_register_executables_for_install,OOO,kde, \ lo_kde5filepicker \ @@ -306,7 +316,7 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,kde, \ endif ifeq ($(OS),HAIKU) -$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,haiku, \ +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,haiku, \ $(if $(ENABLE_QT5),vclplug_qt5) \ $(if $(ENABLE_QT6),vclplug_qt6) \ $(if $(ENABLE_KF5),vclplug_kf5) \ @@ -323,7 +333,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ogltrans, \ )) $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ - acc \ avmedia \ $(call gb_Helper_optional,AVMEDIA, \ $(if $(filter MACOSX,$(OS)),\ @@ -346,7 +355,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ cppcanvas \ configmgr \ ctl \ - cui \ dba \ dbahsql \ $(call gb_Helper_optional,DBCONNECTIVITY, \ @@ -380,7 +388,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ i18npool \ i18nsearch \ hyphen \ - icg \ $(if $(ENABLE_JAVA),jdbc) \ $(if $(ENABLE_LDAP),ldapbe2) \ $(if $(filter WNT,$(OS)),WinUserInfoBe) \ @@ -415,7 +422,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ sd \ sdd \ sdfilt \ - sdui \ sfx \ simplecanvas \ slideshow \ @@ -460,14 +466,10 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ xof \ xsltdlg \ xsltfilter \ - $(if $(USING_X11), \ - vclplug_gen \ - ) \ $(if $(filter $(OS),WNT), \ ado \ oleautobridge \ smplmail \ - vclplug_win \ wininetbe1 \ ) \ $(if $(filter $(OS),MACOSX), \ @@ -475,13 +477,24 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ AppleRemote \ ) \ fps_aqua \ - vclplug_osx \ ) \ $(if $(filter iOS MACOSX,$(OS)), \ MacOSXSpell \ ) \ )) +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,ooo, \ + acc \ + cui \ + gie \ + icg \ + sdui \ + $(if $(USING_X11),vclplug_gen) \ + $(if $(filter $(OS),WNT),vclplug_win) \ + $(if $(filter $(OS),MACOSX),vclplug_osx) \ + $(if $(USING_X11),,$(if $(ENABLE_QT5),vclplug_qt5)) \ +)) + $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,postgresqlsdbc, \ $(if $(BUILD_POSTGRESQL_SDBC), \ postgresql-sdbc \ @@ -518,7 +531,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,writer, \ $(if $(ENABLE_LWP),lwpft) \ msword \ swd \ - swui \ t602filter \ $(call gb_Helper_optional,SCRIPTING,vbaswobj) \ wpftwriter \ @@ -526,6 +538,10 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,writer, \ $(call gb_Helper_optional,DBCONNECTIVITY,writer) \ )) +$(eval $(call gb_Helper_register_plugins_for_install,OOOLIBS,writer, \ + swui \ +)) + # cli_cppuhelper is NONE even though it is actually in URE because it is CliNativeLibrary $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \ smoketest \ @@ -562,6 +578,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_URE,ure, \ ) \ log_uno_uno \ unsafe_uno_uno \ +)) + +$(eval $(call gb_Helper_register_plugins_for_install,PLAINLIBS_URE,ure, \ $(if $(filter EMSCRIPTEN,$(OS)),, \ $(if $(filter MSC,$(COM)), \ $(if $(filter INTEL,$(CPUNAME)),msci_uno) \ @@ -586,7 +605,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \ proxyfac \ reflection \ reg \ - sal_textenc \ stocservices \ store \ unoidl \ @@ -594,29 +612,25 @@ $(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \ xmlreader \ )) +$(eval $(call gb_Helper_register_plugins_for_install,PRIVATELIBS_URE,ure, \ + sal_textenc \ +)) + $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ $(call gb_Helper_optional,AVMEDIA, \ $(if $(ENABLE_GSTREAMER_1_0),avmediagst) \ $(if $(filter WNT,$(OS)),avmediawin) \ ) \ cached1 \ - collator_data \ comphelper \ $(call gb_Helper_optional,DBCONNECTIVITY,dbpool2) \ $(call gb_Helper_optional,BREAKPAD,crashreport) \ deployment \ deploymentgui \ - dict_ja \ - dict_zh \ embobj \ $(if $(ENABLE_JAVA),hsqldb) \ i18nutil \ - index_data \ $(if $(and $(ENABLE_GTK3), $(filter LINUX %BSD SOLARIS,$(OS))), libreofficekitgtk) \ - localedata_en \ - localedata_es \ - localedata_euro \ - localedata_others \ $(if $(ENABLE_JAVA), \ $(if $(filter $(OS),MACOSX),,officebean) \ ) \ @@ -626,7 +640,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ sdbc2 \ sofficeapp \ srtrs1 \ - textconv_dict \ ucb1 \ ucbhelper \ $(if $(WITH_WEBDAV),ucpdav1) \ @@ -651,6 +664,18 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ ) \ )) +$(eval $(call gb_Helper_register_plugins_for_install,PLAINLIBS_OOO,ooo, \ + collator_data \ + dict_ja \ + dict_zh \ + index_data \ + localedata_en \ + localedata_es \ + localedata_euro \ + localedata_others \ + textconv_dict \ +)) + ifeq ($(OS),WNT) $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,activexbinarytable, \ regactivex \ diff --git a/accessibility/Library_acc.mk b/accessibility/Library_acc.mk index fe88dafe10da..815e2a88bd70 100644 --- a/accessibility/Library_acc.mk +++ b/accessibility/Library_acc.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,acc)) +$(eval $(call gb_Library_set_plugin_for,acc,tk)) + $(eval $(call gb_Library_set_include,acc,\ $$(INCLUDE) \ -I$(SRCDIR)/accessibility/inc \ @@ -31,7 +33,6 @@ $(eval $(call gb_Library_use_libraries,acc,\ sot \ svl \ svt \ - tk \ tl \ utl \ vcl \ diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk index 3a31bf69fc7c..8a4ec4c10f48 100644 --- a/bridges/Library_cpp_uno.mk +++ b/bridges/Library_cpp_uno.mk @@ -289,4 +289,8 @@ $(eval $(call gb_Library_add_cxxobjects,$(CPPU_ENV)_uno,\ , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \ )) +ifeq ($(DISABLE_DYNLOADING),TRUE) +$(eval $(call gb_Library_set_plugin_for_nodep,$(CPPU_ENV)_uno,cppu)) +endif + # vim: set noet sw=4 ts=4: diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index fb3546b4e9ad..686bd039f251 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,cui)) +$(eval $(call gb_Library_set_plugin_for,cui,vcl)) + $(eval $(call gb_Library_set_componentfile,cui,cui/util/cui)) $(eval $(call gb_Library_set_include,cui,\ @@ -58,7 +60,6 @@ $(eval $(call gb_Library_use_libraries,cui,\ tl \ ucbhelper \ utl \ - vcl \ $(if $(ENABLE_BREAKPAD), \ crashreport \ ) \ diff --git a/filter/Library_icg.mk b/filter/Library_icg.mk index 94949bb32904..44cb742a6b98 100644 --- a/filter/Library_icg.mk +++ b/filter/Library_icg.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,icg)) +$(eval $(call gb_Library_set_plugin_for_nodep,icg,sd)) + $(eval $(call gb_Library_use_external,icg,boost_headers)) $(eval $(call gb_Library_use_sdk_api,icg)) 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; diff --git a/sal/Library_sal_textenc.mk b/sal/Library_sal_textenc.mk index 15546ba4969e..0fba5d083499 100644 --- a/sal/Library_sal_textenc.mk +++ b/sal/Library_sal_textenc.mk @@ -10,11 +10,9 @@ $(eval $(call gb_Library_Library,sal_textenc)) -$(eval $(call gb_Library_use_external,sal_textenc,boost_headers)) +$(eval $(call gb_Library_set_plugin_for,sal_textenc,sal)) -$(eval $(call gb_Library_use_libraries,sal_textenc,\ - sal \ -)) +$(eval $(call gb_Library_use_external,sal_textenc,boost_headers)) $(eval $(call gb_Library_add_exception_objects,sal_textenc,\ sal/textenc/context \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 86605ab63a0d..4d4cffa12bd4 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,scui)) +$(eval $(call gb_Library_set_plugin_for,scui,sc)) + $(eval $(call gb_Library_set_include,scui,\ -I$(SRCDIR)/sc/source/core/inc \ -I$(SRCDIR)/sc/source/filter/inc \ @@ -55,7 +57,6 @@ $(eval $(call gb_Library_use_libraries,scui,\ $(call gb_Helper_optional,OPENCL, \ opencl) \ sal \ - sc \ sfx \ sot \ svl \ diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk index c776e2eed532..a774d0610cb4 100644 --- a/sd/Library_sdui.mk +++ b/sd/Library_sdui.mk @@ -9,6 +9,8 @@ $(eval $(call gb_Library_Library,sdui)) +$(eval $(call gb_Library_set_plugin_for,sdui,sd)) + $(eval $(call gb_Library_set_include,sdui,\ $$(INCLUDE) \ -I$(SRCDIR)/sd/inc \ @@ -49,7 +51,6 @@ $(eval $(call gb_Library_use_libraries,sdui,\ fwk \ sal \ salhelper \ - sd \ sfx \ sot \ svl \ diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index 4d2fdd698005..9f3e92e02ec4 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -199,6 +199,13 @@ $(if $(filter UNOVERLIBS RTVERLIBS,$(1)),\ endef +# a plugin is a library, why can't be dynamically linked and must be dlopen'd, but must be linked static +define gb_Helper_register_plugins_for_install +$(call gb_Helper_register_libraries_for_install,$(1),$(2),$(3)) +gb_Library_KNOWNPLUGINS += $(3) + +endef + define gb_Helper__register_jars $(foreach group,$(gb_Jar_VALIDGROUPS),\ $(foreach target,$(2),\ diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 6562cbf41d34..2fb98bcf622f 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -172,6 +172,23 @@ gb_Library__COMPONENTPREFIXES := \ gb_Library_get_runtime_filename = $(call gb_Library_get_filename,$(1)) gb_Library_get_runtime_filename_for_build = $(call gb_Library_get_filename_for_build,$(1)) +# instead of setting nodep use gb_Library_set_plugin_for_nodep +# +# call gb_Library_set_plugin_for,library,loader,nodep +define gb_Library_set_plugin_for +ifneq (,$$(filter-out $(gb_Library_KNOWNPLUGINS),$(1))) +$$(eval $$(call gb_Output_info,currently known plugins are: $(sort $(gb_Library_KNOWNPLUGINS)),ALL)) +$$(eval $$(call gb_Output_error,Unknown plugin(s) '$$(filter-out $(gb_Library_KNOWNPLUGINS),$(1)))'. Plugins must be registered in Repository.mk or RepositoryExternal.mk)) +endif + +$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(2))) : PLUGINS += $(1) +$(eval $(call gb_LinkTarget__add_plugin,$(call gb_Library_get_linktarget,$(2)),$(1))) +$(eval $(call gb_LinkTarget__set_plugin_for,$(call gb_Library_get_linktarget,$(1)),$(2),$(3))) +endef + +# call gb_Library_set_plugin_for_nodep,library,loader +gb_Library_set_plugin_for_nodep = $(call gb_Library_set_plugin_for,$(1),$(2),$(true)) + # forward the call to the gb_LinkTarget implementation # (note: because the function name is in $(1), the other args are shifted by 1) define gb_Library__forward_to_Linktarget @@ -182,7 +199,6 @@ endef # copy pasta for forwarding: this could be (and was) done more elegantly, but # these here can be found by both git grep and ctags gb_Library_add_cobject = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3)) -gb_Library_add_cobject = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_Library_add_cobjects = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_Library_add_cxxobject = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_Library_add_cxxobjects = $(call gb_Library__forward_to_Linktarget,$(0),$(1),$(2),$(3)) diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 783f6022abe6..a5306eeb38b9 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -1225,6 +1225,7 @@ ifeq ($(DISABLE_DYNLOADING),) $(call gb_LinkTarget_get_target,$(1)) : \ $(foreach lib,$(3),$(call gb_Library_get_exports_target,$(lib))) endif + $(call gb_LinkTarget_get_headers_target,$(1)) : \ $(foreach lib,$(2),$(call gb_Library_get_headers_target,$(lib))) $(foreach lib,$(2),$(call gb_LinkTarget__lib_dummy_depend,$(lib))) @@ -1273,7 +1274,12 @@ endef define gb_LinkTarget_use_libraries ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2))) $$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) -$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk or RepositoryExternal.mk)) +$$(eval $$(call gb_Output_error,Cannot link against library/libraries '$$(filter-out $(gb_Library_KNOWNLIBS),$(2))'. Libraries must be registered in Repository.mk or RepositoryExternal.mk)) +endif +ifneq (,$$(filter $(2),$(gb_Library_KNOWNPLUGINS))) +ifneq (,$$(filter $(1),$$(foreach plugin,$(gb_Library_KNOWNPLUGINS),$(call gb_Library__get_workdir_linktargetname,$(plugin))))) +$$(eval $$(call gb_Output_error,Cannot link against plugin library/libraries '$$(filter $(2),$(gb_Library_KNOWNPLUGINS))'. Only plugins are allowed to do that.)) +endif endif ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true)) @@ -2102,4 +2108,38 @@ endif endef +gb_LinkTarget__get_plugins_var = $(call gb_LinkTarget__get_workdir_linktargetname,$(1))<>PLUGINS +gb_LinkTarget__get_plugins = $($(call gb_LinkTarget__get_plugins_var,$(1))) +gb_Library__get_plugins = $($(call gb_LinkTarget__get_plugins_var,$(call gb_Library_get_linktarget,$(1)))) + +define gb_LinkTarget__add_plugin +$(call gb_LinkTarget__get_plugins_var,$(1)) += $(2) + +endef + +# Instead of setting nodep use gb_LinkTarget__set_plugin_for_nodep +# +# call gb_LinkTarget__set_plugin_for,linktarget,loader,nodep +define gb_LinkTarget__set_plugin_for +ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2))) +$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL)) +$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk or RepositoryExternal.mk)) +endif +ifeq (,$(filter $(1),$(foreach plugin,$(gb_Library_KNOWNPLUGINS),$(call gb_Library_get_linktarget,$(plugin))))) +$$(eval $$(call gb_Output_error,Unknown plugin(s) '$(filter $(1),$(foreach plugin,$(gb_Library_KNOWNPLUGINS),$(call gb_Library_get_linktarget,$(plugin))))'. Plugins must be registered in Repository.mk or RepositoryExternal.mk)) +endif +ifneq (,$(filter $(1),$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_linktarget,$(lib))))) +$$(eval $$(call gb_Output_error,Plugins can't be in mergelibs)) +endif +ifeq ($(call gb_LinkTarget__is_build_tool,$(1)),$(true)) +$$(eval $$(call gb_Output_error,Plugin support for build tools not implemented)) +endif + +$(if $(3),,$(call gb_LinkTarget__use_libraries,$(1),$(2),$(2))) + +endef + +# call gb_LinkTarget__set_plugin_for_nodep,linktarget,loader +gb_LinkTarget__set_plugin_for_nodep = $(call gb_LinkTarget__set_plugin_for,$(1),$(2),$(true)) + # vim: set noet sw=4: diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk index 99f1dd20ae3d..e643179d355f 100644 --- a/sw/Library_swui.mk +++ b/sw/Library_swui.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,swui)) +$(eval $(call gb_Library_set_plugin_for,swui,sw)) + $(eval $(call gb_Library_set_include,swui,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/uibase/inc \ @@ -69,7 +71,6 @@ $(eval $(call gb_Library_use_libraries,swui,\ svx \ svx \ svxcore \ - sw \ tk \ tl \ ucbhelper \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 3ebf80034c91..73f5464d7362 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_gen)) +$(eval $(call gb_Library_set_plugin_for,vclplug_gen,vcl)) + $(eval $(call gb_Library_set_include,vclplug_gen,\ $$(INCLUDE) \ -I$(SRCDIR)/vcl/inc \ @@ -33,7 +35,6 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_gen)) $(eval $(call gb_Library_use_common_precompiled_header,vclplug_gen)) $(eval $(call gb_Library_use_libraries,vclplug_gen,\ - vcl \ tl \ utl \ sot \ diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 09374b635284..702dedc3b43a 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_gtk3)) +$(eval $(call gb_Library_set_plugin_for,vclplug_gtk3,vcl)) + # Silence deprecation warnings wholesale as long as vcl/unx/gtk3/*.cxx just # forward to vcl/unx/gtk/*.cxx: $(eval $(call gb_Library_add_cxxflags,vclplug_gtk3, \ @@ -54,7 +56,6 @@ $(eval $(call gb_Library_add_libs,vclplug_gtk3,\ )) $(eval $(call gb_Library_use_libraries,vclplug_gtk3,\ - vcl \ svl \ tl \ utl \ diff --git a/vcl/Library_vclplug_gtk3_kde5.mk b/vcl/Library_vclplug_gtk3_kde5.mk index dbd5fbf53e88..7ee7f11b088a 100644 --- a/vcl/Library_vclplug_gtk3_kde5.mk +++ b/vcl/Library_vclplug_gtk3_kde5.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_gtk3_kde5)) +$(eval $(call gb_Library_set_plugin_for,vclplug_gtk3_kde5,vcl)) + # Silence deprecation warnings wholesale as long as vcl/unx/gtk3/*.cxx just # forward to vcl/unx/gtk/*.cxx: $(eval $(call gb_Library_add_cxxflags,vclplug_gtk3_kde5, \ @@ -59,7 +61,6 @@ $(eval $(call gb_Library_add_libs,vclplug_gtk3_kde5,\ $(eval $(call gb_Library_use_libraries,vclplug_gtk3_kde5,\ svl \ - vcl \ tl \ utl \ sot \ diff --git a/vcl/Library_vclplug_gtk4.mk b/vcl/Library_vclplug_gtk4.mk index 09520c4dba9d..83695a8c1c34 100644 --- a/vcl/Library_vclplug_gtk4.mk +++ b/vcl/Library_vclplug_gtk4.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_gtk4)) +$(eval $(call gb_Library_set_plugin_for,vclplug_gtk4,vcl)) + # Silence deprecation warnings wholesale as long as vcl/unx/gtk4/*.cxx just # forward to vcl/unx/gtk/*.cxx: $(eval $(call gb_Library_add_cxxflags,vclplug_gtk4, \ @@ -54,7 +56,6 @@ $(eval $(call gb_Library_add_libs,vclplug_gtk4,\ )) $(eval $(call gb_Library_use_libraries,vclplug_gtk4,\ - vcl \ svl \ tl \ utl \ diff --git a/vcl/Library_vclplug_kf5.mk b/vcl/Library_vclplug_kf5.mk index bcf8fb6897ad..9e44e5f182fd 100644 --- a/vcl/Library_vclplug_kf5.mk +++ b/vcl/Library_vclplug_kf5.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_kf5)) +$(eval $(call gb_Library_set_plugin_for,vclplug_kf5,vcl)) + $(eval $(call gb_Library_use_custom_headers,vclplug_kf5,vcl/unx/kf5)) $(eval $(call gb_Library_set_include,vclplug_kf5,\ @@ -35,7 +37,6 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_kf5)) $(eval $(call gb_Library_use_libraries,vclplug_kf5,\ vclplug_qt5 \ - vcl \ tl \ utl \ sot \ diff --git a/vcl/Library_vclplug_osx.mk b/vcl/Library_vclplug_osx.mk index e2a1a5161bdd..230aa020dda0 100644 --- a/vcl/Library_vclplug_osx.mk +++ b/vcl/Library_vclplug_osx.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_osx)) +$(eval $(call gb_Library_set_plugin_for,vclplug_osx,vcl)) + $(eval $(call gb_Library_set_include,vclplug_osx,\ $$(INCLUDE) \ -I$(SRCDIR)/vcl/inc \ @@ -51,7 +53,6 @@ $(eval $(call gb_Library_use_libraries,vclplug_osx,\ sal \ salhelper \ tl \ - vcl \ )) $(eval $(call gb_Library_use_externals,vclplug_osx,\ diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 32bf4dc215df..d21f7d989410 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_qt5)) +$(eval $(call gb_Library_set_plugin_for,vclplug_qt5,vcl)) + $(eval $(call gb_Library_use_custom_headers,vclplug_qt5,vcl/qt5)) $(eval $(call gb_Library_set_include,vclplug_qt5,\ @@ -36,7 +38,6 @@ $(eval $(call gb_Library_add_defs,vclplug_qt5,\ $(eval $(call gb_Library_use_sdk_api,vclplug_qt5)) $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ - vcl \ tl \ utl \ sot \ diff --git a/vcl/Library_vclplug_qt6.mk b/vcl/Library_vclplug_qt6.mk index 8845da72d604..9a4e627f3e22 100644 --- a/vcl/Library_vclplug_qt6.mk +++ b/vcl/Library_vclplug_qt6.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_qt6)) +$(eval $(call gb_Library_set_plugin_for,vclplug_qt6,vcl)) + $(eval $(call gb_Library_use_custom_headers,vclplug_qt6,vcl/qt6)) $(eval $(call gb_Library_set_include,vclplug_qt6,\ @@ -35,7 +37,6 @@ $(eval $(call gb_Library_add_defs,vclplug_qt6,\ $(eval $(call gb_Library_use_sdk_api,vclplug_qt6)) $(eval $(call gb_Library_use_libraries,vclplug_qt6,\ - vcl \ tl \ utl \ sot \ diff --git a/vcl/Library_vclplug_win.mk b/vcl/Library_vclplug_win.mk index ca75300670b3..2fd00d7bd03b 100644 --- a/vcl/Library_vclplug_win.mk +++ b/vcl/Library_vclplug_win.mk @@ -19,6 +19,8 @@ $(eval $(call gb_Library_Library,vclplug_win)) +$(eval $(call gb_Library_set_plugin_for,vclplug_win,vcl)) + $(eval $(call gb_Library_set_componentfile,vclplug_win,vcl/vclplug_win)) $(eval $(call gb_Library_set_include,vclplug_win,\ @@ -53,7 +55,6 @@ $(eval $(call gb_Library_use_libraries,vclplug_win,\ salhelper \ tl \ utl \ - vcl \ )) $(eval $(call gb_Library_use_externals,vclplug_win,\