From f48a576ff2c4f2ebd20b681d0c9b8233fe674a9d Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 27 Apr 2013 09:04:19 +0200 Subject: [PATCH] gbuild: copy shared libs into $(INSTDIR) Change-Id: I20612a93a25d1748725a792cfae0bce8c3ef262b --- solenv/gbuild/Library.mk | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 8db3cf04adc4..37721d7cae64 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -38,6 +38,10 @@ # gb_Library_FILENAMES # gb_Library_Library_platform +gb_Library_LAYER_DIRS := \ + OOO:program \ + URELIB:ure/$(notdir $(gb_Helper_OUTDIRLIBDIR)) + # doesn't do anything, just used for hooking up component target .PHONY: $(call gb_Library__get_final_target,%) @@ -48,6 +52,11 @@ $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) : rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \ $(AUXTARGETS)) +gb_Library_get_packagename = Library/$(1) + +gb_Library__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER_DIRS))) +gb_Library__get_instdir = $(call gb_Library__get_dir_for_layer,$(call gb_Library_get_layer,$(1))) + define gb_Library_Library $(call gb_Postprocess_get_target,AllLibraries) : $(call gb_Library_get_target,$(1)) ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS))) @@ -72,12 +81,31 @@ $(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_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1))) + +ifneq ($(gb_RUNNABLE_INSTDIR),) +$(if $(filter $(call gb_Library_get_layer,$(1)):%,$(gb_Library_LAYER_DIRS)),\ + $(call gb_Library__Library_package,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_runtime_filename,$(1))) \ +) +endif + $$(eval $$(call gb_Module_register_target,$(call gb_Library__get_final_target,$(1)),$(call gb_Library_get_clean_target,$(1)))) $(call gb_Helper_make_userfriendly_targets,$(1),Library,$(call gb_Library__get_final_target,$(1))) $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1)) endef +# gb_Library__Library_package library package filename +define gb_Library__Library_package +$(call gb_Package_Package,$(2),$(gb_Helper_OUTDIRLIBDIR)) +$(call gb_Package_set_outdir,$(2),$(INSTDIR)) +$(call gb_Package_add_file,$(2),$(call gb_Library__get_instdir,$(1))/$(3),$(3)) + +$(call gb_Library__get_final_target,$(1)) : $(call gb_Package_get_target,$(2)) +$(call gb_Package_get_target,$(2)) : $(call gb_Library_get_target,$(1)) +$(call gb_Library_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2)) + +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. @@ -95,10 +123,19 @@ $(foreach aux,$(2),$(call gb_Library_add_auxtarget,$(1),$(aux))) endef +# gb_Library__add_soversion_link library package linkname +define gb_Library__add_soversion_link +$(call gb_Library_add_auxtarget,$(1),$(3)) +ifneq ($(gb_RUNNABLE_INSTDIR),) +$(call gb_Package_add_file,$(2),$(call gb_Library__get_instdir,$(1))/$(notdir $(3)),$(notdir $(3))) +endif + +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_add_auxtarget,$(1),$(call gb_Library_get_target,$(1)).$(2)) +$(call gb_Library__add_soversion_link,$(1),$(call gb_Library_get_packagename,$(1)),$(call gb_Library_get_target,$(1)).$(2)) endef