summaryrefslogtreecommitdiff
path: root/src/mongo/SConscript
blob: 4d0f077cb97a678cc595292b9c33fd797a07daf2 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- mode: python; -*-

import re
import sys

Import(
    [
        "env",
        "has_option",
        "get_option",
        "use_libunwind",
        "version_extra",
        "version_parts",
    ]
)

env = env.Clone()

env.InjectMongoIncludePaths()

env.AppendUnique(
    FORCEINCLUDES=[
        "mongo/platform/basic.h",
    ],
)

env.SConscript(
    must_exist=1,
    dirs=[
        "base",
        "bson",
        "client",
        "crypto",
        "db",
        "dbtests",
        "embedded",
        "executor",
        "idl",
        "installer",
        "logv2",
        "platform",
        "resmoke",
        "rpc",
        "s",
        "scripting",
        "shell",
        "stdx",
        "tools",
        "transport",
        "unittest",
        "util",
        "watchdog",
    ],
    exports=[
        "env",
    ],
)

sys.path.append("src/mongo")

# NOTE: The 'base' library does not really belong here. Its presence
# here is temporary. Do not add to this library, do not remove from
# it, and do not declare other libraries in this file.
baseEnv = env.Clone()

if use_libunwind == True:
    baseEnv.InjectThirdParty("unwind")
baseEnv.InjectThirdParty("intel_decimal128")

# Stage the top-level mongodb banners

distsrc = env.Dir("#distsrc")
env.AutoInstall(
    target="$PREFIX",
    source=[
        distsrc.File("README"),
        # TODO: we need figure out what to do when we use a different
        # THIRD-PARTY-NOTICES for example, with Embedded
        distsrc.File("THIRD-PARTY-NOTICES"),
        distsrc.File("MPL-2"),
    ],
    AIB_COMPONENT="common",
    AIB_COMPONENTS_EXTRA=["dist", "dist-test"],
    AIB_ROLE="base",
)

# If no module has introduced a file named LICENSE-Enterprise.txt then this
# is a Community build, so inject the AGPL and the Community license
enterprise_license = [
    banner for banner in env["MODULE_BANNERS"] if banner.name == "LICENSE-Enterprise.txt"
]
if not enterprise_license:
    env.Append(MODULE_BANNERS=[distsrc.File("LICENSE-Community.txt")])

# All module banners get staged to the top level of the tarfile, so we
# need to fail if we are going to have a name collision.
module_banner_filenames = set([f.name for f in env["MODULE_BANNERS"]])
if not len(module_banner_filenames) == len(env["MODULE_BANNERS"]):
    # TODO: Be nice and identify conflicts in error.
    env.FatalError("ERROR: Filename conflicts exist in module banners.")

env.AutoInstall(
    target="$PREFIX",
    source=env.get("MODULE_BANNERS", []),
    AIB_COMPONENT="common",
    AIB_COMPONENTS_EXTRA=["dist", "dist-test"],
    AIB_ROLE="base",
)

if env.TargetOSIs("darwin", "macOS"):
    env.AutoInstall(
        target="$PREFIX",
        source=[
            env.File("#/etc/macos_mongodb.plist"),
        ],
        AIB_COMPONENT="common",
        AIB_COMPONENTS_EXTRA=["dist", "dist-test"],
        AIB_ROLE="base",
    )