From cfe61e5caadfa8a8874cb646397e70b92a65bc53 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 11 Dec 2002 17:40:48 +0000 Subject: [PATCH] Introduce the and features. * gcc.jam: Handle the feature. * builtin.jam New features and . (link-action.adjust-properties): Add library's full paths to when is specified. [SVN r16588] --- gcc.jam | 12 +++++++++--- src/tools/builtin.jam | 19 +++++++++++++++++-- test/project_test4.py | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gcc.jam b/gcc.jam index fc0543593..224730f7f 100644 --- a/gcc.jam +++ b/gcc.jam @@ -61,16 +61,17 @@ toolset.flags gcc.link FINDLIBS-SA ; toolset.flags gcc.link LIBRARIES ; toolset.flags gcc.link LINK-RUNTIME static : static ; toolset.flags gcc.link LINK-RUNTIME shared : dynamic ; +toolset.flags gcc.link-dll RPATH ; rule link ( targets * : sources * : properties * ) { - ECHO "PROPS = " $(properties) ; + SPACE on $(targets) = " " ; } actions link bind LIBRARIES { - $(NAME:E=g++) $(OPTIONS) -L$(LINKPATH) -o $(<) $(>) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) + $(NAME:E=g++) $(OPTIONS) -L$(LINKPATH) -Wl,-rpath$(SPACE)-Wl,$(RPATH) -o $(<) $(>) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) } # Declare action for creating static libraries @@ -88,9 +89,14 @@ toolset.flags gcc.link-dll FINDLIBS-SA ; toolset.flags gcc.link-dll LIBRARIES ; toolset.flags gcc.link-dll LINK-RUNTIME static : static ; toolset.flags gcc.link-dll LINK-RUNTIME shared : dynamic ; +toolset.flags gcc.link RPATH ; +rule link-dll ( targets * : sources * : properties * ) +{ + SPACE on $(targets) = " " ; +} actions link-dll bind LIBRARIES { - $(NAME:E=g++) $(OPTIONS) -o $(<) -Wl,-soname,$(<[1]:D=) -shared $(>) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) + $(NAME:E=g++) $(OPTIONS) -Wl,-rpath$(SPACE)-Wl,$(RPATH) -o $(<) -Wl,-soname,$(<[1]:D=) -shared $(>) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) $(LIBRARIES) -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME) } diff --git a/src/tools/builtin.jam b/src/tools/builtin.jam index 937b1f0db..540b2e573 100644 --- a/src/tools/builtin.jam +++ b/src/tools/builtin.jam @@ -45,6 +45,9 @@ feature library-file : : free path ; feature name : : free ; feature search : : free path ; +feature dll-path : : free path ; +feature hardcode-dll-paths : false true : incidental propagated ; + feature variant : : implicit composite propagated symmetric ; # Declares a new variant. @@ -387,7 +390,14 @@ rule link-action ( targets + : sources * : action-name : properties * ) action.__init__ $(targets) : $(sources) : $(action-name) : $(properties) ; rule adjust-properties ( properties * ) - { + { + local hardcore-rpath ; + local rpaths ; + if true in $(properties) + { + hardcore-rpath = true ; + } + local pwd = [ path.pwd ] ; local extra ; for local s in $(self.sources) { @@ -412,9 +422,14 @@ rule link-action ( targets + : sources * : action-name : properties * ) else if [ type.is-derived [ $(s).type ] LIB ] { extra += $(s) ; + if $(hardcore-rpath) + { + rpaths += [ path.root [ $(s).path ] $(pwd) ] ; + } } + rpaths = [ sequence.unique $(rpaths) ] ; + extra += $(rpaths) ; } - ECHO "EXtra is " $(extra) ; return $(properties) $(extra) ; } diff --git a/test/project_test4.py b/test/project_test4.py index 66250549b..f3b8da3e9 100644 --- a/test/project_test4.py +++ b/test/project_test4.py @@ -47,7 +47,7 @@ t.copy("lib/Jamfile3", "lib/Jamfile") expected="""warning: skipped build of lib/b.obj with properties gcc shared shared on single on -on debug +on false debug don't know how to make <.>lib/b.obj/on ...skipped <./gcc/debug>a.exe for lack of <.>lib/b.obj/on... """