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) ] ; }