From 97b175a4f5ef4aaccb0adfa43e8249b74a98be65 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 19 Mar 2003 09:00:25 +0000 Subject: [PATCH] Prevent 'hardcode-dll-paths' from setting rpath on static libraries. Thanks to Ali Azarbayejani for the bug report. [SVN r17999] --- new/builtin.jam | 34 +++++++++++++++++++++++++--------- v2/tools/builtin.jam | 34 +++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/new/builtin.jam b/new/builtin.jam index 4ac6f4cd5..28bd4a631 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -240,14 +240,29 @@ if [ os.name ] = NT # must be conditional; we'll error on other OSes } -flags builtin.response-file LIBRARIES ; - # response-file generation is broken up into two phases, the first of # which overwrites any existing file and the second of which appends # to the file, piecemeal, so that no command-line is too long. rule response-file ( target : sources * : properties * ) { - sources += [ on $(target) return $(LIBRARIES) ] ; + # Add libraries from property to the list of sources. + local libraries ; + for local p in $(properties) + { + if $(p:G) = && + ! [ type.is-derived [ $(p:G=).type ] SHARED_LIB ] + { + libraries += $(p:G=) ; + } + } + # Get real jam targets + local xlibraries ; + for local l in $(libraries) + { + xlibraries += [ $(l).actualize ] ; + } + + sources += $(xlibraries) ; response-file-1 $(target) : $(sources[1]) ; if $(sources[2-]) @@ -511,24 +526,25 @@ rule link-action ( targets + : sources * : action-name : properties * ) if [ class.is-a $(s) : searched-lib-target ] { local name = [ $(s).real-name ] ; + local search = [ $(s).search ] ; if [ $(s).shared ] { properties2 += $(name) ; + if $(hardcore-rpath) + { + rpaths += $(search) ; + } } else { properties2 += $(name) ; } - local search = [ $(s).search ] ; - if $(hardcore-rpath) - { - rpaths += $(search) ; - } properties2 += $(search) ; } else { - if $(hardcore-rpath) + if $(hardcore-rpath) && + [ type.is-derived [ $(s).type ] SHARED_LIB ] { rpaths += [ path.root [ $(s).path ] $(pwd) ] ; } diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 4ac6f4cd5..28bd4a631 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -240,14 +240,29 @@ if [ os.name ] = NT # must be conditional; we'll error on other OSes } -flags builtin.response-file LIBRARIES ; - # response-file generation is broken up into two phases, the first of # which overwrites any existing file and the second of which appends # to the file, piecemeal, so that no command-line is too long. rule response-file ( target : sources * : properties * ) { - sources += [ on $(target) return $(LIBRARIES) ] ; + # Add libraries from property to the list of sources. + local libraries ; + for local p in $(properties) + { + if $(p:G) = && + ! [ type.is-derived [ $(p:G=).type ] SHARED_LIB ] + { + libraries += $(p:G=) ; + } + } + # Get real jam targets + local xlibraries ; + for local l in $(libraries) + { + xlibraries += [ $(l).actualize ] ; + } + + sources += $(xlibraries) ; response-file-1 $(target) : $(sources[1]) ; if $(sources[2-]) @@ -511,24 +526,25 @@ rule link-action ( targets + : sources * : action-name : properties * ) if [ class.is-a $(s) : searched-lib-target ] { local name = [ $(s).real-name ] ; + local search = [ $(s).search ] ; if [ $(s).shared ] { properties2 += $(name) ; + if $(hardcore-rpath) + { + rpaths += $(search) ; + } } else { properties2 += $(name) ; } - local search = [ $(s).search ] ; - if $(hardcore-rpath) - { - rpaths += $(search) ; - } properties2 += $(search) ; } else { - if $(hardcore-rpath) + if $(hardcore-rpath) && + [ type.is-derived [ $(s).type ] SHARED_LIB ] { rpaths += [ path.root [ $(s).path ] $(pwd) ] ; }