From e56a8300d36a7998e492e87bc514d14d931cf01d Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Thu, 13 Jun 2024 13:04:56 +0200 Subject: [PATCH] use gb_StaticLibrary_WORKDIR and gb_Library_DLLDIR more consistently same for gb_Executable_BINDIR[_FOR_BUILD] and fold gb_Library_WORKDIR_FOR_BUILD into gb_Library_DLLDIR_FOR_BUILD (the latter also has a workdir variant) Change-Id: If7e4cf9aab46728182c89344546065bc33b452b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169201 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- Makefile.gbuild | 2 +- configure.ac | 24 +++++++++---------- sal/Executable_osl_process_child.mk | 6 ++--- solenv/gbuild/CliLibrary.mk | 2 +- solenv/gbuild/LinkTarget.mk | 2 +- solenv/gbuild/TargetLocations.mk | 16 +++++-------- solenv/gbuild/extensions/post_GbuildToJson.mk | 2 +- solenv/gbuild/platform/com_GCC_class.mk | 2 +- solenv/gbuild/platform/com_MSC_class.mk | 7 +++--- solenv/gbuild/platform/iOS.mk | 2 +- solenv/gbuild/platform/macosx.mk | 2 +- solenv/inc/langlist.mk | 2 +- testtools/CustomTarget_bridgetest.mk | 4 ++-- testtools/CustomTarget_uno_test.mk | 4 ++-- 14 files changed, 36 insertions(+), 41 deletions(-) diff --git a/Makefile.gbuild b/Makefile.gbuild index bad2fc9f7f15..1e0e97e6e611 100644 --- a/Makefile.gbuild +++ b/Makefile.gbuild @@ -56,7 +56,7 @@ create-partial-info: BUILDID := $(shell git -C $(SRCDIR) log -1 --format=%H$(if create-partial-info: MAR_NAME_PREFIX = $(PRODUCTNAME)_$(VERSION_FULL)_$(PLATFORM)_$(BUILDID) create-partial-info: ONLINEUPDATE_MAR_OLDMSI = $(MSIDIR)$(PRODUCTNAME)_$(OLD_VER)_Win_$(subst AARCH64,aarch64,$(subst X86_64,x86-64,$(ARCH))).msi create-partial-info: ONLINEUPDATE_MAR_NEWMSI = $(MSIDIR)$(PRODUCTNAME)_$(VERSION)_Win_$(subst AARCH64,aarch64,$(subst X86_64,x86-64,$(ARCH))).msi -create-partial-info: export MBSDIFF := $(WORKDIR)/LinkTarget/Executable/mbsdiff +create-partial-info: export MBSDIFF := $(gb_Executable_BINDIR)/mbsdiff create-partial-info: export MAR := $(INSTDIR)/program/mar create-partial-info: create-partial-info-AARCH64 create-partial-info-X86_64 create-partial-info-x86 diff --git a/configure.ac b/configure.ac index f59128e84d61..43036fd9dfc7 100644 --- a/configure.ac +++ b/configure.ac @@ -9622,9 +9622,9 @@ else BUILD_TYPE="$BUILD_TYPE ZLIB" ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib" if test "$COM" = "MSC"; then - ZLIB_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/zlib.lib" + ZLIB_LIBS='$(gb_StaticLibrary_WORKDIR)/zlib.lib' else - ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib" + ZLIB_LIBS='-L$(gb_StaticLibrary_WORKDIR) -lzlib' fi fi AC_SUBST(ZLIB_CFLAGS) @@ -9869,7 +9869,7 @@ dnl Check for DLP libs dnl =================================================================== REVENGE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/librevenge/inc" AS_IF([test "$COM" = "MSC"], - [librevenge_libdir="${WORKDIR}/LinkTarget/Library"], + [librevenge_libdir='$(gb_Library_DLLDIR)'], [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"] ) REVENGE_LIBS_internal="-L${librevenge_libdir} -lrevenge-0.0" @@ -9881,7 +9881,7 @@ libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1]) WPD_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libwpd/inc" AS_IF([test "$COM" = "MSC"], - [libwpd_libdir="${WORKDIR}/LinkTarget/Library"], + [libwpd_libdir='$(gb_Library_DLLDIR)'], [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"] ) WPD_LIBS_internal="-L${libwpd_libdir} -lwpd-0.10" @@ -10463,7 +10463,7 @@ if test "$ENABLE_MARIADBC" = "TRUE"; then AC_MSG_RESULT([internal]) SYSTEM_MARIADB_CONNECTOR_C= MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include" - MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c" + MARIADB_LIBS='-L$(gb_StaticLibrary_WORKDIR) -lmariadb-connector-c' BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C" fi @@ -11210,11 +11210,11 @@ GRAPHITE_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHI HARFBUZZ_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/harfbuzz/src" case "$_os" in Linux) - GRAPHITE_LIBS_internal="${WORKDIR}/LinkTarget/StaticLibrary/libgraphite.a" + GRAPHITE_LIBS_internal='$(gb_StaticLibrary_WORKDIR)/libgraphite.a' HARFBUZZ_LIBS_internal="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.a" ;; *) - GRAPHITE_LIBS_internal="-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite" + GRAPHITE_LIBS_internal='-L$(gb_StaticLibrary_WORKDIR) -lgraphite' HARFBUZZ_LIBS_internal="-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz" ;; esac @@ -11222,7 +11222,7 @@ libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3]) libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= $harfbuzz_required_version]) if test "$COM" = "MSC"; then # override the above - GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib" + GRAPHITE_LIBS='$(gb_StaticLibrary_WORKDIR)/graphite.lib' HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib" fi @@ -11496,7 +11496,7 @@ else SYSTEM_HUNSPELL= HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell" if test "$COM" = "MSC"; then - HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib" + HUNSPELL_LIBS='$(gb_StaticLibrary_WORKDIR)/hunspell.lib' else HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7" fi @@ -11670,7 +11670,7 @@ else SYSTEM_HYPH= BUILD_TYPE="$BUILD_TYPE HYPHEN" if test "$COM" = "MSC"; then - HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib" + HYPHEN_LIB='$(gb_StaticLibrary_WORKDIR)/hyphen.lib' else HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen" fi @@ -11709,7 +11709,7 @@ else SYSTEM_MYTHES= BUILD_TYPE="$BUILD_TYPE MYTHES" if test "$COM" = "MSC"; then - MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib" + MYTHES_LIBS='$(gb_StaticLibrary_WORKDIR)/mythes.lib' else MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2" fi @@ -14188,7 +14188,7 @@ dnl Test whether to build libpng or rely on the system version dnl =================================================================== LIBPNG_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/libpng" -LIBPNG_LIBS_internal="-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng" +LIBPNG_LIBS_internal='-L$(gb_StaticLibrary_WORKDIR) -llibpng' libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng]) dnl =================================================================== diff --git a/sal/Executable_osl_process_child.mk b/sal/Executable_osl_process_child.mk index f64f9460541f..c9da0909b30a 100644 --- a/sal/Executable_osl_process_child.mk +++ b/sal/Executable_osl_process_child.mk @@ -29,14 +29,14 @@ sal_BATCH_FILE := batch.sh endif $(call gb_Executable_get_target,osl_process_child) : \ - $(WORKDIR)/LinkTarget/Executable/$(sal_BATCH_FILE) + $(gb_Executable_BINDIR)/$(sal_BATCH_FILE) -$(WORKDIR)/LinkTarget/Executable/$(sal_BATCH_FILE) : \ +$(gb_Executable_BINDIR)/$(sal_BATCH_FILE) : \ $(SRCDIR)/sal/qa/osl/process/$(sal_BATCH_FILE) mkdir -p $(dir $@) && \ $(call gb_Deliver_deliver,$<,$@) $(call gb_Executable_get_clean_target,osl_process_child) : - rm -f $(WORKDIR)/LinkTarget/Executable/$(sal_BATCH_FILE) + rm -f $(gb_Executable_BINDIR)/$(sal_BATCH_FILE) # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/CliLibrary.mk b/solenv/gbuild/CliLibrary.mk index 4abd34b42ae3..6956ec83de00 100644 --- a/solenv/gbuild/CliLibrary.mk +++ b/solenv/gbuild/CliLibrary.mk @@ -42,7 +42,7 @@ define gb_CliLibrary__command -out:$(1) \ $(if $(call gb_target_symbols_enabled,$(1)),\ -debug:pdbonly \ - -pdb:$(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/Library/$(notdir $(1)))) \ + -pdb:$(call gb_LinkTarget__get_pdb_filename,$(gb_Library_DLLDIR)/$(notdir $(1)))) \ -keyfile:$(CLI_KEYFILE) \ -reference:System.dll \ $(foreach assembly,$(CLI_ASSEMBLIES),-reference:$(assembly)) \ diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index a4e44d52d6e9..accb3a400df5 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -858,7 +858,7 @@ $(WORKDIR)/LinkTarget/%/.dir : # written in gb_LinkTarget__command_dynamiclink. # Put this pattern rule here so it overrides the one below. # (this is rather ugly: because of % the functions cannot be used) -$(WORKDIR)/LinkTarget/Library/%.exports : +$(gb_Library_DLLDIR)/%.exports : $(if $(wildcard $@),,mkdir -p $(dir $@) && touch $@) # This recipe actually also builds the dep-target as a side-effect, which diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index d0727531c591..ad0e26a75969 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -483,16 +483,12 @@ endef # static members declared here because they are used globally -gb_StaticLibrary_WORKDIR = $(WORKDIR)/LinkTarget/StaticLibrary -gb_Library_WORKDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Library -gb_Executable_BINDIR = $(WORKDIR)/LinkTarget/Executable -gb_Executable_BINDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable -gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library -gb_Library_DLLDIR_FOR_BUILD = $(WORKDIR_FOR_BUILD)/LinkTarget/Library -gb_CppunitTest_DLLDIR = $(WORKDIR)/LinkTarget/CppunitTest - -# static variables declared here because they are used globally - +gb_StaticLibrary_WORKDIR := $(WORKDIR)/LinkTarget/StaticLibrary +gb_Executable_BINDIR := $(WORKDIR)/LinkTarget/Executable +gb_Executable_BINDIR_FOR_BUILD := $(WORKDIR_FOR_BUILD)/LinkTarget/Executable +gb_Library_DLLDIR := $(WORKDIR)/LinkTarget/Library +gb_Library_DLLDIR_FOR_BUILD := $(WORKDIR_FOR_BUILD)/LinkTarget/Library +gb_CppunitTest_DLLDIR := $(WORKDIR)/LinkTarget/CppunitTest gb_POLOCATION := $(SRCDIR)/translations/source # vim: set noet sw=4: diff --git a/solenv/gbuild/extensions/post_GbuildToJson.mk b/solenv/gbuild/extensions/post_GbuildToJson.mk index 5e817228d900..a4b6b105f329 100644 --- a/solenv/gbuild/extensions/post_GbuildToJson.mk +++ b/solenv/gbuild/extensions/post_GbuildToJson.mk @@ -156,7 +156,7 @@ gb_Library_set_componentfile = gb_Library_add_componentimpl = #$(call gb_Library_get_exports_target,%): -$(WORKDIR)/LinkTarget/Library/%.exports: +$(gb_Library_DLLDIR)/%.exports: @true define gb_LinkTarget__use_custom_headers diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index d34464030d5e..6c81efcc6e35 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -222,7 +222,7 @@ gb_StaticLibrary_PLAINEXT := .a gb_StaticLibrary_StaticLibrary_platform := gb_LinkTarget_get_linksearchpath_for_layer = \ - -L$(WORKDIR)/LinkTarget/StaticLibrary \ + -L$(gb_StaticLibrary_WORKDIR) \ -L$(call gb_Library_get_sdk_link_dir) \ $(foreach layer,\ $(subst +, ,$(patsubst $(1):%.,%,\ diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 6c1015e9b533..b1a825a54dd2 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -237,11 +237,11 @@ gb_LinkTarget_get_manifestfile = \ $(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest gb_LinkTarget_get_linksearchpath_for_layer = \ - -LIBPATH:$(WORKDIR)/LinkTarget/StaticLibrary \ + -LIBPATH:$(gb_StaticLibrary_WORKDIR) \ -LIBPATH:$(INSTDIR)/$(SDKDIRNAME)/lib \ $(if $(filter OXT,$(1)),\ -LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \ - -LIBPATH:$(WORKDIR)/LinkTarget/Library) + -LIBPATH:$(gb_Library_DLLDIR)) # avoid fatal error LNK1170 for Library_merged define gb_LinkTarget_MergedResponseFile @@ -607,8 +607,7 @@ $(eval $(call gb_Helper_make_dep_targets,\ )) ifeq ($(gb_FULLDEPS),$(true)) -# FIXME this is used before TargetLocations is read? -gb_WinResTarget__command_target = $(WORKDIR_FOR_BUILD)/LinkTarget/Executable/makedepend.exe +gb_WinResTarget__command_target := $(gb_Executable_BINDIR_FOR_BUILD)/makedepend.exe define gb_WinResTarget__command_dep $(call gb_Output_announce,RC:$(2),$(true),DEP,1) $(call gb_Trace_StartRange,RC:$(2),DEP) diff --git a/solenv/gbuild/platform/iOS.mk b/solenv/gbuild/platform/iOS.mk index 9c5d20103d3c..c7dae1f7d177 100644 --- a/solenv/gbuild/platform/iOS.mk +++ b/solenv/gbuild/platform/iOS.mk @@ -183,7 +183,7 @@ endef gb_Library__set_soversion_script_platform = -gb_Library_get_sdk_link_dir = $(WORKDIR)/LinkTarget/Library +gb_Library_get_sdk_link_dir := $(gb_Library_DLLDIR) # Executable class diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 90bd987f9e4e..7155fd03ba13 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -227,7 +227,7 @@ endef gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script) -gb_Library_get_sdk_link_dir = $(WORKDIR)/LinkTarget/Library +gb_Library_get_sdk_link_dir := $(gb_Library_DLLDIR) gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target) diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk index 95a295c10738..52feaa7eba3a 100644 --- a/solenv/inc/langlist.mk +++ b/solenv/inc/langlist.mk @@ -169,7 +169,7 @@ gb_HELP_LANGS += \ $(if \ $(and \ $(wildcard $(SRCDIR)/helpcontent2/source/auxiliary/$(lang)),\ - $(wildcard $(SRCDIR)/translations/source/$(lang)/helpcontent2)),\ + $(wildcard $(gb_POLOCATION)/$(lang)/helpcontent2)),\ $(lang))) # Langs that need special handling for registry files. This is done by diff --git a/testtools/CustomTarget_bridgetest.mk b/testtools/CustomTarget_bridgetest.mk index fd12947ac434..eac4df259ae4 100644 --- a/testtools/CustomTarget_bridgetest.mk +++ b/testtools/CustomTarget_bridgetest.mk @@ -32,7 +32,7 @@ $(testtools_BRIDGEDIR)/bridgetest_server$(testtools_BATCHSUFFIX) :| $(testtools_ "-s com.sun.star.test.bridge.CppTestObject" \ "-u 'uno:socket$(COMMA)host=127.0.0.1$(COMMA)port=2002;urp;test'" \ "--singleaccept" \ - "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD))" \ + "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_DLLDIR_FOR_BUILD))" \ "-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services))" \ "-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb)" \ > $@) @@ -66,7 +66,7 @@ $(testtools_BRIDGEDIR)/bridgetest_client$(testtools_BATCHSUFFIX) :| $(testtools_ "$(call gb_Executable_get_target_for_build,uno)" \ "-s com.sun.star.test.bridge.BridgeTest --" \ "-u 'uno:socket$(COMMA)host=127.0.0.1$(COMMA)port=2002;urp;test'" \ - "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD))" \ + "-env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_DLLDIR_FOR_BUILD))" \ "-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services))" \ "-env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb)" \ > $@) diff --git a/testtools/CustomTarget_uno_test.mk b/testtools/CustomTarget_uno_test.mk index 04d600b17c64..c0b94bea2e75 100644 --- a/testtools/CustomTarget_uno_test.mk +++ b/testtools/CustomTarget_uno_test.mk @@ -33,14 +33,14 @@ else $(call gb_Executable_get_command,uno) \ -s com.sun.star.test.bridge.BridgeTest \ -- com.sun.star.test.bridge.CppTestObject \ - -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD)) \ + -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_DLLDIR_FOR_BUILD)) \ -env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services)) \ -env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb) \ $(if $(ENABLE_JAVA), && \ $(call gb_Executable_get_command,uno) \ -s com.sun.star.test.bridge.BridgeTest \ -- com.sun.star.test.bridge.JavaTestObject noCurrentContext \ - -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_WORKDIR_FOR_BUILD)) \ + -env:LO_BUILD_LIB_DIR=$(call gb_Helper_make_url,$(gb_Library_DLLDIR_FOR_BUILD)) \ -env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target,uno_services)) \ -env:URE_MORE_TYPES=$(call gb_Helper_make_url,$(WORKDIR)/UnoApiTarget/bridgetest.rdb))) endif