mirror of
https://github.com/boostorg/build.git
synced 2026-02-15 13:02:11 +00:00
Add host-os and target-os features.
[SVN r34889]
This commit is contained in:
@@ -25,9 +25,60 @@ import project ;
|
||||
|
||||
# This feature is used to determine which OS we're on.
|
||||
# In future, this may become <target-os> and <host-os>
|
||||
# The future is now...
|
||||
local os = [ modules.peek : OS ] ;
|
||||
feature os : $(os) : propagated link-incompatible ;
|
||||
|
||||
# Translates from bjam current OS to the os tags used
|
||||
# in host-os and target-os. I.e. it returns the
|
||||
# running host-os.
|
||||
local rule default-host-os ( )
|
||||
{
|
||||
local host-os ;
|
||||
local os-list = [ feature.values host-os ] ;
|
||||
if [ os.name ] in $(os-list:U)
|
||||
{
|
||||
host-os = [ os.name ] ;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch [ os.name ]
|
||||
{
|
||||
case NT : host-os = windows ;
|
||||
case AS400 : host-os = unix ;
|
||||
case MINGW : host-os = windows ;
|
||||
case BSDI : host-os = bsd ;
|
||||
case COHERENT : host-os = unix ;
|
||||
case DRAGONFLYBSD : host-os = bsd ;
|
||||
case IRIX : host-os = sgi ;
|
||||
case MACOSX : host-os = darwin ;
|
||||
case KFREEBSD : host-os = freebsd ;
|
||||
case * : host-os = unix ;
|
||||
}
|
||||
}
|
||||
return $(host-os:L) ;
|
||||
}
|
||||
|
||||
# The two OS features define a known set of abstract OS
|
||||
# names. The host-os is the OS under which bjam is running.
|
||||
# Even though this should really be a fixed property we need
|
||||
# to list all the values to prevent unkown value errors.
|
||||
# Both set the default value to the current OS to account for
|
||||
# the default use case of building on the target OS.
|
||||
feature host-os
|
||||
: amiga aix bsd cygwin darwin dos emx freebsd hpux
|
||||
linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
|
||||
svr4 sysv ultrix unixware vms windows
|
||||
: optional ;
|
||||
feature.set-default host-os : [ default-host-os ] ;
|
||||
feature target-os
|
||||
: amiga aix bsd cygwin darwin dos emx freebsd hpux
|
||||
linux netbsd openbsd osf qnx qnxnto sgi solaris sun sunos
|
||||
svr4 sysv ultrix unixware vms windows
|
||||
: propagated link-incompatible ;
|
||||
feature.set-default target-os : [ default-host-os ] ;
|
||||
|
||||
|
||||
feature toolset : : implicit propagated symmetric ;
|
||||
|
||||
feature stdlib : native : propagated composite ;
|
||||
|
||||
Reference in New Issue
Block a user