Fix the minimal build-tools target

The revert commits change the build-tools target for a DESKTOP
build to build the complete LO. This restores the original,
minimal one and also adds a whitelist of allowd build types.

OpenCL needs a configure switch, as it's status is also stored
in a config header, so preventing the build is not enough.

This also reverts:
- commit 802161a505272732566210e9ebbd8fe1b23fb86d
- commit 02d931a59e2966d0c2736db8dee7be3e3dcd6bae

Change-Id: Ibfcb0c54e72da1b7c2e63c082ea6586520a787fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102480
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
diff --git a/Makefile.gbuild b/Makefile.gbuild
index c90a9fe..cd7fc97 100644
--- a/Makefile.gbuild
+++ b/Makefile.gbuild
@@ -18,12 +18,7 @@ include $(BUILDDIR)/config_$(gb_Side).mk

include $(SRCDIR)/solenv/gbuild/gbuild.mk

# If cross-compiling to a DESKTOP platform, just use RepositoryModule_host.mk on the build platform, too
ifeq ($(gb_Side)-$(filter DESKTOP,$(BUILD_TYPE_FOR_HOST)),build-DESKTOP)
$(eval $(call gb_Module_make_global_targets,$(SRCDIR)/RepositoryModule_host.mk))
else
$(eval $(call gb_Module_make_global_targets,$(SRCDIR)/RepositoryModule_$(gb_Side).mk))
endif

upload-symbols:
	bin/upload_symbols.py $(WORKDIR)/symbols.zip $(BREAKPAD_SYMBOL_CONFIG) "$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)"
diff --git a/Makefile.in b/Makefile.in
index 7d12aff..8b8267f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -294,7 +294,7 @@ cross-toolset: bootstrap fetch
ifneq ($(OS),iOS)
	$(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(BUILDDIR)/Makefile fetch
endif
	$(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(if $(filter DESKTOP,$(BUILD_TYPE)),build,build-tools)
	$(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools

install-gdb-printers:
ifneq ($(filter-out WNT MACOSX iOS,$(OS)),)
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 2aa1456..d9fa980 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -3878,7 +3878,7 @@ $(call gb_Executable_add_runtime_dependencies,gengal,\
	$(call gb_Library_get_target,$(gb_CPPU_ENV)_uno) \
	$(if $(filter MACOSX,$(OS)),$(call gb_Library_get_target,vclplug_osx)) \
	$(if $(filter WNT,$(OS)),$(call gb_Library_get_target,vclplug_win)) \
	$(call gb_Package_get_target_for_build,postprocess_images) \
	$(if $(filter host,$(gb_Side)),$(call gb_Package_get_target,postprocess_images)) \
	$(call gb_Package_get_target_for_build,postprocess_registry) \
	$(INSTROOT_FOR_BUILD)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
	$(INSTROOT_FOR_BUILD)/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,fundamental) \
diff --git a/RepositoryModule_build.mk b/RepositoryModule_build.mk
index 9537ccd1..3432274 100644
--- a/RepositoryModule_build.mk
+++ b/RepositoryModule_build.mk
@@ -55,6 +55,41 @@ $(eval $(call gb_Module_add_moduledirs,cross_toolset,\
	unotools \
	ure \
	xmlreader \
	$(call gb_Helper_optional_for_host,DESKTOP, \
		$(if $(WITH_GALLERY_BUILD), \
			avmedia \
			basic \
			canvas \
			configmgr \
			connectivity \
			cppcanvas \
			drawinglayer \
			editeng \
			emfio \
			filter \
			framework \
			linguistic \
			officecfg \
			package \
			postprocess \
			sfx2 \
			shell \
			sot \
			svgio \
			svl \
			svtools \
			svx \
			toolkit \
			ucb \
			unoxml \
			uui \
			vcl \
			xmloff \
			xmlscript \
		) \
		helpcompiler \
		xmlhelp \
	) \
	$(call gb_Helper_optional,QADEVOOO,qadevOOo) \
))

diff --git a/configure.ac b/configure.ac
index e5b6ab7..6b7c456 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1626,6 +1626,11 @@ AC_ARG_ENABLE(ldap,
        [Disable LDAP support.]),
,enable_ldap=yes)

AC_ARG_ENABLE(opencl,
    AS_HELP_STRING([--disable-opencl],
        [Disable OpenCL support.]),
,enable_opencl=yes)

dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
@@ -3631,7 +3636,9 @@ if test "$_os" = "WINNT"; then
            WIN_MULTI_ARCH=""
            WIN_OTHER_ARCH=""
        fi
    else
    fi

    if test "$WIN_BUILD_ARCH" = "$WIN_HOST_ARCH"; then
        MSVC_BUILD_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_BUILD_ARCH"
        test_cl_exe "build" "$MSVC_BUILD_PATH"
    fi
@@ -4931,21 +4938,67 @@ if test "$cross_compiling" = "yes"; then
    sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
    # Don't bother having configure look for stuff not needed for the build platform anyway
    ./configure \
        --build="$build_alias" \
        --disable-cups \
        --disable-firebird-sdbc \
        --disable-gpgmepp \
        --disable-gstreamer-1-0 \
        --disable-gtk3 \
        --disable-mariadb-sdbc \
        --disable-online-update \
        --disable-opencl \
        --disable-pch \
        --disable-pdfimport \
        --disable-postgresql-sdbc \
        --disable-skia \
        --enable-icecream="$enable_icecream" \
        --with-parallelism="$with_parallelism" \
        --without-doxygen \
        --without-java \
        --without-webdav \
        --with-parallelism="$with_parallelism" \
        --with-theme="$with_theme" \
        --with-tls=openssl \
        $sub_conf_opts \
        --srcdir=$srcdir \
        2>&1 | sed -e 's/^/    /'
    test -f ./config_host.mk 2>/dev/null || exit

    # filter accepted build types
    BUILD_TARGETS_WHITELIST="
        AVMEDIA
        BOOST
        CLUCENE
        DBCONNECTIVITY
        DESKTOP
        DYNLOADING
        EPOXY
        EXPAT
        GLM
        GRAPHITE
        HARFBUZZ
        ICU
        LCMS2
        LIBJPEG_TURBO
        LIBLANGTAG
        LibO
        LIBFFI
        LIBPN
        LIBXML2
        LIBXSLT
        MDDS
        NATIVE
        OPENSSL
        ORCUS
        PYTHON
        SCRIPTING
        ZLIB
"
    # converts BUILD_TYPE and whitelist into non-whitespace, newlined lists, to use grep as a filter
    BUILD_TARGETS_WHITELIST=$(echo "$BUILD_TARGETS_WHITELIST" | sed -e '/^ *$/d' -e 's/ *//')
    BUILD_TARGETS="$(sed -ne '/^export BUILD_TYPE=/ { s/.*=// ; s/ /\n/gp }' config_host.mk)"
    BUILD_TARGETS="$(echo "$BUILD_TARGETS" | grep -F "$BUILD_TARGETS_WHITELIST" | tr '\n' ' ')"
    sed -i -e "s/ BUILD_TYPE=.*$/ BUILD_TYPE=$BUILD_TARGETS/" config_host.mk

    cp config_host.mk ../config_build.mk
    cp config_host_lang.mk ../config_build_lang.mk
    mv config.log ../config.Build.log
@@ -8823,13 +8876,6 @@ else
    AC_MSG_RESULT([internal])
    SYSTEM_LIBXSLT=
    BUILD_TYPE="$BUILD_TYPE LIBXSLT"

    if test "$cross_compiling" = "yes"; then
        AC_PATH_PROG(XSLTPROC, xsltproc, no)
        if test "$XSLTPROC" = "no"; then
            AC_MSG_ERROR([xsltproc is required])
        fi
    fi
fi
AC_SUBST(SYSTEM_LIBXSLT)
if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
@@ -11153,7 +11199,7 @@ dnl =================================================
dnl Check whether to build with OpenCL support.
dnl =================================================

if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE" -a "$enable_opencl" = "yes"; then
    # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
    # platform (optional at run-time, used through clew).
    BUILD_TYPE="$BUILD_TYPE OPENCL"
diff --git a/external/liblangtag/ExternalProject_liblangtag.mk b/external/liblangtag/ExternalProject_liblangtag.mk
index 060c6f3..51dc4f4 100644
--- a/external/liblangtag/ExternalProject_liblangtag.mk
+++ b/external/liblangtag/ExternalProject_liblangtag.mk
@@ -33,7 +33,8 @@ $(call gb_ExternalProject_get_state_target,liblangtag,build):
				$(if $(ENABLE_OPTIMIZED), \
					$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
				$(if $(call gb_Module__symbols_enabled,liblangtag),$(gb_DEBUGINFO_FLAGS))' \
		$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) "ac_cv_va_copy=no") \
		$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
		    $(if $(filter WNT,$(OS)),"lt_cv_c99_vsnprintf=yes" "ac_cv_va_copy=yes","ac_cv_va_copy=no")) \
		LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" \
		LIBXML2_LIBS="$(if $(filter WNT,$(OS)),-L$(call gb_UnpackedTarball_get_dir,libxml2)/win32/bin.msvc -llibxml2,$(LIBXML_LIBS))" \
		$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index c95794e..97db3e6 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -312,15 +312,18 @@ postprocess_FILES_main += \
		# VCL-unixdesktop.xcu must come after VCL.xcu
else ifeq (WNT,$(OS))
postprocess_FILES_main += \
	$(call gb_XcuModuleTarget_get_target,connectivity/registry/ado)/org/openoffice/Office/DataAccess/Drivers-ado.xcu \
	$(postprocess_MOD)/org/openoffice/Inet-wnt.xcu \
	$(postprocess_MOD)/org/openoffice/Office/Accelerators-unxwnt.xcu \
	$(postprocess_MOD)/org/openoffice/Office/Common-wnt.xcu \
	$(postprocess_MOD)/org/openoffice/Office/Paths-unxwnt.xcu \
	$(postprocess_MOD)/org/openoffice/ucb/Configuration-win.xcu
		# Inet-wnt.xcu must come after Inet.xcu
ifeq ($(gb_Side),host)
postprocess_FILES_main += \
	$(call gb_XcuModuleTarget_get_target,connectivity/registry/ado)/org/openoffice/Office/DataAccess/Drivers-ado.xcu
postprocess_DRIVERS += ado
endif
endif
ifneq ($(WITH_WEBDAV),)
postprocess_FILES_main += $(postprocess_MOD)/org/openoffice/ucb/Configuration-webdav.xcu
endif
diff --git a/postprocess/Module_postprocess.mk b/postprocess/Module_postprocess.mk
index 4671cbc..c1aa1db 100644
--- a/postprocess/Module_postprocess.mk
+++ b/postprocess/Module_postprocess.mk
@@ -13,11 +13,16 @@ $(eval $(call gb_Module_Module,postprocess))
# is reused in Package_registry!

$(eval $(call gb_Module_add_targets,postprocess,\
	CustomTarget_images \
	CustomTarget_registry \
	Package_images \
	Rdb_services \
))
ifeq ($(gb_Side),host)
$(eval $(call gb_Module_add_targets,postprocess,\
	CustomTarget_images \
	Package_images \
))
endif

$(eval $(call gb_Module_add_l10n_targets,postprocess,\
	Package_registry \
))
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 71f9421f6..7cda2c7 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -9,30 +9,76 @@

$(eval $(call gb_Rdb_Rdb_install,services))

#
# "minimal" list of services for cross-compiling build tools
#
$(eval $(call gb_Rdb_add_components,services,\
	animations/source/animcore/animcore \
	$(call gb_Helper_optional,AVMEDIA,avmedia/util/avmedia) \
	chart2/source/controller/chartcontroller \
	chart2/source/chartcore \
	$(call gb_Helper_optional,SCRIPTING,basic/util/sb) \
	canvas/source/factory/canvasfactory \
	canvas/source/simplecanvas/simplecanvas \
	canvas/source/vcl/vclcanvas \
	$(if $(ENABLE_CAIRO_CANVAS),canvas/source/cairo/cairocanvas) \
	$(if $(ENABLE_OPENGL_CANVAS),canvas/source/opengl/oglcanvas) \
	$(if $(filter WNT,$(OS)), \
		canvas/source/directx/directx9canvas \
		canvas/source/directx/gdipluscanvas \
	) \
	comphelper/util/comphelp \
	configmgr/source/configmgr \
	$(if $(filter DBCONNECTIVITY,$(BUILD_TYPE)), \
		connectivity/source/dbtools/dbtools \
		connectivity/source/drivers/dbase/dbase \
	) \
	cppcanvas/source/uno/mtfrenderer \
	drawinglayer/drawinglayer \
	emfio/emfio \
	filter/source/config/cache/filterconfig1 \
	filter/source/graphic/graphicfilter \
	filter/source/svg/svgfilter \
	framework/util/fwk \
	i18npool/source/search/i18nsearch \
	i18npool/util/i18npool \
	package/source/xstor/xstor \
	package/util/package2 \
	sax/source/expatwrap/expwrap \
	sfx2/util/sfx \
	sot/util/sot \
	svgio/svgio \
	svl/source/fsstor/fsstorage \
	svl/source/passwordcontainer/passwordcontainer \
	svl/util/svl \
	svtools/util/svt \
	svx/util/svxcore \
	toolkit/util/tk \
	ucb/source/core/ucb1 \
	ucb/source/ucp/file/ucpfile1 \
	unotools/util/utl \
	unoxml/source/service/unoxml \
	uui/util/uui \
	vcl/vcl.common \
	$(if $(filter ANDROID,$(OS)),vcl/vcl.android) \
	$(if $(DISABLE_GUI),vcl/vcl.headless) \
	$(if $(filter iOS,$(OS)),vcl/vcl.ios) \
	$(if $(filter MACOSX,$(OS)),vcl/vcl.macosx) \
	$(if $(filter WNT,$(OS)),vcl/vcl.windows) \
))

ifeq ($(gb_Side),host)

$(eval $(call gb_Rdb_add_components,services,\
	animations/source/animcore/animcore \
	chart2/source/controller/chartcontroller \
	chart2/source/chartcore \
	cui/util/cui \
	desktop/source/deployment/deployment \
	drawinglayer/drawinglayer \
	dtrans/util/mcnttype \
	embeddedobj/util/embobj \
	eventattacher/source/evtatt \
	filter/source/config/cache/filterconfig1 \
	filter/source/graphic/graphicfilter \
	filter/source/msfilter/msfilter \
	filter/source/odfflatxml/odfflatxml \
	filter/source/pdf/pdffilter \
	filter/source/storagefilterdetect/storagefd \
	filter/source/svg/svgfilter \
	filter/source/t602/t602filter \
	filter/source/textfilterdetect/textfd \
	filter/source/xmlfilteradaptor/xmlfa \
@@ -41,10 +87,7 @@ $(eval $(call gb_Rdb_add_components,services,\
	filter/source/xsltfilter/xsltfilter \
	formula/util/for \
	$(call gb_Helper_optional,DESKTOP,fpicker/source/office/fps_office) \
	framework/util/fwk \
	hwpfilter/source/hwp \
	i18npool/source/search/i18nsearch \
	i18npool/util/i18npool \
	lingucomponent/source/hyphenator/hyphen/hyphen \
	lingucomponent/source/languageguessing/guesslang \
	$(if $(filter-out iOS,$(OS)), \
@@ -57,9 +100,6 @@ $(eval $(call gb_Rdb_add_components,services,\
	    lotuswordpro/util/lwpfilter \
	) \
	oox/util/oox \
	package/source/xstor/xstor \
	package/util/package2 \
	sax/source/expatwrap/expwrap \
	sc/util/sc \
	sc/util/scd \
	sc/util/scfilt \
@@ -71,42 +111,26 @@ $(eval $(call gb_Rdb_add_components,services,\
	sd/util/sdfilt \
	sdext/source/presenter/presenter \
	sdext/source/minimizer/minimizer \
	sfx2/util/sfx \
	slideshow/util/slideshow \
	sot/util/sot \
	starmath/util/sm \
	starmath/util/smd \
	svl/source/fsstor/fsstorage \
	svl/source/passwordcontainer/passwordcontainer \
	svl/util/svl \
	svtools/util/svt \
	svgio/svgio \
	emfio/emfio \
	svx/util/svx \
	svx/util/svxcore \
	svx/util/textconversiondlgs \
	sw/util/msword \
	sw/util/sw \
	sw/util/swd \
	toolkit/util/tk \
	ucb/source/sorter/srtrs1 \
	ucb/source/core/ucb1 \
	ucb/source/cacher/cached1 \
	$(if $(ENABLE_LIBCMIS),ucb/source/ucp/cmis/ucpcmis1) \
	ucb/source/ucp/expand/ucpexpand1 \
	ucb/source/ucp/ext/ucpext \
	ucb/source/ucp/file/ucpfile1 \
	$(if $(ENABLE_CURL),ucb/source/ucp/ftp/ucpftp1) \
	ucb/source/ucp/hierarchy/ucphier1 \
	ucb/source/ucp/image/ucpimage \
	ucb/source/ucp/package/ucppkg1 \
	ucb/source/ucp/tdoc/ucptdoc1 \
	UnoControls/util/ctl \
	unotools/util/utl \
	unoxml/source/rdf/unordf \
	unoxml/source/service/unoxml \
	uui/util/uui \
	vcl/vcl.common \
	xmloff/source/transform/xof \
	xmloff/util/xo \
	xmlscript/util/xmlscript \
@@ -127,16 +151,11 @@ $(eval $(call gb_Rdb_add_components,services,\
	writerperfect/source/calc/wpftcalc \
	$(if $(filter MACOSX,$(OS)), \
		$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
		fpicker/source/aqua/fps_aqua \
		shell/source/backends/macbe/macbe1 \
		vcl/vcl.macosx \
	) \
	$(if $(filter iOS MACOSX,$(OS)), \
		lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
	) \
	$(if $(filter iOS,$(OS)), \
		vcl/vcl.ios \
	) \
	$(if $(filter WNT,$(OS)), \
		avmedia/source/win/avmediawin \
		dtrans/source/generic/dtrans \
@@ -147,13 +166,6 @@ $(eval $(call gb_Rdb_add_components,services,\
		shell/source/backends/wininetbe/wininetbe1 \
		shell/source/win32/simplemail/smplmail \
		shell/source/win32/syssh \
		vcl/vcl.windows \
	) \
	$(if $(DISABLE_GUI), \
		vcl/vcl.headless \
	) \
	$(if $(filter ANDROID,$(OS)), \
		vcl/vcl.android \
	) \
	$(if $(filter-out WNT,$(OS)), \
		embeddedobj/source/msole/emboleobj \
@@ -169,7 +181,6 @@ $(eval $(call gb_Rdb_add_components,services,\
	) \
	$(call gb_Helper_optional,SCRIPTING, \
		basctl/util/basctl \
		basic/util/sb \
		sc/util/vbaobj \
		scripting/source/basprov/basprov \
		scripting/source/dlgprov/dlgprov \
@@ -186,16 +197,6 @@ $(eval $(call gb_Rdb_add_components,services,\
			wizards/com/sun/star/wizards/letter/letter \
		) \
	) \
	$(if $(ENABLE_CAIRO_CANVAS), \
		canvas/source/cairo/cairocanvas \
	) \
	$(if $(filter WNT,$(OS)), \
		canvas/source/directx/directx9canvas \
		canvas/source/directx/gdipluscanvas \
	) \
	$(if $(ENABLE_OPENGL_CANVAS), \
        canvas/source/opengl/oglcanvas \
	) \
	$(if $(ENABLE_GIO), \
		shell/source/sessioninstall/losessioninstall \
		ucb/source/ucp/gio/ucpgio \
@@ -233,18 +234,16 @@ $(eval $(call gb_Rdb_add_components,services,\
	dbaccess/util/dba \
))

ifeq (DBCONNECTIVITY,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))
ifneq (,$(filter DBCONNECTIVITY,$(BUILD_TYPE)))

$(eval $(call gb_Rdb_add_components,services,\
	extensions/source/dbpilots/dbp \
	extensions/source/propctrlr/pcr \
	connectivity/source/cpool/dbpool2 \
	connectivity/source/dbtools/dbtools \
	$(if $(filter WNT,$(OS)), \
		connectivity/source/drivers/ado/ado \
	) \
	connectivity/source/drivers/calc/calc \
	connectivity/source/drivers/dbase/dbase \
	$(if $(ENABLE_EVOAB2), \
		connectivity/source/drivers/evoab2/evoab \
	) \
@@ -340,4 +339,6 @@ $(eval $(call gb_Rdb_add_components,services,\
))
endif

endif # $(gb_Side),host

# vim: set noet sw=4 ts=4:
diff --git a/shell/Module_shell.mk b/shell/Module_shell.mk
index a223aae..e6d6635 100644
--- a/shell/Module_shell.mk
+++ b/shell/Module_shell.mk
@@ -9,6 +9,14 @@

$(eval $(call gb_Module_Module,shell))

ifeq ($(filter DESKTOP,$(BUILD_TYPE)),DESKTOP)
$(eval $(call gb_Module_add_targets,shell,\
	Executable_lngconvex \
))
endif

ifeq ($(gb_Side),host)

$(eval $(call gb_Module_add_targets,shell,\
	$(if $(filter-out MACOSX WNT,$(OS)),Library_desktopbe) \
	Library_localebe \
@@ -99,7 +107,6 @@ endif
ifeq ($(filter DESKTOP,$(BUILD_TYPE)),DESKTOP)

$(eval $(call gb_Module_add_targets,shell,\
	Executable_lngconvex \
	Library_syssh \
))

@@ -120,4 +127,6 @@ $(eval $(call gb_Module_add_l10n_targets,shell,\
    AllLangMoTarget_shell \
))

endif # $(gb_Side) == host

# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk
index 9e5b8df..c45be55 100644
--- a/solenv/gbuild/extensions/pre_BuildTools.mk
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -13,6 +13,7 @@ gb_BUILD_TOOLS = \
	$(foreach executable, \
		bestreversemap \
		cfgex \
		climaker \
		cpp \
		cppumaker \
		gencoll_rule \
@@ -35,6 +36,7 @@ gb_BUILD_TOOLS = \
			gengal \
			HelpIndexer \
			HelpLinker \
			lngconvex \
		) \
	,$(call gb_Executable_get_runtime_dependencies,$(executable))) \
	$(foreach executable, \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index e184a65..996c5a4 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -543,13 +543,13 @@ $(eval $(call gb_Helper_make_dep_targets,\

ifeq ($(gb_FULLDEPS),$(true))
# FIXME this is used before TargetLocations is read?
gb_WinResTarget__command_target = $(WORKDIR)/LinkTarget/Executable/makedepend.exe
gb_WinResTarget__command_target = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable/makedepend.exe
define gb_WinResTarget__command_dep
$(call gb_Output_announce,RC:$(2),$(true),DEP,1)
	$(call gb_Trace_StartRange,RC:$(2),DEP)
$(call gb_Helper_abbreviate_dirs,\
	mkdir -p $(dir $(1)) && \
	$(call gb_Executable_get_target,makedepend) \
	$(call gb_Executable_get_target_for_build,makedepend) \
		$(INCLUDE) \
		$(DEFS) \
		$(RCFILE) \
@@ -598,10 +598,10 @@ endef
gb_AUTOCONF_WRAPPERS = \
	REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \
	REAL_CC_FLAGS="$(filter -%,$(CC))" \
	CC="$(call gb_Executable_get_target,gcc-wrapper)" \
	CC="$(call gb_Executable_get_target_for_build,gcc-wrapper)" \
	REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \
	REAL_CXX_FLAGS="$(filter -%,$(CXX))" \
	CXX="$(call gb_Executable_get_target,g++-wrapper)" \
	CXX="$(call gb_Executable_get_target_for_build,g++-wrapper)" \
    LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"

gb_ExternalProject_INCLUDE := \
@@ -677,8 +677,9 @@ endef
gb_UIMenubarTarget_UIMenubarTarget_platform :=

# Python
gb_Python_PRECOMMAND := PATH="$(shell cygpath -w $(INSTDIR)/program)" PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib;$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program"
gb_Python_INSTALLED_EXECUTABLE := $(INSTROOT)/$(LIBO_BIN_FOLDER)/python.exe
gb_Python_HOME := $(INSTDIR_FOR_BUILD)/program/python-core-$(PYTHON_VERSION)
gb_Python_PRECOMMAND := PATH="$(shell cygpath -w $(INSTDIR_FOR_BUILD)/program)" PYTHONHOME="$(gb_Python_HOME)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(gb_Python_HOME)/lib;$(gb_Python_HOME)/lib/lib-dynload:$(INSTDIR_FOR_BUILD)/program"
gb_Python_INSTALLED_EXECUTABLE := $(INSTROOT_FOR_BUILD)/$(LIBO_BIN_FOLDER)/python.exe

gb_ICU_PRECOMMAND := PATH="$(shell cygpath -w $(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source/lib)"

diff --git a/svx/Module_svx.mk b/svx/Module_svx.mk
index 2040a90..599f842 100644
--- a/svx/Module_svx.mk
+++ b/svx/Module_svx.mk
@@ -22,9 +22,14 @@ $(eval $(call gb_Module_Module,svx))
$(eval $(call gb_Module_add_targets,svx,\
    Library_svx \
    Library_svxcore \
))

ifeq ($(gb_Side),host)
$(eval $(call gb_Module_add_targets,svx,\
    Library_textconversiondlgs \
    UIConfig_svx \
))
endif

$(eval $(call gb_Module_add_l10n_targets,svx,\
    AllLangMoTarget_svx \
diff --git a/unotest/Module_unotest.mk b/unotest/Module_unotest.mk
index a47ca5d..bdffe8e 100644
--- a/unotest/Module_unotest.mk
+++ b/unotest/Module_unotest.mk
@@ -10,6 +10,7 @@

$(eval $(call gb_Module_Module,unotest))

ifeq ($(gb_Side),host)
ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,unotest,\
	Library_unobootstrapprotector \
@@ -29,5 +30,6 @@ $(eval $(call gb_Module_add_targets,unotest,\
))
endif
endif
endif

# vim: set noet sw=4 ts=4:
diff --git a/unoxml/Module_unoxml.mk b/unoxml/Module_unoxml.mk
index 5008d82..8c55b83 100644
--- a/unoxml/Module_unoxml.mk
+++ b/unoxml/Module_unoxml.mk
@@ -21,8 +21,13 @@ $(eval $(call gb_Module_Module,unoxml))

$(eval $(call gb_Module_add_targets,unoxml,\
    Library_unoxml \
))

ifeq ($(gb_Side),host)
$(eval $(call gb_Module_add_targets,unoxml,\
    Library_unordf \
))
endif

$(eval $(call gb_Module_add_slowcheck_targets,unoxml,\
    CppunitTest_unoxml_domtest \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 214c66b..3570b40 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -725,8 +725,11 @@ $(eval $(call gb_Library_add_nativeres,vcl,vcl/salsrc))

# HACK: dependency on icon themes so running unit tests don't
# prevent delivering these by having open file handles on WNT
ifeq ($(gb_Side),host)
$(eval $(call gb_Library_use_package,vcl,postprocess_images))
endif
endif # $(OS) == WNT


ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
ifeq ($(USING_X11),TRUE)
diff --git a/vcl/Library_vclplug_win.mk b/vcl/Library_vclplug_win.mk
index 2e169de..057c650 100644
--- a/vcl/Library_vclplug_win.mk
+++ b/vcl/Library_vclplug_win.mk
@@ -104,6 +104,8 @@ $(eval $(call gb_Library_add_nativeres,vclplug_win,vcl/salsrc))

# HACK: dependency on icon themes so running unit tests don't
# prevent delivering these by having open file handles on WNT
ifeq ($(gb_Side),host)
$(eval $(call gb_Library_use_package,vclplug_win,postprocess_images))
endif

# vim: set noet sw=4 ts=4:
diff --git a/xmloff/Module_xmloff.mk b/xmloff/Module_xmloff.mk
index 8f5853c..9aa54fa42 100644
--- a/xmloff/Module_xmloff.mk
+++ b/xmloff/Module_xmloff.mk
@@ -22,9 +22,14 @@ $(eval $(call gb_Module_Module,xmloff))
$(eval $(call gb_Module_add_targets,xmloff,\
	CustomTarget_generated \
    Library_xo \
))

ifeq ($(gb_Side),host)
$(eval $(call gb_Module_add_targets,xmloff,\
    Library_xof \
    Package_dtd \
))
endif

$(eval $(call gb_Module_add_check_targets,xmloff,\
	$(if $(MERGELIBS),, \