diff options
author | David Tardon <dtardon@redhat.com> | 2012-09-16 19:50:15 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-09-22 08:15:46 +0200 |
commit | 360df63b633421f0d06f6c30e5ed9db3fa2016a5 (patch) | |
tree | ba4989d90a92dae8b24adcfd0d975d2728f5642d /solenv/gbuild | |
parent | 7531ac91d8496d00c7b010f8ce20bfee97cc9362 (diff) |
SOVERSION is used by LinkTarget, so set it there
Relying on inheritance of variables by prerequisites may cause all sorts
of weird problems, e.g., an executable being linked with
-Wl,--soname=... just because a library with explicitly set soname
happened to depend on it. I wonder if we should make most of the
target-specific variables private....
Change-Id: Id337ace462973e7af12e62414b81739e3e873d96
Diffstat (limited to 'solenv/gbuild')
-rw-r--r-- | solenv/gbuild/Library.mk | 7 | ||||
-rw-r--r-- | solenv/gbuild/LinkTarget.mk | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index ff478b4b74e2..01ee922935ae 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -62,7 +62,6 @@ $$(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_get_target,$(1)) : SOVERSIONSCRIPT := $(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(1))) endef @@ -84,15 +83,11 @@ $(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_L endef define gb_Library__set_soversion_script -$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) : \ - $(3) +$(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)) : 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_add_auxtargets,$(call gb_Library_get_linktargetname,$(1)),\ - $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).$(2)) endef # for libraries that maintain stable ABI: set SOVERSION and version script diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 3c670e80a835..7a34de069103 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -495,6 +495,8 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := $(call gb_LinkTarget_get_target,$(1)) : NATIVERES := $(call gb_LinkTarget_get_target,$(1)) : VISIBILITY := $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := +$(call gb_LinkTarget_get_target,$(1)) : SOVERSION := +$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := ifeq ($(gb_FULLDEPS),$(true)) -include $(call gb_LinkTarget_get_dep_target,$(1)) @@ -519,12 +521,22 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS := $(call gb_LinkTarget_get_dep_target,$(1)) : VISIBILITY := $(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := +$(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSION := +$(call gb_LinkTarget_get_dep_target,$(1)) : SOVERSIONSCRIPT := endif gb_LinkTarget_CXX_SUFFIX_$(1) := cxx endef +define gb_LinkTarget_set_soversion_script +$(call gb_LinkTarget_get_target,$(1)) : $(3) +$(call gb_LinkTarget_get_target,$(1)) : SOVERSION := $(2) +$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(3) +$(call gb_LinkTarget_add_auxtargets,$(1),$(call gb_LinkTarget_get_target,$(1)).$(2)) + +endef + define gb_LinkTarget_add_defs $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : DEFS += $(2) |