]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/features/os-feature.jam
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / build / src / tools / features / os-feature.jam
1 # Copyright 2017 Rene Rivera
2 # Distributed under the Boost Software License, Version 1.0.
3 # (See accompanying file LICENSE_1_0.txt or copy at
4 # http://www.boost.org/LICENSE_1_0.txt)
5
6 # TODO: Documentation.
7
8 import feature ;
9 import modules ;
10 import os ;
11
12 .os-names =
13 aix android appletv bsd cygwin darwin freebsd haiku hpux iphone linux
14 netbsd openbsd osf qnx qnxnto sgi solaris unix unixware windows vms vxworks
15
16 # Not actually an OS -- used for targeting bare metal where object
17 # format is ELF. This catches both -elf and -eabi gcc targets as well
18 # as other compilers targeting ELF. It is not clear how often we need
19 # the 'elf' key as opposed to other bare metal targets, but let us
20 # stick with gcc naming.
21 elf
22 ;
23
24 # Feature used to determine which OS we're on. New <target-os> and <host-os>
25 # features should be used instead.
26 local os = [ modules.peek : OS ] ;
27 feature.feature os : $(os) : propagated link-incompatible ;
28
29 # Translates from bjam current OS to the os tags used in host-os and
30 # target-os, i.e. returns the running host-os.
31 #
32 local rule default-host-os ( )
33 {
34 local host-os ;
35 if [ os.name ] in $(.os-names:U)
36 {
37 host-os = [ os.name ] ;
38 }
39 else
40 {
41 switch [ os.name ]
42 {
43 case NT : host-os = windows ;
44 case AS400 : host-os = unix ;
45 case MINGW : host-os = windows ;
46 case BSDI : host-os = bsd ;
47 case COHERENT : host-os = unix ;
48 case DRAGONFLYBSD : host-os = bsd ;
49 case IRIX : host-os = sgi ;
50 case HAIKU : host-os = haiku ;
51 case MACOSX : host-os = darwin ;
52 case KFREEBSD : host-os = freebsd ;
53 case LINUX : host-os = linux ;
54 case VMS : host-os = vms ;
55 case SUNOS :
56 ECHO
57 "SunOS is not a supported operating system."
58 "We believe last version of SunOS was released in 1992, "
59 "so if you get this message, something is very wrong with "
60 "configuration logic. Please report this as a bug. " ;
61 EXIT ;
62 case * : host-os = unix ;
63 }
64 }
65 return $(host-os:L) ;
66 }
67
68
69 # The two OS features define a known set of abstract OS names. The host-os is
70 # the OS under which bjam is running. Even though this should really be a fixed
71 # property we need to list all the values to prevent unknown value errors. Both
72 # set the default value to the current OS to account for the default use case of
73 # building on the target OS.
74 feature.feature host-os : $(.os-names) ;
75 feature.set-default host-os : [ default-host-os ] ;
76
77 feature.feature target-os : $(.os-names) : propagated link-incompatible ;
78 feature.set-default target-os : [ default-host-os ] ;