summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Library.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-10-23 14:00:50 +0200
committerMichael Stahl <mstahl@redhat.com>2012-10-23 15:12:43 +0200
commit85b6a93cf41fb05e726027e34fcd805330e20414 (patch)
tree3f0404f073b8bd6d442a59e8075a1c25d61b54da /solenv/gbuild/Library.mk
parent3784cd9b03f9251ebbffd9a976363f685b3bc58a (diff)
gbuild: fix AUXTARGETS:
This finally blew up spectacularly on Windows because we now have packages delivering external libraries to the solver, where the libraries are not defined by Library class, which leads to accidental inheritance of AUXTARGETS variable and failure to deliver nonexistent UnpackedTarball/.../libpq/postgresql-sdbc-impl.uno.dll Remove the custom deliver rule that uses AUXTARGETS, and instead let those files be handled individually by default Package.mk rules. This requires a dummy touch rule for each file, and unfortunately a pattern rule cannot be used here because of silly naming differences between implibs and dlls on Windows... AUXTARGETS do not cause problems for clean targets because there is no interdependency there, so keep them there. Change-Id: I2138f635334ff4517a2d31ef91cfd03a46745fd6
Diffstat (limited to 'solenv/gbuild/Library.mk')
-rw-r--r--solenv/gbuild/Library.mk30
1 files changed, 20 insertions, 10 deletions
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 924a2549ebbf..bb799114901c 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -48,18 +48,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) :
rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
$(AUXTARGETS))
-# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
-$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) :
- $(call gb_Helper_abbreviate_dirs,\
- $(call gb_Deliver_deliver,$<,$@) \
- $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
-
define gb_Library_Library
ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS)))
$$(eval $$(call gb_Output_info,Currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
$$(eval $$(call gb_Output_error,Library $(1) must be registered in Repository.mk))
endif
-$(call gb_Library_get_target,$(1)) : AUXTARGETS :=
$(call gb_Library_get_target,$(1)) : SOVERSION :=
$(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1)))
@@ -76,18 +69,35 @@ $(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)) \
| $(dir $(call gb_Library_get_target,$(1))).dir
$(call gb_Library_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
+$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS :=
$(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_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
+# Custom definition that does not simply forward to LinkTarget,
+# because there are cases where the auxtargets are not delivered to solver...
+# The auxtarget is delivered via the rule in Package.mk.
+# gb_Library_add_auxtarget library outdirauxtarget
+define gb_Library_add_auxtarget
+$(call gb_LinkTarget_add_auxtarget,$(call gb_Library_get_linktargetname,$(1)),$(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2)))
+$(call gb_Library_get_target,$(1)) : $(2)
+$(2) : $(dir $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))))/$(notdir $(2))
+$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += $(2)
+
+endef
+
+define gb_Library_add_auxtargets
+$(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux)))
+
+endef
+
define gb_Library__set_soversion_script
$(call gb_LinkTarget_set_soversion_script,$(call gb_Library_get_linktargetname,$(1)),$(2),$(3))
$(call gb_Library_get_target,$(1)) : SOVERSION := $(2)
-$(call gb_Library_get_target,$(1)) \
-$(call gb_Library_get_clean_target,$(1)) : \
- AUXTARGETS += $(call gb_Library_get_target,$(1)).$(2)
+$(call gb_Library_add_auxtarget,$(1),$(call gb_Library_get_target,$(1)).$(2))
+
endef
# for libraries that maintain stable ABI: set SOVERSION and version script