This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch windows-amd64
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 06d1098e47ad5559ab5a0e8200f872810733992b
Author: Damjan Jovanovic <dam...@apache.org>
AuthorDate: Sun Jan 12 11:30:44 2025 +0200

    Add gbuild targets for Configuration (*.xcs, *.xcu).
    
    Partially fixes: https://bz.apache.org/ooo/show_bug.cgi?id=118386
    Patch by: Michael Stahl <mst@...>
    Review by: me
---
 main/solenv/gbuild/Configuration.mk     | 445 ++++++++++++++++++++++++++++++++
 main/solenv/gbuild/TargetLocations.mk   |  22 ++
 main/solenv/gbuild/gbuild.mk            |   1 +
 main/solenv/gbuild/platform/linux.mk    |   3 +
 main/solenv/gbuild/platform/macosx.mk   |   3 +
 main/solenv/gbuild/platform/solaris.mk  |   3 +
 main/solenv/gbuild/platform/windows.mk  |   3 +
 main/solenv/gbuild/platform/winmingw.mk |   3 +
 8 files changed, 483 insertions(+)

diff --git a/main/solenv/gbuild/Configuration.mk 
b/main/solenv/gbuild/Configuration.mk
new file mode 100644
index 0000000000..59b78cd439
--- /dev/null
+++ b/main/solenv/gbuild/Configuration.mk
@@ -0,0 +1,445 @@
+#***************************************************************
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#***************************************************************
+
+# Configuration files: a bit of an overview of the targets:
+#
+# Configuration
+# => XcsTarget: schemas
+#       => buildtools
+#       => Xcs source
+# => XcuDataTarget: data
+#       => buildtools
+#    => XcsTarget (schema)
+#       => Xcu data source
+# => XcuModuleTaret: modules
+#       => buildtools
+#       => Xcu data source
+# => XcuLangpackTarget: langpack (per lang)
+#       => buildtools
+#       => Xcu data source
+# => zip (per lang)
+#       => XcuResTarget: resources (per lang)
+#          => buildtools
+#          => XcuMergeTarget: merge
+#          => buildtools (cfgex)
+#             => Xcu data source
+#          => localize.sdf
+#       => XcsTarget (schema)
+
+# Per-repo pattern rules for each repository do not work for all targets
+# because the prerequisites of some targets need to have the stem mangled
+# and this does not seem to be possible in GNU make because when the stem is
+# matched variables have already been expanded (this was possible in dmake).
+#
+# So to keep things consistent the Configuration takes a parameter for the
+# repository and all targets use that to find the source file.
+#
+# Targets where % rule per repo works: XcsTarget XcuDataTarget XcuMergeTarget
+# fails: XcuModuleTarget XcuLangpackTarget XcuResTarget
+#
+gb_Configuration__get_source = $($(gb_Configuration_REPO_$(1)))/$(2)
+
+
+# XcsTarget class
+
+# need to locate a schema file corresponding to some XCU file in the outdir
+define gb_XcsTarget_for_XcuTarget
+$(call gb_XcsTarget_get_outdir_target,$(basename $(1)).xcs)
+endef
+
+gb_Configuration_LANGS := en-US $(filter-out en-US,$(gb_WITH_LANG))
+gb_Configuration_REPOSITORYNAMES := $(gb_Helper_REPOSITORYNAMES)
+
+gb_XcsTarget_XSLT_SchemaVal := $(OUTDIR)/xml/processing/schema_val.xsl
+gb_XcsTarget_XSLT_Sanity := $(OUTDIR)/xml/processing/sanity.xsl
+gb_XcsTarget_XSLT_SchemaTrim := $(OUTDIR)/xml/processing/schema_trim.xsl
+gb_XcsTarget_DTD_Schema := $(OUTDIR)/xml/registry/component-schema.dtd
+
+define gb_XcsTarget__command
+$(call gb_Output_announce,$(2),$(true),XCS,1)
+$(call gb_Helper_abbreviate_dirs_native,\
+       mkdir -p $(dir $(1)) && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1).val \
+               --stringparam componentName $(subst /,.,$(basename $(XCSFILE))) 
\
+               --stringparam root $(subst $(XCSFILE),,$(3)) \
+               $(gb_XcsTarget_XSLT_SchemaVal) \
+               $(3) \
+       && rm $(1).val && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1).sanity \
+               $(gb_XcsTarget_XSLT_Sanity) \
+               $(3) \
+       && rm $(1).sanity && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1) \
+               $(gb_XcsTarget_XSLT_SchemaTrim) \
+               $(3))
+endef
+
+$(call gb_XcsTarget_get_target,%) : \
+           $(gb_XcsTarget_XSLT_SchemaVal) $(gb_XcsTarget_XSLT_Sanity) \
+               $(gb_XcsTarget_XSLT_SchemaTrim) $(gb_XcsTarget_DTD_Schema)
+       $(call gb_XcsTarget__command,$@,$*,$(filter %.xcs,$^))
+
+$(call gb_XcsTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCS,1)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_XcsTarget_get_target,$*) \
+                         $(call gb_XcsTarget_get_outdir_target,$(XCSFILE)))
+
+$(call gb_XcsTarget_get_outdir_target,%) :
+       $(call gb_Helper_abbreviate_dirs,\
+               $(call gb_Deliver_deliver,$<,$@))
+
+
+# XcuDataTarget class
+
+gb_XcuTarget_XSLT_AllLang := $(OUTDIR)/xml/processing/alllang.xsl
+gb_XcuDataTarget_XSLT_DataVal := $(OUTDIR)/xml/processing/data_val.xsl
+gb_XcuDataTarget_DTD_ComponentUpdate := 
$(OUTDIR)/xml/registry/component-update.dtd
+
+define gb_XcuDataTarget__command
+$(call gb_Output_announce,$(2),$(true),XCU,2)
+$(call gb_Helper_abbreviate_dirs_native,\
+       mkdir -p $(dir $(1)) && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1).val \
+               --stringparam xcs $(call gb_XcsTarget_for_XcuTarget,$(XCUFILE)) 
\
+               --stringparam schemaRoot $(call 
gb_XcsTarget_get_outdir_target,) \
+               --path $(gb_Configuration_registry) \
+               $(gb_XcuDataTarget_XSLT_DataVal) \
+               $(3) \
+       && rm -f $(1).val && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1) \
+               --stringparam xcs $(call gb_XcsTarget_for_XcuTarget,$(XCUFILE)) 
\
+               --stringparam schemaRoot $(call 
gb_XcsTarget_get_outdir_target,) \
+               --path $(gb_Configuration_registry) \
+               $(gb_XcuTarget_XSLT_AllLang) \
+               $(3))
+endef
+
+$(call gb_XcuDataTarget_get_target,%) : $(gb_XcuDataTarget_XSLT_DataVal) \
+               $(gb_XcuTarget_XSLT_AllLang) 
$(gb_XcuDataTarget_DTD_ComponentUpdate)
+       $(call gb_XcuDataTarget__command,$@,$*,$(filter %.xcu,$^))
+
+$(call gb_XcuDataTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCU,2)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_XcuDataTarget_get_target,$*) \
+                         $(call gb_XcuDataTarget_get_outdir_target,$(XCUFILE)))
+
+$(call gb_XcuDataTarget_get_outdir_target,%) :
+       $(call gb_Helper_abbreviate_dirs,\
+               $(call gb_Deliver_deliver,$<,$@))
+
+
+# XcuModuleTarget class
+
+define gb_XcuDataSource_for_XcuModuleTarget
+$(call gb_Configuration__get_source,$(1),$(basename $(subst -,.,$(basename 
$(2)))).xcu)
+endef
+
+define gb_XcsTarget_for_XcuModuleTarget
+$(call gb_XcsTarget_get_outdir_target,$(basename $(subst -,.,$(basename 
$(1)))).xcs)
+endef
+
+define gb_XcuModuleTarget__command
+$(call gb_Output_announce,$(2),$(true),XCU,3)
+$(call gb_Helper_abbreviate_dirs_native,\
+       mkdir -p $(dir $(1)) && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1) \
+               --stringparam xcs $(4) \
+               --stringparam schemaRoot $(call 
gb_XcsTarget_get_outdir_target,) \
+               --stringparam module $(notdir $(subst -,/,$(basename $(notdir 
$(2))))) \
+               $(gb_XcuTarget_XSLT_AllLang) \
+               $(3))
+endef
+
+$(call gb_XcuModuleTarget_get_target,%) : $(gb_XcuTarget_XSLT_AllLang)
+       $(call gb_XcuModuleTarget__command,$@,$*,$(filter %.xcu,$^),$(filter 
%.xcs,$^))
+
+$(call gb_XcuModuleTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCU,3)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_XcuModuleTarget_get_target,$*) \
+                         $(call 
gb_XcuModuleTarget_get_outdir_target,$(XCUFILE)))
+
+$(call gb_XcuModuleTarget_get_outdir_target,%) :
+       $(call gb_Helper_abbreviate_dirs,\
+               $(call gb_Deliver_deliver,$<,$@))
+
+
+# XcuLangpackTarget class
+
+gb_XcuLangpackTarget__get_outdir_target_with_lang = \
+ $(call gb_XcuLangpackTarget_get_outdir_target,$(basename $(1))-$(2)$(suffix 
$(1)))
+gb_XcuLangpackTarget__get_target_with_lang = \
+ $(call gb_XcuLangpackTarget_get_target,$(basename $(1))-$(2)$(suffix $(1)))
+
+gb_XcuLangpackTarget_SED_delcomment := $(OUTDIR)/xml/processing/delcomment.sed
+
+define gb_XcuLangpackTarget__command
+$(call gb_Output_announce,$(2),$(true),XCU,4)
+$(call gb_Helper_abbreviate_dirs,\
+       mkdir -p $(dir $(1)) && \
+       sed -e "s/__LANGUAGE__/$(LANG)/" -f 
$(gb_XcuLangpackTarget_SED_delcomment)\
+           $(3) > $(1))
+endef
+
+$(call gb_XcuLangpackTarget_get_target,%) : \
+               $(gb_XcuLangpackTarget_SED_delcomment)
+       $(call gb_XcuLangpackTarget__command,$@,$*,$(filter %.tmpl,$^))
+
+$(call gb_XcuLangpackTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCU,4)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(foreach lang,$(gb_Configuration_LANGS),\
+                         $(call 
gb_XcuLangpackTarget__get_target_with_lang,$*,$(lang)) \
+                         $(call 
gb_XcuLangpackTarget__get_outdir_target_with_lang,$(XCUFILE),$(lang))))
+
+$(call gb_XcuLangpackTarget_get_outdir_target,%) :
+       $(call gb_Helper_abbreviate_dirs,\
+               $(call gb_Deliver_deliver,$<,$@))
+
+
+# XcuMergeTarget class
+
+gb_XcuMergeTarget_CFGEXTARGET := $(call gb_Executable_get_target,cfgex)
+gb_XcuMergeTarget_CFGEXCOMMAND := \
+       $(gb_CFGEXPRECOMMAND) $(gb_XcuMergeTarget_CFGEXTARGET)
+gb_XcuMergeTarget_SDFLOCATION := $(LOCDIR)/l10n/$(INPATH)/misc/sdf/
+
+# PRJNAME is computed from the stem (parameter $(2))
+define gb_XcuMergeTarget__command
+$(call gb_Output_announce,$(2),$(true),XCU,5)
+$(call gb_Helper_abbreviate_dirs_native,\
+       mkdir -p $(dir $(1)) && \
+       $(gb_XcuMergeTarget_CFGEXCOMMAND) \
+               -p $(firstword $(subst /, ,$(2))) \
+               -i $(3) \
+               -o $(1) \
+               -m $(SDF) \
+               -l all)
+endef
+
+$(call gb_XcuMergeTarget_get_target,%) : | $(gb_XcuMergeTarget_CFGEXTARGET)
+       $(if $(SDF),$(call gb_XcuMergeTarget__command,$@,$*,$(filter 
%.xcu,$^)),mkdir -p $(dir $@) && cp $(filter %.xcu,$^) $@)
+
+$(call gb_XcuMergeTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCU,5)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_XcuMergeTarget_get_target,$*))
+
+# $(call gb_XcuMergeTarget_XcuMergeTarget,target,zipfile,prefix,xcufile)
+define gb_XcuMergeTarget_XcuMergeTarget
+$(call gb_XcuMergeTarget_get_target,$(1)) : \
+       $(call gb_Configuration__get_source,$(2),$(3)/$(4)) \
+       $(realpath $(gb_XcuMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf)
+$(call gb_XcuMergeTarget_get_target,$(1)) : \
+       SDF := $(realpath $(gb_XcuMergeTarget_SDFLOCATION)$(dir 
$(1))localize.sdf)
+endef
+
+
+# XcuResTarget class
+
+# locale is extracted from the stem (parameter $(2))
+define gb_XcuResTarget__command
+$(call gb_Output_announce,$(2),$(true),XCU,6)
+$(call gb_Helper_abbreviate_dirs_native,\
+       mkdir -p $(dir $(1)) && \
+       $(gb_XSLTPROC) --nonet \
+               -o $(1) \
+               --stringparam xcs $(call gb_XcsTarget_for_XcuTarget,$(XCUFILE)) 
\
+               --stringparam schemaRoot $(call 
gb_XcsTarget_get_outdir_target,) \
+               --stringparam locale $(word 2,$(subst /, ,$(2))) \
+               --path $(gb_Configuration_registry) \
+               $(gb_XcuTarget_XSLT_AllLang) \
+               $(3))
+endef
+
+$(call gb_XcuResTarget_get_target,%) : $(gb_XcuTarget_XSLT_AllLang)
+       $(call gb_XcuResTarget__command,$@,$*,$(filter %.xcu,$^))
+
+$(call gb_XcuResTarget_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),XCU,6)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_XcuResTarget_get_target,$*))
+
+# $(call gb_XcuResTarget_XcuResTarget,target,zipfile,prefix,xcufile,lang)
+# this depends either on the source or on the merge target (if WITH_LANG)
+define gb_XcuResTarget_XcuResTarget
+ifeq ($(strip $(gb_WITH_LANG)),)
+$(call gb_XcuResTarget_get_target,$(1)) : \
+       $(call gb_Configuration__get_source,$(2),$(3)/$(4))
+else
+$(call gb_XcuResTarget_get_target,$(1)) : \
+       $(call gb_XcuMergeTarget_get_target,$(3)/$(4))
+endif
+$(call gb_XcuResTarget_get_target,$(1)) : \
+       $(call gb_XcsTarget_for_XcuTarget,$(4))
+$(call gb_XcuResTarget_get_target,$(1)) : XCUFILE := $(4)
+endef
+
+
+# Configuration class
+
+$(call gb_Configuration_get_clean_target,%) :
+       $(call gb_Output_announce,$*,$(false),CFG,1)
+       $(call gb_Helper_abbreviate_dirs,\
+               rm -f $(call gb_Configuration_get_target,$*))
+
+$(call gb_Configuration_get_target,%) :
+       $(call gb_Output_announce,$*,$(true),CFG,1)
+       $(call gb_Helper_abbreviate_dirs,\
+               mkdir -p $(dir $@) && touch $@)
+
+# $(call gb_Configuration_Configuration,zipfile,repo)
+# cannot use target local variable for REPO because it's needed in prereq
+define gb_Configuration_Configuration
+$(if $(filter $(2),$(gb_Configuration_REPOSITORYNAMES)),,\
+  $(error Configuration: no or invalid repository given; known repositories: \
+  $(gb_Configuration_REPOSITORYNAMES)))
+$(eval gb_Configuration_REPO_$(1) := $(2))
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+       $(call gb_Zip_Zip,$(1)_$(lang),$(call 
gb_XcuResTarget_get_target,$(1)/$(lang)))))
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+       $(call gb_Configuration_get_target,$(1)) : \
+        $(call gb_Zip_get_final_target,$(1)_$(lang))))
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+       $(call gb_Configuration_get_clean_target,$(1)) : \
+        $(call gb_Zip_get_clean_target,$(1)_$(lang))))
+$$(eval $$(call gb_Module_register_target,$(call 
gb_Configuration_get_target,$(1)),$(call 
gb_Configuration_get_clean_target,$(1))))
+endef
+
+# $(call gb_Configuration_add_schema,zipfile,prefix,xcsfile)
+define gb_Configuration_add_schema
+$(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcsTarget_get_clean_target,$(2)/$(3))
+$(call gb_Configuration_get_target,$(1)) : \
+       $(call gb_XcsTarget_get_outdir_target,$(3))
+$(call gb_XcsTarget_get_target,$(2)/$(3)) : \
+       $(call gb_Configuration__get_source,$(1),$(2)/$(3))
+$(call gb_XcsTarget_get_target,$(2)/$(3)) : XCSFILE := $(3)
+$(call gb_XcsTarget_get_clean_target,$(2)/$(3)) : XCSFILE := $(3)
+$(call gb_XcsTarget_get_outdir_target,$(3)) : \
+       $(call gb_XcsTarget_get_target,$(2)/$(3))
+$(call gb_Deliver_add_deliverable,$(call gb_XcsTarget_get_outdir_target,$(3)),\
+       $(call gb_XcsTarget_get_target,$(2)/$(3)))
+endef
+
+#$(call gb_Configuration_add_schemas,zipfile,prefix,xcsfiles)
+define gb_Configuration_add_schemas
+$(foreach xcs,$(3),$(eval $(call 
gb_Configuration_add_schema,$(1),$(2),$(xcs))))
+endef
+
+# $(call gb_Configuration_add_data,zipfile,prefix,xcufile)
+define gb_Configuration_add_data
+$(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcuDataTarget_get_clean_target,$(2)/$(3))
+$(call gb_Configuration_get_target,$(1)) : \
+       $(call gb_XcuDataTarget_get_outdir_target,$(3))
+$(call gb_XcuDataTarget_get_target,$(2)/$(3)) : \
+       $(call gb_Configuration__get_source,$(1),$(2)/$(3)) \
+       $(call gb_XcsTarget_for_XcuTarget,$(3))
+$(call gb_XcuDataTarget_get_target,$(2)/$(3)) : XCUFILE := $(3)
+$(call gb_XcuDataTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3)
+$(call gb_XcuDataTarget_get_outdir_target,$(3)) : \
+       $(call gb_XcuDataTarget_get_target,$(2)/$(3))
+$(call gb_Deliver_add_deliverable,\
+       $(call gb_XcuDataTarget_get_outdir_target,$(3)),\
+       $(call gb_XcuDataTarget_get_target,$(2)/$(3)))
+endef
+
+#$(call gb_Configuration_add_schemas,zipfile,prefix,xcufiles)
+define gb_Configuration_add_datas
+$(foreach xcu,$(3),$(eval $(call gb_Configuration_add_data,$(1),$(2),$(xcu))))
+endef
+
+# $(call gb_Configuration_add_spool_module,zipfile,prefix,xcufile)
+define gb_Configuration_add_spool_module
+$(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcuModuleTarget_get_clean_target,$(2)/$(3))
+$(call gb_Configuration_get_target,$(1)) : \
+       $(call gb_XcuModuleTarget_get_outdir_target,$(3))
+$(call gb_XcuModuleTarget_get_target,$(2)/$(3)) : \
+       $(call gb_XcuDataSource_for_XcuModuleTarget,$(1),$(2)/$(3)) \
+       $(call gb_XcsTarget_for_XcuModuleTarget,$(3))
+$(call gb_XcuModuleTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3)
+$(call gb_XcuModuleTarget_get_outdir_target,$(3)) : \
+       $(call gb_XcuModuleTarget_get_target,$(2)/$(3))
+$(call gb_Deliver_add_deliverable,\
+       $(call gb_XcuModuleTarget_get_outdir_target,$(3)),\
+       $(call gb_XcuModuleTarget_get_target,$(2)/$(3)))
+endef
+
+# $(call gb_Configuration_add_spool_modules,zipfile,prefix,xcufiles)
+define gb_Configuration_add_spool_modules
+$(foreach xcu,$(3),$(eval \
+       $(call gb_Configuration_add_spool_module,$(1),$(2),$(xcu))))
+endef
+
+define gb_Configuration__add_langpack
+$(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcuLangpackTarget_get_clean_target,$(2)/$(3))
+$(call gb_Configuration_get_target,$(1)) : \
+       $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4))
+$(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) : \
+       $($(gb_Configuration_REPO_$(1)))/$(2)/$(3).tmpl
+$(call gb_XcuLangpackTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3)
+$(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) : LANG := 
$(4)
+$(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4)) : \
+       $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4))
+$(call gb_Deliver_add_deliverable,\
+       $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4)),\
+       $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)))
+endef
+
+# $(call gb_Configuration_add_spool_langpack,zipfile,prefix,xcufile)
+define gb_Configuration_add_spool_langpack
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+       $(call gb_Configuration__add_langpack,$(1),$(2),$(strip $(3)),$(lang))))
+endef
+
+# $(call gb_Configuration_add_localized_data,zipfile,prefix,xcufile)
+define gb_Configuration_add_localized_data
+$(eval $(call gb_Configuration_add_data,$(1),$(2),$(3)))
+ifneq ($(strip $(gb_WITH_LANG)),)
+$(eval $(call gb_XcuMergeTarget_XcuMergeTarget,$(2)/$(3),$(1),$(2),$(3)))
+$(eval $(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcuMergeTarget_get_clean_target,$(2)/$(3)))
+endif
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+ $(call 
gb_XcuResTarget_XcuResTarget,$(1)/$(lang)/$(3),$(1),$(2),$(3),$(lang))))
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+    $(call gb_Zip_add_file,$(1)_$(lang),$(3))))
+$(foreach lang,$(gb_Configuration_LANGS),$(eval \
+  $(call gb_Configuration_get_clean_target,$(1)) : \
+       $(call gb_XcuResTarget_get_clean_target,$(1)/$(lang)/$(3))))
+endef
+
+# $(call gb_Configuration_add_localized_datas,zipfile,prefix,xcufile)
+define gb_Configuration_add_localized_datas
+$(foreach xcu,$(3),$(eval \
+       $(call gb_Configuration_add_localized_data,$(1),$(2),$(xcu))))
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/main/solenv/gbuild/TargetLocations.mk 
b/main/solenv/gbuild/TargetLocations.mk
index 34ef104229..d437e49ce8 100644
--- a/main/solenv/gbuild/TargetLocations.mk
+++ b/main/solenv/gbuild/TargetLocations.mk
@@ -32,6 +32,13 @@ gb_ResTarget_get_outdir_imagelist_target = 
$(OUTDIR)/res/img/$(1).ilst
 gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res
 gb_Jar_get_outdir_target = $(OUTDIR)/bin/$(1).jar
 gb_Zip_get_outdir_target = $(OUTDIR)/pck/$(1).zip
+# outdir targets: $(1) is path
+gb_Configuration_registry = $(OUTDIR)/xml/registry
+gb_XcsTarget_get_outdir_target = $(gb_Configuration_registry)/schema/$(1)
+gb_XcuDataTarget_get_outdir_target = $(gb_Configuration_registry)/data/$(1)
+gb_XcuLangpackTarget_get_outdir_target = 
$(gb_Configuration_registry)/spool/$(1)
+gb_XcuModuleTarget_get_outdir_target = $(gb_Configuration_registry)/spool/$(1)
+
 
 define gb_Library_get_target
 $(patsubst $(1):%,$(gb_Library_OUTDIRLOCATION)/%,$(filter $(filter 
$(1),$(gb_Library_TARGETS)):%,$(gb_Library_FILENAMES)))
@@ -96,6 +103,14 @@ gb_SrsPartMergeTarget_get_target = 
$(WORKDIR)/SrsPartMergeTarget/$(1)
 gb_SrsPartTarget_get_target = $(WORKDIR)/SrsPartTarget/$(1)
 gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs
 gb_WinResTarget_get_target = 
$(WORKDIR)/WinResTarget/$(1)$(gb_WinResTarget_POSTFIX)
+# workdir targets: $(1) is prefix/path
+gb_Configuration_get_target = $(WORKDIR)/Configuration/$(1).done
+gb_XcsTarget_get_target = $(WORKDIR)/XcsTarget/$(1)
+gb_XcuDataTarget_get_target = $(WORKDIR)/XcuDataTarget/$(1)
+gb_XcuLangpackTarget_get_target = $(WORKDIR)/XcuLangpackTarget/$(1)
+gb_XcuModuleTarget_get_target = $(WORKDIR)/XcuModuleTarget/$(1)
+gb_XcuMergeTarget_get_target = $(WORKDIR)/XcuMergeTarget/$(1)
+gb_XcuResTarget_get_target = $(WORKDIR)/XcuResTarget/$(1)
 gb_Zip_get_target = $(WORKDIR)/Zip/$(1).zip
 gb_Zip_get_final_target = $(WORKDIR)/Zip/$(1).done
 
@@ -135,6 +150,13 @@ $(eval $(call gb_Helper_make_clean_targets,\
        CustomTarget \
        UnoApiTarget \
        Zip \
+       XcsTarget \
+       XcuDataTarget \
+       XcuModuleTarget \
+       XcuLangpackTarget \
+       XcuMergeTarget \
+       XcuResTarget \
+       Configuration \
 ))
 
 $(eval $(call gb_Helper_make_outdir_clean_targets,\
diff --git a/main/solenv/gbuild/gbuild.mk b/main/solenv/gbuild/gbuild.mk
index f874d3733d..312445daa2 100644
--- a/main/solenv/gbuild/gbuild.mk
+++ b/main/solenv/gbuild/gbuild.mk
@@ -266,6 +266,7 @@ include $(foreach class, \
        Module \
        UnoApiTarget \
        Zip \
+       Configuration \
 ,$(GBUILDDIR)/$(class).mk)
 
 # optional extensions that should never be essential
diff --git a/main/solenv/gbuild/platform/linux.mk 
b/main/solenv/gbuild/platform/linux.mk
index 02b8830a39..233fa2aa73 100644
--- a/main/solenv/gbuild/platform/linux.mk
+++ b/main/solenv/gbuild/platform/linux.mk
@@ -481,6 +481,9 @@ gb_Library_COMPONENTPREFIXES := \
     URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
     NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
 
+# Configuration
+gb_CFGEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
 # UnoApiTarget
 
 gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
diff --git a/main/solenv/gbuild/platform/macosx.mk 
b/main/solenv/gbuild/platform/macosx.mk
index 0928dc5005..1a5451c118 100644
--- a/main/solenv/gbuild/platform/macosx.mk
+++ b/main/solenv/gbuild/platform/macosx.mk
@@ -522,6 +522,9 @@ gb_Library_COMPONENTPREFIXES := \
     URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
     NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
 
+# Configuration
+gb_CFGEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
+
 # UnoApiTarget
 
 gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
diff --git a/main/solenv/gbuild/platform/solaris.mk 
b/main/solenv/gbuild/platform/solaris.mk
index fc6e30d9e0..2f64bcdb72 100644
--- a/main/solenv/gbuild/platform/solaris.mk
+++ b/main/solenv/gbuild/platform/solaris.mk
@@ -455,6 +455,9 @@ gb_Library_COMPONENTPREFIXES := \
     URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
     NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
 
+# Configuration
+gb_CFGEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
 # UnoApiTarget
 
 gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc
diff --git a/main/solenv/gbuild/platform/windows.mk 
b/main/solenv/gbuild/platform/windows.mk
index 70a1643355..a013b124c3 100644
--- a/main/solenv/gbuild/platform/windows.mk
+++ b/main/solenv/gbuild/platform/windows.mk
@@ -809,6 +809,9 @@ gb_Library_COMPONENTPREFIXES := \
     URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
     NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
 
+# Configuration
+gb_CFGEXPRECOMMAND :=  PATH="$${PATH}:$(OUTDIR)/bin"
+
 # UnoApiTarget
 
 gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe
diff --git a/main/solenv/gbuild/platform/winmingw.mk 
b/main/solenv/gbuild/platform/winmingw.mk
index 379a1e88d0..caeb4a6142 100644
--- a/main/solenv/gbuild/platform/winmingw.mk
+++ b/main/solenv/gbuild/platform/winmingw.mk
@@ -734,6 +734,9 @@ gb_Library_COMPONENTPREFIXES := \
     URELIB:vnd.sun.star.expand:\dURE_INTERNAL_LIB_DIR/ \
     NONE:vnd.sun.star.expand:\dOOO_INBUILD_SHAREDLIB_DIR/ \
 
+# Configuration
+gb_CFGEXPRECOMMAND :=  PATH="$${PATH}:$(OUTDIR)/bin"
+
 # UnoApiTarget
 
 gb_UnoApiTarget_IDLCTARGET := $(OUTDIR)/bin/idlc.exe

Reply via email to