summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/log/build/log-platform-config.jam
blob: cee01cc1004b8be99755311771d392acebedd3ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# log-platform-config.jam
#
# Copyright 2017 Andrey Semashev
#
# Distributed under the Boost Software License Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

import configure ;
import project ;
import path ;
import property ;
import feature ;

local here = [ modules.binding $(__name__) ] ;

project.push-current [ project.current ] ;
project.load [ path.join [ path.make $(here:D) ] ../config/xopen-source-600 ] ;
project.pop-current ;

rule set-platform-defines ( properties * )
{
    local result = ;

    if ( <target-os>windows in $(properties) ) || ( <target-os>cygwin in $(properties) )
    {
        result += <define>NOMINMAX ;
        result += <define>WIN32_LEAN_AND_MEAN ;
        result += <define>SECURITY_WIN32 ;
        result += <define>BOOST_USE_WINDOWS_H ;

        if <target-os>cygwin in $(properties)
        {
            result += <define>__USE_W32_SOCKETS ;
            result += <define>_XOPEN_SOURCE=600 ;
        }
    }
    else if <target-os>solaris in $(properties)
    {
        # 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.
        # 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.
        if [ configure.builds /boost/log/xopen-source-600//xopen_source_600 : $(properties) : xopen-source-600-supported ]
        {
            result += <define>_XOPEN_SOURCE=600 ;
        }
        else
        {
            result += <define>_XOPEN_SOURCE=500 ;
        }

        result += <define>__EXTENSIONS__ ;
    }
    else if ( <target-os>linux in $(properties) ) || ( <target-os>hpux in $(properties) )
    {
        result += <define>_XOPEN_SOURCE=600 ;
    }

    return $(result) ;
}