[Libreoffice-commits] .: 2 commits - solenv/gbuild
Michael Stahl
mst at kemper.freedesktop.org
Fri Dec 16 13:11:29 PST 2011
solenv/gbuild/ComponentTarget.mk | 3 ++-
solenv/gbuild/CppunitTest.mk | 4 ++--
solenv/gbuild/Library.mk | 18 +++++++++++++-----
solenv/gbuild/LinkTarget.mk | 7 ++++++-
solenv/gbuild/TargetLocations.mk | 2 ++
solenv/gbuild/platform/WNT_INTEL_GCC.mk | 4 ++--
solenv/gbuild/platform/WNT_INTEL_MSC.mk | 8 ++++----
7 files changed, 31 insertions(+), 15 deletions(-)
New commits:
commit 0ef8beedb1d2ce70e4d5ec7b24afd1711db29f38
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Dec 16 19:58:33 2011 +0100
gbuild: refactor gb_Library_set_componentfile:
Reverse the dependency: now the component target depends (order-only) on the
library, which should ensure that gb_CppunitTest_add_component can set up
dependencies such that the unit test does not run concurrently with
a library loaded via UNO being overwritten.
Unfortunately this requires introducing another phony dummy library
target, on which the module can depend (because we don't want to register
the component target as a module target).
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index 031d118..efe4819 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -58,7 +58,8 @@ $(call gb_ComponentTarget_get_outdir_target,%) :
define gb_ComponentTarget_ComponentTarget
$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2)
$(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3)
-$(call gb_ComponentTarget_get_outdir_target,$(1)) : $(call gb_ComponentTarget_get_target,$(1))
+$(call gb_ComponentTarget_get_outdir_target,$(1)) : \
+ $(call gb_ComponentTarget_get_target,$(1))
$(call gb_Deliver_add_deliverable,$(call gb_ComponentTarget_get_outdir_target,$(1)),$(call gb_ComponentTarget_get_target,$(1)),$(1))
endef
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index aa87be6..0d8959e 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -153,9 +153,9 @@ endef
define gb_CppunitTest_add_component
$(call gb_CppunitTest_get_target,$(1)) : \
- $(call gb_ComponentTarget_get_target,$(2))
+ $(call gb_ComponentTarget_get_outdir_target,$(2))
$(call gb_CppunitTest_get_target,$(1)) : \
- UNO_SERVICES += $(call gb_ComponentTarget_get_target,$(2))
+ UNO_SERVICES += $(call gb_ComponentTarget_get_outdir_target,$(2))
endef
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 194e003..1334964 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -39,6 +39,8 @@
# gb_Library_Library_platform
# gb_Library_TARGETS
+# doesn't do anything, just used for hooking up component target
+.PHONY: $(call gb_Library__get_final_target,%)
# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT)
@@ -69,10 +71,11 @@ $(call gb_LinkTarget_set_targettype,$(2),Library)
$(call gb_LinkTarget_add_defs,$(2),\
$(gb_Library_DEFS) \
)
+$(call gb_Library__get_final_target,$(1)) : $(call gb_Library_get_target,$(1))
$(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
$(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1)))
-$$(eval $$(call gb_Module_register_target,$(call gb_Library_get_target,$(1)),$(call gb_Library_get_clean_target,$(1))))
+$$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1))))
$(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
endef
@@ -97,13 +100,18 @@ $(if $(3),,$(call gb_Output_error,gb_Library_set_soversion_script: no script))
$(call gb_Library__set_soversion_script_platform,$(1),$(2),$(3))
endef
+# The dependency from workdir component target to outdir library should ensure
+# that gb_CppunitTest_add_component can transitively depend on the library.
+# But the component target also must be delivered, so a new phony target
+# gb_Library__get_final_target has been invented for that purpose...
define gb_Library_set_componentfile
$(call gb_ComponentTarget_ComponentTarget,$(2),$(call gb_Library__get_componentprefix,$(1)),\
$(call gb_Library_get_runtime_filename,$(if $(MERGELIBS),$(if $(filter $(gb_MERGED_LIBS),$(1)),merged,$(1)),$(1))))
-$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \
+$(call gb_Library__get_final_target,$(1)) : \
$(call gb_ComponentTarget_get_outdir_target,$(2))
-$(call gb_Library_get_clean_target,$(1)) : $(call gb_ComponentTarget_get_clean_target,$(or $(strip $(3)),$(strip $(2))))
-
+$(call gb_ComponentTarget_get_target,$(2)) :| $(call gb_Library_get_target,$(1))
+$(call gb_Library_get_clean_target,$(1)) : \
+ $(call gb_ComponentTarget_get_clean_target,$(2))
endef
gb_Library__get_componentprefix = \
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index b7a4fde..cbe2ee7 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -133,6 +133,8 @@ gb_XcuResTarget_get_target = $(WORKDIR)/XcuResTarget/$(1)
gb_Zip_get_target = $(WORKDIR)/Zip/$(1).zip
gb_Zip_get_final_target = $(WORKDIR)/Zip/$(1).done
+gb_Library__get_final_target = $(WORKDIR)/Dummy/$(1)
+
define gb_Library_get_external_headers_target
$(patsubst $(1):%,$(WORKDIR)/ExternalHeaders/Library/%,$(filter $(1):%,$(gb_Library_FILENAMES)))
endef
commit 268cfdf23ca410d68bc9f7fb03e32a9a603d0e6d
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Dec 16 15:00:32 2011 +0100
gbuild: gb_LinkTarget_set_auxtargets => add_auxtargets
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 48d2d6a..194e003 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -85,7 +85,7 @@ $(call gb_Library_get_target,$(1)) : SOVERSIONSCRIPT := $(3)
$(call gb_Library_get_target,$(1)) \
$(call gb_Library_get_clean_target,$(1)) : \
AUXTARGETS += $(call gb_Library_get_target,$(1)).$(2)
-$(call gb_LinkTarget_set_auxtargets,$(call gb_Library_get_linktargetname,$(1)),\
+$(call gb_LinkTarget_add_auxtargets,$(call gb_Library_get_linktargetname,$(1)),\
$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).$(2))
endef
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index c094bb4..4a7833c 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -896,7 +896,12 @@ $(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2)
endef
define gb_LinkTarget_set_auxtargets
-$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS := $(2)
+$$(call gb_Output_error,\
+ gb_LinkTarget_set_auxtargets: use gb_LinkTarget_add_auxtargets instead.)
+endef
+
+define gb_LinkTarget_add_auxtargets
+$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS += $(2)
endef
define gb_LinkTarget__add_internal_headers
diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
index c7387e9..990a12f 100644
--- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
@@ -320,7 +320,7 @@ gb_Library_ILIBEXT := .lib
define gb_Library_Library_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(OUTDIR)/bin/$(notdir $(3)))
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.dll,%.map,$(3)) \
)
@@ -404,7 +404,7 @@ gb_CppunitTest_get_libfilename = test_$(1).dll
define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.dll,%.map,$(3)) \
)
diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
index ddf9aea..2b0a1af 100644
--- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk
@@ -464,7 +464,7 @@ gb_Library_DLLFILENAMES :=\
define gb_Library_Library_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
$(3).manifest \
$(call gb_LinkTarget_get_pdbfile,$(2)) \
@@ -535,7 +535,7 @@ define gb_StaticLibrary_StaticLibrary_platform
$(call gb_LinkTarget_get_target,$(2)) \
$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2))
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(call gb_LinkTarget_get_pdbfile,$(2)) \
)
@@ -549,7 +549,7 @@ gb_Executable_TARGETTYPEFLAGS := $(gb_Windows_PE_TARGETTYPEFLAGS)
gb_Executable_get_rpath :=
define gb_Executable_Executable_platform
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
$(call gb_LinkTarget_get_pdbfile,$(2)) \
$(call gb_LinkTarget_get_target,$(2)).manifest \
@@ -583,7 +583,7 @@ gb_CppunitTest_get_libfilename = test_$(1).dll
define gb_CppunitTest_CppunitTest_platform
$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
-$(call gb_LinkTarget_set_auxtargets,$(2),\
+$(call gb_LinkTarget_add_auxtargets,$(2),\
$(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
$(3).manifest \
$(patsubst %.dll,%.pdb,$(3)) \
More information about the Libreoffice-commits
mailing list