summaryrefslogtreecommitdiff
path: root/postprocess
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-05-19 07:55:40 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-12-06 19:38:29 +0100
commit1c9a40299d328c78c035ca63ccdf22c5c669a03b (patch)
treece32754685a0b147ffb701efbbcaa24fa7e36083 /postprocess
parentba8b3751fa184c04b9dde4c371b7902e0a9271ff (diff)
gbuild: create services.rdb from built components
... and introduce the --enable-services-rdb-from-build option. Currently the build handles global build options redundant in a few places: * in Repository*mk + modules - the "real" build dependencies * the full services.rdb generation * the static UNO constructor map generation Also the component files don't reflect the really built components and so the RDB services generation must handle the whole options to select the correct components. So this optionally replaces the latter two by generating the list of components and it's constructors from the build itself. As a consequence, component files must now be split, so they reflect the real components in the libraries, otherwise the static constructor list will have missing symbols. IMHO this is more natural, as it happens in the same place already handling these build options for the sourcecode. This also adds a convenience helper to add multiple component files: gb_Library_set_componentfiles This is WIP and currently just works for the stripped WASM build, which introduces many more split component files in later patches. It also explicitly filters the gb_Rdb__URECOMPONENTS and the CppunitTest related components from the services.rdb. Maybe there is a good way to do this properly. Change-Id: I1b38a6f2c1e5221f18d7e5e756c30263b555d962 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126185 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'postprocess')
-rw-r--r--postprocess/CustomTarget_components.mk49
-rw-r--r--postprocess/Module_postprocess.mk1
-rw-r--r--postprocess/Rdb_services.mk7
3 files changed, 57 insertions, 0 deletions
diff --git a/postprocess/CustomTarget_components.mk b/postprocess/CustomTarget_components.mk
new file mode 100644
index 000000000000..3c202ed9988d
--- /dev/null
+++ b/postprocess/CustomTarget_components.mk
@@ -0,0 +1,49 @@
+# vim: set noet sw=4 ts=4:
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# 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_CustomTarget_CustomTarget,postprocess/components))
+
+ifeq (,$(gb_PARTIAL_BUILD))
+
+postprocess_WORKDIR := $(call gb_CustomTarget_get_workdir,postprocess)
+
+$(call gb_CustomTarget_get_target,postprocess/components): \
+ $(postprocess_WORKDIR)/services_constructors.list \
+
+gb_EMPTY :=
+define gb_NEWLINE
+
+$(gb_EMPTY)
+endef
+
+$(postprocess_WORKDIR)/services_componentfiles.list: \
+ $(call gb_Rdb_get_target,services) \
+ $(call gb_Rdb_get_target,ure/services) \
+ $(foreach comp,$(gb_ComponentTarget__ALLCOMPONENTS),$(call gb_ComponentTarget_get_source,$(comp))) \
+ | $(postprocess_WORKDIR)/.dir
+ $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
+ TEMPFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),1, \
+ $(foreach comp,$(sort $(gb_ComponentTarget__ALLCOMPONENTS)),$(call gb_ComponentTarget_get_source,$(comp))$(gb_NEWLINE))) && \
+ mv $$TEMPFILE $@
+
+$(postprocess_WORKDIR)/services_constructors.list: \
+ $(SRCDIR)/solenv/bin/constructors.py \
+ $(postprocess_WORKDIR)/services_componentfiles.list \
+ | $(postprocess_WORKDIR)/.dir
+ $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,2)
+ TEMPFILE=$(shell $(gb_MKTEMP)) && \
+ $(call gb_Helper_abbreviate_dirs,$(call gb_ExternalExecutable_get_command,python) $^) > $$TEMPFILE && \
+ $(call gb_Helper_replace_if_different_and_touch,$${TEMPFILE},$@)
+
+.PHONY: $(postprocess_WORKDIR)/services_componentfiles.list
+
+endif # gb_PARTIAL_BUILD
+
+# vim: set noet sw=4:
diff --git a/postprocess/Module_postprocess.mk b/postprocess/Module_postprocess.mk
index c1aa1dbc7e87..369feff99367 100644
--- a/postprocess/Module_postprocess.mk
+++ b/postprocess/Module_postprocess.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_Module_Module,postprocess))
# is reused in Package_registry!
$(eval $(call gb_Module_add_targets,postprocess,\
+ $(if $(ENABLE_SERVICES_RDB_FROM_BUILD),CustomTarget_components) \
CustomTarget_registry \
Rdb_services \
))
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index ed325128467a..8508341ee474 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -9,6 +9,9 @@
$(eval $(call gb_Rdb_Rdb_install,services))
+# see Makefile.gbuild for the gb_Rdb_add_components,services calls
+ifeq (,$(ENABLE_SERVICES_RDB_FROM_BUILD))
+
#
# "minimal" list of services for cross-compiling build tools
#
@@ -115,6 +118,7 @@ $(eval $(call gb_Rdb_add_components,services,\
slideshow/util/slideshow \
starmath/util/sm \
starmath/util/smd \
+ $(call gb_Helper_optional,BREAKPAD,svx/util/crashreport) \
svx/util/svx \
svx/util/textconversiondlgs \
sw/util/msword \
@@ -271,6 +275,7 @@ $(eval $(call gb_Rdb_add_components,services,\
reportdesign/util/rptui \
reportdesign/util/rptxml \
shell/source/backends/localebe/localebe1 \
+ sw/util/sw_mm \
$(if $(filter-out ANDROID iOS,$(OS)),\
connectivity/source/drivers/odbc/odbc \
) \
@@ -338,4 +343,6 @@ endif
endif # $(gb_Side),host
+endif # !ENABLE_SERVICES_RDB_FROM_BUILD
+
# vim: set noet sw=4 ts=4: