2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Improve library handling.

* new/toolset.jam
  (flags): Add 'unchecked' parameter, too allow declaring flags for other
  modules.

* new/builtin.jam: Don't declare LIBRARY_PATH_OPTION.
* new/borland.jam: Use flags to declare LIBRARY_PATH_OPTION and LIBRARY_OPTION.
* new/msvc.jam: Use flags to declare LIBRARY_PATH_OPTION and LIBRARY_OPTION.


[SVN r18222]
This commit is contained in:
Vladimir Prus
2003-04-09 14:14:57 +00:00
parent 85a59b8ae6
commit d631bb61ae
8 changed files with 32 additions and 14 deletions

View File

@@ -137,6 +137,9 @@ toolset.flags borland.link FINDLIBS-SA <find-shared-library> ;
toolset.flags borland.link LIBRARIES <library-file> ;
toolset.flags borland.link LIBRARIES <library> ;
flags builtin.response-file LIBRARY_PATH_OPTION <toolset>borland : -L : unchecked ;
flags builtin.response-file LIBRARY_OPTION <toolset>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])
}
}

View File

@@ -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 <find-static-library> ;
flags builtin.response-file FINDLIBS_SA <find-shared-library> ;
flags builtin.response-file LIBRARY_PATH <library-path> ;

View File

@@ -171,6 +171,10 @@ toolset.flags msvc.link USER_LINKFLAGS <linkflags> ;
toolset.flags msvc.link LINKPATH <library-path> ;
toolset.flags msvc.link FINDLIBS <find-static-library> <find-shared-library> ;
flags builtin.response-file LIBRARY_PATH_OPTION <toolset>msvc : /LIBPATH: : unchecked ;
flags builtin.response-file LIBRARY_OPTION <toolset>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

View File

@@ -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_)" ;
}

View File

@@ -137,6 +137,9 @@ toolset.flags borland.link FINDLIBS-SA <find-shared-library> ;
toolset.flags borland.link LIBRARIES <library-file> ;
toolset.flags borland.link LIBRARIES <library> ;
flags builtin.response-file LIBRARY_PATH_OPTION <toolset>borland : -L : unchecked ;
flags builtin.response-file LIBRARY_OPTION <toolset>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])
}
}

View File

@@ -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_)" ;
}

View File

@@ -171,6 +171,10 @@ toolset.flags msvc.link USER_LINKFLAGS <linkflags> ;
toolset.flags msvc.link LINKPATH <library-path> ;
toolset.flags msvc.link FINDLIBS <find-static-library> <find-shared-library> ;
flags builtin.response-file LIBRARY_PATH_OPTION <toolset>msvc : /LIBPATH: : unchecked ;
flags builtin.response-file LIBRARY_OPTION <toolset>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

View File

@@ -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 <find-static-library> ;
flags builtin.response-file FINDLIBS_SA <find-shared-library> ;
flags builtin.response-file LIBRARY_PATH <library-path> ;