Unify condition names and fix "else" paths

Drop Build prefix and settle on Lib and Exe prefixes. Also add a
note about the "else" part of the condition and fix offenders.
While at it, define COND_LIB_SAL_TEXTENC to be used by sal to
prevent diverting coditions in build and cxx code.

Change-Id: I944587ca1ccbe46b765d1a631a7214c8126fe951
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128136
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski 2022-01-08 06:47:02 +01:00
parent 92a90cf5cc
commit ed1aa172f8
13 changed files with 32 additions and 26 deletions

View file

@ -44,7 +44,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
$(if $(filter iOS,$(OS)),LibreOffice) \
lngconvex \
localize \
$(call gb_CondBuildLockfile,lockfile) \
$(call gb_CondExeLockfile,lockfile) \
makedepend \
mbsdiff \
osl_process_child \
@ -147,7 +147,7 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,brand, \
$(call gb_Helper_optional,FUZZERS,dbffuzzer) \
$(if $(filter-out ANDROID HAIKU iOS MACOSX WNT,$(OS)),oosplash) \
soffice_bin \
$(call gb_CondBuildUnopkg, \
$(call gb_CondExeUnopkg, \
unopkg_bin \
$(if $(filter WNT,$(OS)), \
unopkg \
@ -235,7 +235,7 @@ endif
$(eval $(call gb_Helper_register_executables_for_install,UREBIN,ure,\
$(if $(and $(ENABLE_JAVA),$(filter-out HAIKU MACOSX WNT,$(OS)),$(filter DESKTOP,$(BUILD_TYPE))),javaldx) \
$(call gb_CondBuildRegistryTools, \
$(call gb_CondExeRegistryTools, \
regmerge \
regview \
) \
@ -603,7 +603,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
))
$(eval $(call gb_Helper_register_plugins_for_install,PRIVATELIBS_URE,ure, \
$(call gb_CondSalTextEncodingLibrary,sal_textenc) \
$(call gb_CondLibSalTextenc,sal_textenc) \
))
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
@ -638,7 +638,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
$(call gb_Helper_optional,XMLHELP,ucpchelp1) \
ucphier1 \
ucppkg1 \
$(call gb_CondBuildUnopkg,unopkgapp) \
$(call gb_CondExeUnopkg,unopkgapp) \
xmlsecurity \
xsec_xmlsec \
xstor \

View file

@ -3772,7 +3772,7 @@ endif # SYSTEM_JFREEREPORT
define gb_Executable__register_bestreversemap
$(call gb_Executable_add_runtime_dependencies,bestreversemap,\
$(call gb_CondSalTextEncodingLibrary,$(call gb_Library_get_target_for_build,sal_textenc)) \
$(call gb_CondLibSalTextenc,$(call gb_Library_get_target_for_build,sal_textenc)) \
)
endef
@ -3789,7 +3789,7 @@ endef
define gb_Executable__register_cppumaker
$(call gb_Executable_add_runtime_dependencies,cppumaker,\
$(call gb_CondSalTextEncodingLibrary,$(call gb_Library_get_target,sal_textenc)) \
$(call gb_CondLibSalTextenc,$(call gb_Library_get_target,sal_textenc)) \
)
endef

View file

@ -33,11 +33,11 @@ $(eval $(call gb_Module_add_l10n_targets,desktop,\
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,desktop,\
Executable_soffice_bin \
$(call gb_CondBuildUnopkg,Executable_unopkg_bin) \
$(call gb_CondExeUnopkg,Executable_unopkg_bin) \
$(if $(ENABLE_BREAKPAD),Executable_minidump_upload) \
Library_migrationoo2 \
Library_migrationoo3 \
$(call gb_CondBuildUnopkg,Library_unopkgapp) \
$(call gb_CondExeUnopkg,Library_unopkgapp) \
Package_scripts \
$(if $(ENABLE_PAGEIN), \
Pagein_calc \
@ -79,7 +79,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
Executable_sweb \
Executable_swriter \
Executable_unoinfo \
$(call gb_CondBuildUnopkg, \
$(call gb_CondExeUnopkg, \
Executable_unopkg \
Executable_unopkg_com \
) \

View file

@ -12,7 +12,7 @@ $(eval $(call gb_Package_Package,desktop_scripts_install,$(SRCDIR)/desktop/scrip
ifeq (,$(filter MACOSX WNT,$(OS)))
$(eval $(call gb_Package_add_file,desktop_scripts_install,$(LIBO_BIN_FOLDER)/gdbtrace,gdbtrace))
ifneq (,$(call gb_CondBuildUnopkg,$(true)))
ifneq (,$(call gb_CondExeUnopkg,$(true)))
$(eval $(call gb_Package_add_file,desktop_scripts_install,$(LIBO_BIN_FOLDER)/unopkg,unopkg.sh))
endif

View file

@ -75,7 +75,7 @@ $(eval $(call gb_Executable_add_exception_objects,idlc,\
# to something other than listed in Impl_getTextEncodingData, because osl_getThreadTextEncoding()
# returns Windows ACP, calling FullTextEncodingData ctor which loads the not-yet-built library
$(call gb_Executable_add_runtime_dependencies,idlc, \
$(call gb_Library_get_target,sal_textenc) \
$(call gb_CondLibSalTextenc,$(call gb_Library_get_target,sal_textenc)) \
)
# vim:set noet sw=4 ts=4:

View file

@ -11,7 +11,7 @@ $(eval $(call gb_Module_Module,registry))
$(eval $(call gb_Module_add_targets,registry,\
Library_reg \
$(call gb_CondBuildRegistryTools, \
$(call gb_CondExeRegistryTools, \
Executable_regmerge \
Executable_regview \
StaticLibrary_registry_helper \

View file

@ -33,6 +33,7 @@ $(eval $(call gb_Library_add_defs,sal,\
-DRTL_OS="\"$(RTL_OS)\"" \
-DRTL_ARCH="\"$(RTL_ARCH)\"" \
-DSRCDIR="\"$(SRCDIR)\"" \
$(call gb_CondLibSalTextenc,-DCOND_LIB_SAL_TEXTENC) \
))
$(eval $(call gb_Library_use_libraries,sal,\
@ -132,7 +133,7 @@ $(eval $(call gb_Library_add_cxxflags,sal,\
))
endif
ifeq (,$(call gb_CondSalTextEncodingLibrary,$(true)))
ifeq (,$(call gb_CondLibSalTextenc,$(true)))
$(eval $(call gb_Library_add_exception_objects,sal,\
sal/textenc/context \
sal/textenc/convertbig5hkscs \

View file

@ -14,7 +14,7 @@ $(eval $(call gb_Module_add_targets,sal,\
$(if $(filter $(OS),ANDROID), \
Library_lo-bootstrap) \
Library_sal \
$(call gb_CondSalTextEncodingLibrary,Library_sal_textenc) \
$(call gb_CondLibSalTextenc,Library_sal_textenc) \
))
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))

View file

@ -351,7 +351,7 @@ ImplTextEncodingData const aImplJavaUtf8TextEncodingData
namespace {
#if defined DISABLE_DYNLOADING || defined ANDROID
#ifndef COND_LIB_SAL_TEXTENC
extern "C" ImplTextEncodingData const * sal_getFullTextEncodingData(
rtl_TextEncoding); // from tables.cxx in sal_textenc library

View file

@ -16,7 +16,7 @@ $(eval $(call gb_Module_add_targets_for_build,solenv,\
ifeq (,$(LOCKFILE))
$(eval $(call gb_Module_add_targets_for_build,solenv,\
$(call gb_CondBuildLockfile,Executable_lockfile) \
$(call gb_CondExeLockfile,Executable_lockfile) \
))
endif

View file

@ -7,15 +7,16 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
define gb_CondBuildUnopkg
$(if $(and $(filter DESKTOP,$(BUILD_TYPE)),$(if $(DISABLE_DYNLOADING),,$(true))),$(1),$(2))
endef
# IMPORTANT NOTE: make sure, the "else" part works as expected. This normally
# means, that the condition ends with "$(1),$(2))" or the reverse. It should
# just end in two (!) braces, otherwise you may need to use either the $(1)
# or the $(2) multiple times.
define gb_CondBuildLockfile
define gb_CondExeLockfile
$(if $(and $(filter-out ANDROID MACOSX iOS WNT,$(OS))),$(1),$(2))
endef
define gb_CondBuildRegistryTools
define gb_CondExeRegistryTools
$(if $(or $(DISABLE_DYNLOADING),$(ENABLE_MACOSX_SANDBOX)),$(2),$(1))
endef
@ -27,8 +28,12 @@ define gb_CondExeUno
$(if $(and $(filter DESKTOP,$(BUILD_TYPE)),$(if $(DISABLE_DYNLOADING),,$(true))),$(1),$(2))
endef
define gb_CondSalTextEncodingLibrary
$(if $(filter ANDROID,$(OS)),,$(if $(DISABLE_DYNLOADING),$(2),$(1)))
define gb_CondExeUnopkg
$(if $(and $(filter DESKTOP,$(BUILD_TYPE)),$(if $(DISABLE_DYNLOADING),,$(true))),$(1),$(2))
endef
define gb_CondLibSalTextenc
$(if $(or $(filter ANDROID,$(OS)),$(DISABLE_DYNLOADING)),$(2),$(1))
endef
# vim: set noet sw=4 ts=4:

View file

@ -24,7 +24,7 @@ gb_BUILD_TOOLS_executables = \
helpex \
idxdict \
javamaker \
$(call gb_CondBuildLockfile,lockfile) \
$(call gb_CondExeLockfile,lockfile) \
makedepend \
propex \
saxparser \

View file

@ -105,7 +105,7 @@ gb_LinkTarget__Lock := $(WORKDIR)/LinkTarget/link.lock
# No newline or space before endef!
define gb_LinkTarget__WantLock
$(if $(strip $(and \
$(call gb_CondBuildLockfile,$(true)), \
$(call gb_CondExeLockfile,$(true)), \
$(filter-out Executable/lockfile,$(1)), \
$(if $(filter FUZZERS,$(BUILD_TYPE)),,$(DISABLE_DYNLOADING)), \
$(filter CppunitTest Executable,$(TARGETTYPE)) \