From 297827477bc348fcf07166b09cb15a28d8c23a74 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 22 May 2009 14:51:16 +0000 Subject: [PATCH] Added rule SetVersionScript to set the version script for a target and adjusted the Link and KernelLd rules to support it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30825 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/KernelRules | 7 ++++--- build/jam/MainBuildRules | 15 +++++++++++++++ build/jam/OverriddenJamRules | 10 ++++++---- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/build/jam/KernelRules b/build/jam/KernelRules index 2c6f6a19e2..f0dba32319 100644 --- a/build/jam/KernelRules +++ b/build/jam/KernelRules @@ -56,7 +56,7 @@ rule KernelLd LocalDepends all : $(1) ; Depends $(1) : $(2) ; - MakeLocateDebug $(1) ; + MakeLocateDebug $(1) ; on $(1) XRes $(1) : $(RESFILES) ; if ! [ on $(1) return $(DONT_USE_BEOS_RULES) ] { @@ -66,9 +66,10 @@ rule KernelLd } } -actions KernelLd +actions KernelLd bind VERSION_SCRIPT { - $(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" $(LINKLIBS) ; + $(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" $(LINKLIBS) \ + --version-script=$(VERSION_SCRIPT) } rule KernelAddon diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index 18ba52d2f8..a9f31045b9 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -536,6 +536,21 @@ rule AddResources } } +rule SetVersionScript target : versionScript +{ + # SetVersionScript : + # + # Sets the version script for . Grist will be added to + # and SEARCH will be set on it. + + versionScript = [ FGristFiles $(versionScript) ] ; + + SEARCH on $(versionScript) += $(SEARCH_SOURCE) ; + + VERSION_SCRIPT on $(target) = $(versionScript) ; + Depends $(target) : $(versionScript) ; +} + rule BuildPlatformObjects { # Usage BuildPlatformObjects ; diff --git a/build/jam/OverriddenJamRules b/build/jam/OverriddenJamRules index 146cb9e527..5aee80234d 100644 --- a/build/jam/OverriddenJamRules +++ b/build/jam/OverriddenJamRules @@ -52,17 +52,19 @@ rule Link # uses separate files, we need to remove the target explicitely first, so that # the attributes won't be "leaked". if $(HOST_PLATFORM_BEOS_COMPATIBLE) || $(HAIKU_HOST_USE_XATTR) = 1 { - actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE + actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE VERSION_SCRIPT { $(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \ - "$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" ; + "$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" \ + -Wl,--version-script,$(VERSION_SCRIPT) } } else { - actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE + actions Link bind NEEDLIBS LINK_BEGIN_GLUE LINK_END_GLUE VERSION_SCRIPT { $(RM) "$(1)" $(LINK) $(LINKFLAGS) -o "$(1)" $(UNDEFS) "$(LINK_BEGIN_GLUE)" "$(2)" \ - "$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" ; + "$(NEEDLIBS)" $(LINKLIBS) "$(LINK_END_GLUE)" \ + -Wl,--version-script,$(VERSION_SCRIPT) } }