summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-05-22 02:41:58 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-05-29 17:30:26 +0200
commite9301742254b85f4c6fbfd9378b365c76f5ff367 (patch)
tree1be461c1d4229562eb69134ca1f7964879e25c53 /solenv
parent8196c0a0a532dc1b8577d1aa530c8f9f47fc3e61 (diff)
gbuild: implement gb_Library_get_target_for_build
I was wondering why removing instdir stuff forced a rebuild of the cross toolset. Turned out some cross-toolset bits were wrongly depending on host build stuff. It even had FIXME... As a consequence, gb_CPPU_ENV was replaced by config_host.mk flags to provide an CPPU_ENV_FOR_BUILD and also uses the correct OS_FOR_BUILD. Change-Id: I50e8e8dca50ab1ad3164948a585a792a52e4a39a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116359 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/ComponentTarget.mk2
-rw-r--r--solenv/gbuild/CppunitTest.mk2
-rw-r--r--solenv/gbuild/Library.mk10
-rw-r--r--solenv/gbuild/TargetLocations.mk12
-rw-r--r--solenv/gbuild/platform/WNT_AARCH64_MSC.mk1
-rw-r--r--solenv/gbuild/platform/WNT_INTEL_MSC.mk1
-rw-r--r--solenv/gbuild/platform/WNT_X86_64_MSC.mk1
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk4
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk1
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk2
-rw-r--r--solenv/gbuild/platform/macosx.mk1
-rw-r--r--solenv/gbuild/platform/unxgcc.mk2
12 files changed, 30 insertions, 9 deletions
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index 8b1ad971bb02..067f24e35ce6 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -30,7 +30,7 @@ $(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component targ
mkdir -p $(dir $(1)) && \
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
--stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \
- --stringparam cppu_env $(gb_CPPU_ENV) -o $(1) \
+ --stringparam cppu_env $(CPPU_ENV) -o $(1) \
$(gb_ComponentTarget_XSLTCOMMANDFILE) $(COMPONENTSOURCE)
endef
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 6877ec5ac792..ce6437bf07bd 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -220,7 +220,7 @@ endef
define gb_CppunitTest_use_ure
$(call gb_CppunitTest_use_rdb,$(1),ure/services)
$(call gb_CppunitTest_get_target,$(1)) : URE := $(true)
-$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,$(gb_CPPU_ENV)_uno)
+$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,$(CPPU_ENV)_uno)
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,affine_uno)
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unobootstrapprotector)
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Library_get_target,unoexceptionprotector)
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 77b58c7e99db..f8a08f915d35 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -35,6 +35,13 @@ gb_Library_LAYER_DIRS := \
OXT:$(WORKDIR)/LinkTarget/ExtensionLibrary \
NONE:$(gb_Library_DLLDIR) \
+gb_Library_LAYER_DIRS_FOR_BUILD := \
+ URELIB:$(INSTROOT_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER_FOR_BUILD) \
+ OOO:$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER_FOR_BUILD) \
+ SHLXTHDL:$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER_FOR_BUILD)/shlxthdl \
+ OXT:$(WORKDIR_FOR_BUILD)/LinkTarget/ExtensionLibrary \
+ NONE:$(gb_Library_DLLDIR_FOR_BUILD) \
+
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
.PHONY : $(WORKDIR)/Clean/Library/%
$(WORKDIR)/Clean/Library/% :
@@ -43,7 +50,9 @@ $(WORKDIR)/Clean/Library/% :
$(AUXTARGETS))
gb_Library__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER_DIRS)))
+gb_Library__get_dir_for_layer_for_build = $(patsubst $(1):%,%,$(filter $(1):%,$(call gb_Library_LAYER_DIRS_FOR_BUILD)))
gb_Library_get_instdir = $(call gb_Library__get_dir_for_layer,$(call gb_Library_get_layer,$(1)))
+gb_Library_get_instdir_for_build = $(call gb_Library__get_dir_for_layer_for_build,$(call gb_Library_get_layer,$(1)))
gb_Library_get_ilib_target = $(if $(filter $(1),$(gb_Library_RTVERLIBS) $(gb_Library_UNOVERLIBS)),$(call gb_Library_get_sdk_link_dir)/$(call gb_Library_get_ilibfilename,$(1)),$(gb_Library_DLLDIR)/$(call gb_Library_get_ilibfilename,$(1)))
@@ -161,6 +170,7 @@ gb_Library__COMPONENTPREFIXES := \
gb_Library_get_runtime_filename = $(call gb_Library_get_filename,$(1))
+gb_Library_get_runtime_filename_for_build = $(call gb_Library_get_filename_for_build,$(1))
# forward the call to the gb_LinkTarget implementation
# (note: because the function name is in $(1), the other args are shifted by 1)
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 801d188be737..46e875d6d227 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -342,6 +342,10 @@ define gb_Library_get_filename
$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_FILENAMES)))
endef
+define gb_Library_get_filename_for_build
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_FILENAMES_FOR_BUILD)))
+endef
+
define gb_Executable_get_filename
$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Executable_FILENAMES)))
endef
@@ -393,6 +397,13 @@ endef
define gb_Library_get_target
$(call gb_Library_get_instdir,$(1))/$(call gb_Library_get_runtime_filename,$(1))
endef
+ifneq ($(CROSS_COMPILING),)
+define gb_Library_get_target_for_build
+$(call gb_Library_get_instdir_for_build,$(1))/$(call gb_Library_get_runtime_filename_for_build,$(1))
+endef
+else
+gb_Library_get_target_for_build = $(gb_Library_get_target)
+endif # CROSS_COMPILING
# this returns a tuple of both the linktargetname, and the target file
define gb_Library_get_linktarget
$(call gb_Library__get_workdir_linktargetname,$(1))<>$(call gb_Library_get_target,$(1))
@@ -438,6 +449,7 @@ 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
diff --git a/solenv/gbuild/platform/WNT_AARCH64_MSC.mk b/solenv/gbuild/platform/WNT_AARCH64_MSC.mk
index 67e1d5736736..c9cf931385e8 100644
--- a/solenv/gbuild/platform/WNT_AARCH64_MSC.mk
+++ b/solenv/gbuild/platform/WNT_AARCH64_MSC.mk
@@ -17,7 +17,6 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-gb_CPPU_ENV := msca
gb_CPUDEFS := -D_ARM64_=1
include $(GBUILDDIR)/platform/com_MSC_defs.mk
diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
index 704c7f7817dc..690a7083a850 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -17,7 +17,6 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-gb_CPPU_ENV := msci
gb_CPUDEFS := -D_X86_=1
include $(GBUILDDIR)/platform/com_MSC_defs.mk
diff --git a/solenv/gbuild/platform/WNT_X86_64_MSC.mk b/solenv/gbuild/platform/WNT_X86_64_MSC.mk
index 54533f749452..18eae3e746e5 100644
--- a/solenv/gbuild/platform/WNT_X86_64_MSC.mk
+++ b/solenv/gbuild/platform/WNT_X86_64_MSC.mk
@@ -17,7 +17,6 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-gb_CPPU_ENV := mscx
gb_CPUDEFS := -D_AMD64_=1
include $(GBUILDDIR)/platform/com_MSC_defs.mk
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 7846a05a5f92..09ca90a91f69 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -41,14 +41,12 @@ ifeq ($(strip $(gb_COMPILEROPTFLAGS)),)
gb_COMPILEROPTFLAGS := -O2
endif
-gb_CPPU_ENV := gcc3
-
gb_AFLAGS := $(AFLAGS)
gb_COMPILERDEFS := \
-DBOOST_ERROR_CODE_HEADER_ONLY \
-DBOOST_SYSTEM_NO_DEPRECATED \
- -DCPPU_ENV=$(gb_CPPU_ENV) \
+ -DCPPU_ENV=$(CPPU_ENV) \
$(if $(filter EMSCRIPTEN,$(OS)),-U_FORTIFY_SOURCE) \
gb_CFLAGS_COMMON := \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 3e2ea893ae08..76dea12e1ec6 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -310,6 +310,7 @@ gb_Library_get_rpath :=
gb_Library_SYSPRE := i
gb_Library_PLAINEXT := .lib
+gb_Library_PLAINEXT_FOR_BUILD := .lib
gb_Library_LAYER := \
$(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 4c3b4e21e737..2737cfa26af9 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -56,7 +56,7 @@ gb_COMPILERDEFS := \
-D_SCL_SECURE_NO_WARNINGS \
-D_MT \
-D_DLL \
- -DCPPU_ENV=$(gb_CPPU_ENV) \
+ -DCPPU_ENV=$(CPPU_ENV) \
ifeq ($(CPUNAME),INTEL)
gb_COMPILERDEFS += \
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 295b4e1aeb3e..a24cefe1080e 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -177,6 +177,7 @@ gb_Library_UDK_MAJORVER := 3
gb_Library_SYSPRE := lib
gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
gb_Library_PLAINEXT := .dylib
+gb_Library_PLAINEXT_FOR_BUILD := .dylib
gb_Library_DLLEXT := .dylib
gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 749ba8e17932..4a96547b48b8 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -188,6 +188,7 @@ gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
ifeq ($(DISABLE_DYNLOADING),TRUE)
gb_Library_PLAINEXT := .a
+gb_Library_PLAINEXT_FOR_BUILD := .so
gb_Library_DLLEXT := .a
else
@@ -195,6 +196,7 @@ else
gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
gb_Library_UDK_MAJORVER := 3
gb_Library_PLAINEXT := .so
+gb_Library_PLAINEXT_FOR_BUILD := .so
gb_Library_DLLEXT := .so
endif