summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-12-29 11:49:50 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-01-25 12:42:15 +0100
commitb26d33a15e716c3bfe8f8a18dae20660398dfa4d (patch)
tree6fff9ee8d4fd72cdf6a710aef9457eb8f3a715bf
parent494c38902c1d0e476ae2d6964df12bec7d557b54 (diff)
Add a static components library
This adds all component implementing libraries as dependency to a new components library, which otherwise just contains the "native" code with the mapping of the component constructors. Since there is no way to know, which components are actually used, this has to include all build components. The components lbrary is automatically added to all users of cppuhelper, which contains the calls to the mapper functions of the generated "native" code. Change-Id: Ie78af06c3325c0f58226a4c4da85a1d64fb45dc6
-rw-r--r--Repository.mk1
-rw-r--r--i18npool/Library_i18npool.mk11
-rw-r--r--i18nutil/source/utility/paper.cxx2
-rw-r--r--idl/source/objects/types.cxx2
-rw-r--r--sd/source/core/typemap.cxx42
-rw-r--r--solenv/gbuild/Library.mk4
-rw-r--r--solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk4
-rw-r--r--solenv/gbuild/static.mk14
-rw-r--r--vcl/Executable_ui-previewer.mk113
-rw-r--r--vcl/Library_vcl.mk3
-rw-r--r--vcl/Module_vcl.mk6
-rw-r--r--wasm/CustomTarget_components.mk (renamed from vcl/CustomTarget_wasm_native.mk)10
-rw-r--r--wasm/Library_components.mk16
-rw-r--r--wasm/Module_wasm.mk2
14 files changed, 97 insertions, 133 deletions
diff --git a/Repository.mk b/Repository.mk
index 163cbb0cdafb..d4371e898251 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -345,6 +345,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,OPENCL,clew) \
$(if $(filter $(OS),WNT),,cmdmail) \
cppcanvas \
+ $(if $(filter $(OS),EMSCRIPTEN),components) \
configmgr \
ctl \
cui \
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index 6bbab747d462..da044da5b9b9 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -25,6 +25,17 @@ $(eval $(call gb_Library_use_libraries,i18npool,\
i18nlangtag \
i18nutil \
sal \
+ $(if $(DISABLE_DYNLOADING), \
+ collator_data \
+ dict_ja \
+ dict_zh \
+ index_data \
+ localedata_en \
+ localedata_es \
+ localedata_euro \
+ localedata_others \
+ textconv_dict \
+ ) \
))
$(eval $(call gb_Library_use_externals,i18npool,\
diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx
index 74c9fd35e9f4..042a82e72f93 100644
--- a/i18nutil/source/utility/paper.cxx
+++ b/i18nutil/source/utility/paper.cxx
@@ -237,7 +237,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper()
if (bInitialized)
return aInstance;
-#ifndef MACOSX
+#if ! defined(MACOSX) && ! defined(EMSCRIPTEN)
// try libpaper
// #i78617# workaround missing paperconf command
FILE* pPipe = popen( "paperconf 2>/dev/null", "r" );
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 9cb1684caffc..52110127b842 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -251,7 +251,7 @@ void SvMetaType::WriteSfxItem(
// write the implementation part
rOutStm.WriteCharPtr( "#ifdef SFX_TYPEMAP" ) << endl;
- rOutStm.WriteCharPtr( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(LINUX)))" ) << endl;
+ rOutStm.WriteCharPtr( "#if !defined(_WIN32) && (defined(DISABLE_DYNLOADING) && (defined(ANDROID) || defined(IOS) || defined(EMSCRIPTEN) || defined(LINUX)))" ) << endl;
rOutStm.WriteCharPtr( "__attribute__((__weak__))" ) << endl;
rOutStm.WriteCharPtr( "#endif" ) << endl;
rOutStm.WriteOString( aTypeName ).WriteOString( aVarName )
diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx
index 046be764ba19..4378ad2d2f84 100644
--- a/sd/source/core/typemap.cxx
+++ b/sd/source/core/typemap.cxx
@@ -95,7 +95,49 @@
#include <svx/galleryitem.hxx>
#include <svx/sdangitm.hxx>
+#ifdef DISABLE_DYNLOADING
+/* Avoid clash with the ones from svx/source/form/typemap.cxx */
+#define aSfxBoolItem_Impl sd_source_core_typemap_aSfxBoolItem_Impl
+#define aSfxInt32Item_Impl sd_source_core_typemap_aSfxInt32Item_Impl
+#define aSfxStringItem_Impl sd_source_core_typemap_aSfxStringItem_Impl
+#define aSfxUInt16Item_Impl sd_source_core_typemap_aSfxUInt16Item_Impl
+#define aSfxUInt32Item_Impl sd_source_core_typemap_aSfxUInt32Item_Impl
+#define aSfxVoidItem_Impl sd_source_core_typemap_aSfxVoidItem_Impl
+#define aSvxClipboardFormatItem_Impl sd_source_core_typemap_aSvxClipboardFormatItem_Impl
+#define aSvxColorItem_Impl sd_source_core_typemap_aSvxColorItem_Impl
+#define aSvxContourItem_Impl sd_source_core_typemap_aSvxContourItem_Impl
+#define aSvxCrossedOutItem_Impl sd_source_core_typemap_aSvxCrossedOutItem_Impl
+#define aSvxFontHeightItem_Impl sd_source_core_typemap_aSvxFontHeightItem_Impl
+#define aSvxFontItem_Impl sd_source_core_typemap_aSvxFontItem_Impl
+#define aSvxLanguageItem_Impl sd_source_core_typemap_aSvxLanguageItem_Impl
+#define aSvxPostureItem_Impl sd_source_core_typemap_aSvxPostureItem_Impl
+#define aSvxShadowedItem_Impl sd_source_core_typemap_aSvxShadowedItem_Impl
+#define aSvxUnderlineItem_Impl sd_source_core_typemap_aSvxUnderlineItem_Impl
+#define aSvxOverlineItem_Impl sd_source_core_typemap_aSvxOverlineItem_Impl
+#define aSvxWeightItem_Impl sd_source_core_typemap_aSvxWeightItem_Impl
+#endif
+
#define SFX_TYPEMAP
#include <sdslots.hxx>
+#ifdef DISABLE_DYNLOADING
+#undef aSfxBoolItem_Impl
+#undef aSfxInt32Item_Impl
+#undef aSfxStringItem_Impl
+#undef aSfxUInt16Item_Impl
+#undef aSfxUInt32Item_Impl
+#undef aSfxVoidItem_Impl
+#undef aSvxClipboardFormatItem_Impl
+#undef aSvxColorItem_Impl
+#undef aSvxContourItem_Impl
+#undef aSvxCrossedOutItem_Impl
+#undef aSvxFontHeightItem_Impl
+#undef aSvxFontItem_Impl
+#undef aSvxLanguageItem_Impl
+#undef aSvxPostureItem_Impl
+#undef aSvxShadowedItem_Impl
+#undef aSvxTextLineItem_Impl
+#undef aSvxWeightItem_Impl
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 4f336cbb0007..685e5c249afc 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -119,6 +119,9 @@ $(if $(3),$(call gb_Output_error,gb_Library_set_soversion_script: too many argum
$(call gb_Library__set_soversion_script_platform,$(1),$(2))
endef
+gb_Library__get_component_var = $(call gb_Library__get_workdir_linktargetname,$(1))<>COMPONENTFILE
+gb_Library__get_component = $($(call gb_Library__get_component_var,$(1)))
+
# The dependency from workdir component target to outdir library should ensure
# that gb_CppunitTest_use_component can transitively depend on the library.
# But the component target also must be delivered; use the target
@@ -134,6 +137,7 @@ $(call gb_ComponentTarget_get_target,$(2)) :| \
$(call gb_Library_get_target,$(gb_Library__get_name))
$(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \
$(call gb_ComponentTarget_get_clean_target,$(2))
+$(eval $(call gb_Library__get_component_var,$(1)) += $(2))
endef
gb_Library__get_name = $(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1))
diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index ba88eea92976..b0e26432f173 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -7,11 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2))
-else
-gb_UnoApiHeadersTarget_select_variant = $(2)
-endif
include $(GBUILDDIR)/platform/unxgcc.mk
diff --git a/solenv/gbuild/static.mk b/solenv/gbuild/static.mk
index f71a042f7221..c2b359378eed 100644
--- a/solenv/gbuild/static.mk
+++ b/solenv/gbuild/static.mk
@@ -50,6 +50,13 @@
# doesn't seem to happen in any breaking way and it works to link multiple Executable
# with large and small expanded dependency lists.
#
+# Then there is the special static "components" library, which simply depends on all build
+# components. In theory these could be limited per-module (Writer, Calc, etc.), but currently
+# this is not implemented and instead solenv/bin/native-code.py is used, so actually
+# everything is build and "cleaned up" at link time, which is especially expensive for WASM.
+# That library is currently just used for Emscripten, but could be used generally for
+# static builds.
+#
# For WASM, this also serialize the linking, because the wasm-opt process is multi-threaded,
# running on all available cores, using GB of memory. Extra parallelism is counterproductive.
#
@@ -62,6 +69,10 @@
ifeq ($(true),$(gb_FULLDEPS))
ifeq (,$(gb_PARTIAL_BUILD))
+ifeq ($(OS),EMSCRIPTEN)
+$(foreach lib,$(gb_Library_KNOWNLIBS),$(if $(call gb_Library__get_component,$(lib)),$(eval $(call gb_Library_use_libraries,components,$(lib)))))
+endif
+
define gb_Executable__add_x_template
define gb_Executable__add_$(2)
@@ -173,6 +184,7 @@ gb_Executable__has_any_dependencies = $(if $(filter-out GBUILD_TOUCHED,$(call gb
# * Expand all libraries. It's not strictly needed, as we only need the info for the executables,
# but this way we can implement updating single gbuild-module dependencies as needed.
# * For all executables:
+# * For EMSCRIPTEN, add components library to any cppuhelper user, as it contains the call to the mapper functions
# * Find any loader libraries and add the needed plugin dependences
# * Add all statics to the executables
# * Add icudata as needed (it should be a plugin somehow declared in RepositoryExternal.mk, but that didn't work)
@@ -180,6 +192,8 @@ gb_Executable__has_any_dependencies = $(if $(filter-out GBUILD_TOUCHED,$(call gb
# * Remove "touch" mark from all touched targets
$(foreach lib,$(gb_Library_KNOWNLIBS),$(eval $(call gb_LinkTarget__fill_all_libraries,$(lib))))
$(foreach exec,$(gb_Executable_KNOWN), \
+ $(if $(and $(filter EMSCRIPTEN,$(OS)),$(filter cppuhelper,$(call gb_Executable__get_all_libraries,$(exec)))), \
+ $(eval $(call gb_Executable_use_libraries,$(exec),components))) \
$(eval $(call gb_LinkTarget__fill_all_executable,$(exec))) \
$(foreach loader,$(filter $(gb_Library_KNOWNLOADERS),$(call gb_Executable__get_all_libraries,$(exec))), \
$(eval $(call gb_Executable_use_libraries,$(exec),$(call gb_Library__get_plugins,$(loader)))) \
diff --git a/vcl/Executable_ui-previewer.mk b/vcl/Executable_ui-previewer.mk
index 87a63182a0de..f853ce40864e 100644
--- a/vcl/Executable_ui-previewer.mk
+++ b/vcl/Executable_ui-previewer.mk
@@ -30,119 +30,6 @@ $(eval $(call gb_Executable_use_libraries,ui-previewer,\
tl \
ucbhelper \
vcl \
- $(if $(filter TRUE,$(DISABLE_DYNLOADING)), \
- acc \
- avmedia \
- basegfx \
- bib \
- bootstrap \
- cairocanvas \
- canvasfactory \
- canvastools \
- chartcontroller \
- chartcore \
- collator_data \
- configmgr \
- cppcanvas \
- ctl \
- cui \
- dba \
- dbtools \
- dict_ja \
- dict_zh \
- drawinglayer \
- editeng \
- embobj \
- emfio \
- epoxy \
- evtatt \
- expwrap \
- filterconfig \
- frm \
- fsstorage \
- fwk \
- gie \
- gie \
- graphicfilter \
- graphicfilter \
- guesslang \
- hyphen \
- i18nlangtag \
- i18npool \
- i18npool \
- i18nsearch \
- i18nutil \
- icg \
- index_data \
- introspection \
- invocadapt \
- invocation \
- lng \
- lnth \
- localebe1 \
- localedata_en \
- localedata_es \
- localedata_euro \
- localedata_others \
- msfilter \
- mtfrenderer \
- namingservice \
- numbertext \
- odfflatxml \
- oox \
- package2 \
- pdffilter \
- proxyfac \
- reflection \
- reg \
- salhelper \
- sax \
- sax \
- sb \
- sfx \
- simplecanvas \
- sot \
- spell \
- srtrs1 \
- stocservices \
- storagefd \
- store \
- svgfilter \
- svgio \
- svl \
- svt \
- svx \
- svxcore \
- t602filter \
- textconv_dict \
- textfd \
- tl \
- tk \
- ucb1 \
- ucbhelper \
- ucpdav1 \
- ucpfile1 \
- ucphier1 \
- ucppkg1 \
- ucptdoc1 \
- unoidl \
- unordf \
- unoxml \
- utl \
- uui \
- vclcanvas \
- xmlfa \
- xmlfd \
- xmlreader \
- xmlscript \
- xo \
- xof \
- xsltdlg \
- xsltfilter \
- xsltfilter \
- xstor \
- $(if $(filter EMSCRIPTEN,$(OS)),vclplug_qt5) \
- ) \
))
$(eval $(call gb_Executable_add_exception_objects,ui-previewer,\
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 2ce2ad477249..4ecf042b92ff 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -577,9 +577,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
$(vcl_headless_freetype_code) \
))
-$(eval $(call gb_Library_add_generated_exception_objects,vcl,\
- CustomTarget/vcl/wasm/native-code \
-))
$(eval $(call gb_Library_use_externals,vcl,\
cairo \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 34e0bd041583..a45b43be22bd 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -123,12 +123,6 @@ $(eval $(call gb_Module_add_targets,vcl,\
))
endif
-ifeq ($(OS),EMSCRIPTEN)
-$(eval $(call gb_Module_add_targets,vcl,\
- CustomTarget_wasm_native \
-))
-endif
-
ifneq ($(ENABLE_FUZZERS),)
$(eval $(call gb_Module_add_targets,vcl,\
CustomTarget_nativecore \
diff --git a/vcl/CustomTarget_wasm_native.mk b/wasm/CustomTarget_components.mk
index a9f702388500..cb188166d894 100644
--- a/vcl/CustomTarget_wasm_native.mk
+++ b/wasm/CustomTarget_components.mk
@@ -8,14 +8,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_CustomTarget_CustomTarget,vcl/wasm))
+$(eval $(call gb_CustomTarget_CustomTarget,wasm/components))
-wasm_WORKDIR := $(call gb_CustomTarget_get_workdir,vcl/wasm)
+wasm_WORKDIR := $(call gb_CustomTarget_get_workdir,wasm)
-$(call gb_CustomTarget_get_target,vcl/wasm): \
- $(wasm_WORKDIR)/native-code.cxx
+$(call gb_CustomTarget_get_target,wasm/components): \
+ $(wasm_WORKDIR)/component_maps.cxx
-$(wasm_WORKDIR)/native-code.cxx: \
+$(wasm_WORKDIR)/component_maps.cxx: \
$(SRCDIR)/solenv/bin/native-code.py \
| $(wasm_WORKDIR)/.dir
$(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
diff --git a/wasm/Library_components.mk b/wasm/Library_components.mk
new file mode 100644
index 000000000000..128a3c12c2df
--- /dev/null
+++ b/wasm/Library_components.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,components))
+
+$(eval $(call gb_Library_add_generated_exception_objects,components,\
+ CustomTarget/wasm/component_maps \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/wasm/Module_wasm.mk b/wasm/Module_wasm.mk
index 0ef8c4c6aaf4..d6f507a005df 100644
--- a/wasm/Module_wasm.mk
+++ b/wasm/Module_wasm.mk
@@ -13,6 +13,8 @@ ifeq ($(OS),EMSCRIPTEN)
$(eval $(call gb_Module_add_targets,wasm,\
CustomTarget_wasm-qt5-mandelbrot_moc \
Executable_wasm-qt5-mandelbrot \
+ CustomTarget_components \
+ Library_components \
))
endif