• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# log-platform-config.jam
2#
3# Copyright 2017 Andrey Semashev
4#
5# Distributed under the Boost Software License Version 1.0. (See
6# accompanying file LICENSE_1_0.txt or copy at
7# http://www.boost.org/LICENSE_1_0.txt)
8
9import configure ;
10import project ;
11import path ;
12import property ;
13import feature ;
14
15local here = [ modules.binding $(__name__) ] ;
16
17project.push-current [ project.current ] ;
18project.load [ path.join [ path.make $(here:D) ] ../config/xopen-source-600 ] ;
19project.pop-current ;
20
21rule set-platform-defines ( properties * )
22{
23    local result = ;
24
25    if ( <target-os>windows in $(properties) ) || ( <target-os>cygwin in $(properties) )
26    {
27        result += <define>NOMINMAX ;
28        result += <define>WIN32_LEAN_AND_MEAN ;
29        result += <define>SECURITY_WIN32 ;
30        result += <define>BOOST_USE_WINDOWS_H ;
31
32        if <target-os>cygwin in $(properties)
33        {
34            result += <define>__USE_W32_SOCKETS ;
35            result += <define>_XOPEN_SOURCE=600 ;
36        }
37    }
38    else if <target-os>solaris in $(properties)
39    {
40        # Solaris headers are broken and cannot be included in C++03 when _XOPEN_SOURCE=600. At the same time, they cannot be included with _XOPEN_SOURCE=500 in C++11 and later.
41        # This is because the system headers check the C language version and error out if the version does not match. We have to test if we can request _XOPEN_SOURCE=600.
42        if [ configure.builds /boost/log/xopen-source-600//xopen_source_600 : $(properties) : xopen-source-600-supported ]
43        {
44            result += <define>_XOPEN_SOURCE=600 ;
45        }
46        else
47        {
48            result += <define>_XOPEN_SOURCE=500 ;
49        }
50
51        result += <define>__EXTENSIONS__ ;
52    }
53    else if ( <target-os>linux in $(properties) ) || ( <target-os>hpux in $(properties) )
54    {
55        result += <define>_XOPEN_SOURCE=600 ;
56    }
57
58    return $(result) ;
59}
60