Modify Jamfile to configure external library support better.

This commit is contained in:
jzmaddock
2015-07-07 17:27:04 +01:00
parent 5a9c919ef6
commit 5ccb1b6c5f

View File

@ -20,20 +20,15 @@ import ../checks/config : requires ;
local is_unix = [ modules.peek : UNIX ] ;
lib atomic ;
lib pthread ;
lib rt ;
exe has_atomic_lib : config_info.cpp atomic ;
explicit has_atomic_lib ;
if $(is_unix)
{
local osname = [ SHELL uname ] ;
switch $(osname)
{
case "Sun*" : OTHERFLAGS = "-lpthread -lrt" ;
case "*BSD*" : OTHERFLAGS = "-lpthread" ;
}
}
exe has_pthread_lib : config_info.cpp pthread ;
explicit has_pthread_lib ;
exe has_rt_lib : config_info.cpp rt ;
explicit has_rt_lib ;
test-suite config
:
@ -44,6 +39,8 @@ test-suite config
: #requirements
<threading>multi
[ check-target-builds has_atomic_lib : <source>atomic ]
[ check-target-builds has_pthread_lib : <source>pthread ]
[ check-target-builds has_rt_lib : <source>rt ]
: config_test_threaded
]
[ run config_test.cpp
@ -51,20 +48,18 @@ test-suite config
: #input-files
: #requirements
<threading>single <toolset>msvc:<runtime-link>static <toolset>msvc:<link>static
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
[ check-target-builds has_atomic_lib : <source>atomic ]
[ check-target-builds has_pthread_lib : <source>pthread ]
[ check-target-builds has_rt_lib : <source>rt ]
]
[ run config_test.cpp
: #args
: #input-files
: #requirements
<rtti>off
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
[ check-target-builds has_atomic_lib : <source>atomic ]
[ check-target-builds has_pthread_lib : <source>pthread ]
[ check-target-builds has_rt_lib : <source>rt ]
: config_test_no_rtti
]
[ run config_test.cpp
@ -72,10 +67,9 @@ test-suite config
: #input-files
: #requirements
<exception-handling>off
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)
[ check-target-builds has_atomic_lib : <source>atomic ]
[ check-target-builds has_pthread_lib : <source>pthread ]
[ check-target-builds has_rt_lib : <source>rt ]
: config_test_no_except
]
[ run config_info.cpp : : : <test-info>always_show_run_output <threading>single <toolset>msvc:<runtime-link>static <toolset>msvc:<link>static ]