diff --git a/new/borland.jam b/new/borland.jam index 4f2347143..4e43afa6a 100644 --- a/new/borland.jam +++ b/new/borland.jam @@ -137,6 +137,9 @@ toolset.flags borland.link FINDLIBS-SA ; toolset.flags borland.link LIBRARIES ; toolset.flags borland.link LIBRARIES ; +flags builtin.response-file LIBRARY_PATH_OPTION borland : -L : unchecked ; +flags builtin.response-file LIBRARY_OPTION borland : -l : unchecked ; + # bcc32 needs to have ilink32 in the path in order to invoke it, so explicitly # specifying $(BCC_TOOL_PATH)bcc32 doesn't help. You need to add @@ -147,7 +150,7 @@ if [ os.name ] = NT actions link bind LIBRARIES { set PATH=$(.root);%PATH% - "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) + "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(NEED_IMPLIB)"$(.root)implib" $(NEED_IMPLIB)$(<[2]) $(NEED_IMPLIB)$(<[1]) } } @@ -156,7 +159,7 @@ else actions link bind LIBRARIES { export PATH=$(.root):$PATH - "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) + "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(NEED_IMPLIB)"$(.root)implib" $(NEED_IMPLIB)$(<[2]) $(NEED_IMPLIB)$(<[1]) } } diff --git a/new/builtin.jam b/new/builtin.jam index c23cf7f19..ff2a4619b 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -274,8 +274,8 @@ rule response-file ( target : sources * : properties * ) print.output $(target) ; print.text [ on $(target) return "$(LIBRARY_PATH_OPTION)$(LIBRARY_PATH)" - "$(FINDLIBS_ST:S=.lib)" - "$(FINDLIBS_SA:S=.lib)" + "$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" + "$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)" ] ; } @@ -653,7 +653,6 @@ IMPORT $(__name__) : register-linker : : generators.register-linker ; declare-type NT CYGWIN : RSP : rsp ; if [ os.name ] in NT CYGWIN # must be conditional; we'll error on other OSes { - flags builtin.response-file LIBRARY_PATH_OPTION : /LIBPATH: ; flags builtin.response-file FINDLIBS_ST ; flags builtin.response-file FINDLIBS_SA ; flags builtin.response-file LIBRARY_PATH ; diff --git a/new/msvc.jam b/new/msvc.jam index 330e0e467..632760695 100755 --- a/new/msvc.jam +++ b/new/msvc.jam @@ -171,6 +171,10 @@ toolset.flags msvc.link USER_LINKFLAGS ; toolset.flags msvc.link LINKPATH ; toolset.flags msvc.link FINDLIBS ; +flags builtin.response-file LIBRARY_PATH_OPTION msvc : /LIBPATH: : unchecked ; +flags builtin.response-file LIBRARY_OPTION msvc : "" : unchecked ; + + # incremental linking a DLL causes no end of problems: if the # actual exports don't change, the import .lib file is never # updated. Therefore, the .lib is always out-of-date and gets diff --git a/new/toolset.jam b/new/toolset.jam index d27041819..d05d231ee 100644 --- a/new/toolset.jam +++ b/new/toolset.jam @@ -69,11 +69,14 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # # - empty. 'values' will be added to the variable # unconditionally - values * ) + values * : + unchecked ? # If value 'unchecked' is passed, will not test + # that flags are set for the calling module. + ) { local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ; local caller = [ CALLER_MODULE ] ; - if $(module_) != $(caller) + if $(unchecked) != unchecked && $(module_) != $(caller) { errors.error "Module $(caller) attempted to set flags for module $(module_)" ; } diff --git a/v2/borland.jam b/v2/borland.jam index 4f2347143..4e43afa6a 100644 --- a/v2/borland.jam +++ b/v2/borland.jam @@ -137,6 +137,9 @@ toolset.flags borland.link FINDLIBS-SA ; toolset.flags borland.link LIBRARIES ; toolset.flags borland.link LIBRARIES ; +flags builtin.response-file LIBRARY_PATH_OPTION borland : -L : unchecked ; +flags builtin.response-file LIBRARY_OPTION borland : -l : unchecked ; + # bcc32 needs to have ilink32 in the path in order to invoke it, so explicitly # specifying $(BCC_TOOL_PATH)bcc32 doesn't help. You need to add @@ -147,7 +150,7 @@ if [ os.name ] = NT actions link bind LIBRARIES { set PATH=$(.root);%PATH% - "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) + "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(NEED_IMPLIB)"$(.root)implib" $(NEED_IMPLIB)$(<[2]) $(NEED_IMPLIB)$(<[1]) } } @@ -156,7 +159,7 @@ else actions link bind LIBRARIES { export PATH=$(.root):$PATH - "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(FINDLIBS:S=.lib) + "$(.root)bcc32" -v -q $(OPTIONS) -L"$(LIBPATH)" -L"$(STDLIBPATH)" -e"$(<[1])" @"$(>)" $(NEED_IMPLIB)"$(.root)implib" $(NEED_IMPLIB)$(<[2]) $(NEED_IMPLIB)$(<[1]) } } diff --git a/v2/build/toolset.jam b/v2/build/toolset.jam index d27041819..d05d231ee 100644 --- a/v2/build/toolset.jam +++ b/v2/build/toolset.jam @@ -69,11 +69,14 @@ rule flags ( rule-or-module # If contains dot, should be a rule name. # # - empty. 'values' will be added to the variable # unconditionally - values * ) + values * : + unchecked ? # If value 'unchecked' is passed, will not test + # that flags are set for the calling module. + ) { local module_ = [ MATCH "([^.]*).*" : $(rule-or-module) ] ; local caller = [ CALLER_MODULE ] ; - if $(module_) != $(caller) + if $(unchecked) != unchecked && $(module_) != $(caller) { errors.error "Module $(caller) attempted to set flags for module $(module_)" ; } diff --git a/v2/msvc.jam b/v2/msvc.jam index 330e0e467..632760695 100755 --- a/v2/msvc.jam +++ b/v2/msvc.jam @@ -171,6 +171,10 @@ toolset.flags msvc.link USER_LINKFLAGS ; toolset.flags msvc.link LINKPATH ; toolset.flags msvc.link FINDLIBS ; +flags builtin.response-file LIBRARY_PATH_OPTION msvc : /LIBPATH: : unchecked ; +flags builtin.response-file LIBRARY_OPTION msvc : "" : unchecked ; + + # incremental linking a DLL causes no end of problems: if the # actual exports don't change, the import .lib file is never # updated. Therefore, the .lib is always out-of-date and gets diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index c23cf7f19..ff2a4619b 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -274,8 +274,8 @@ rule response-file ( target : sources * : properties * ) print.output $(target) ; print.text [ on $(target) return "$(LIBRARY_PATH_OPTION)$(LIBRARY_PATH)" - "$(FINDLIBS_ST:S=.lib)" - "$(FINDLIBS_SA:S=.lib)" + "$(LIBRARY_OPTION)$(FINDLIBS_ST:S=.lib)" + "$(LIBRARY_OPTION)$(FINDLIBS_SA:S=.lib)" ] ; } @@ -653,7 +653,6 @@ IMPORT $(__name__) : register-linker : : generators.register-linker ; declare-type NT CYGWIN : RSP : rsp ; if [ os.name ] in NT CYGWIN # must be conditional; we'll error on other OSes { - flags builtin.response-file LIBRARY_PATH_OPTION : /LIBPATH: ; flags builtin.response-file FINDLIBS_ST ; flags builtin.response-file FINDLIBS_SA ; flags builtin.response-file LIBRARY_PATH ;