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
|
$NetBSD: patch-SConstruct,v 1.5 2016/10/24 19:25:47 ryoon Exp $
Add support for NetBSD/Dragonfly, fix locations.
--- SConstruct.orig 2016-06-02 14:46:27.000000000 +0000
+++ SConstruct
@@ -40,8 +40,12 @@ def get_running_os_name():
running_os = os.sys.platform
if running_os.startswith('linux'):
running_os = 'linux'
+ elif running_os.startswith('dragonfly'):
+ running_os = 'dragonfly'
elif running_os.startswith('freebsd'):
running_os = 'freebsd'
+ elif running_os.startswith('netbsd'):
+ running_os = 'netbsd'
elif running_os.startswith('openbsd'):
running_os = 'openbsd'
elif running_os == 'sunos5':
@@ -59,7 +63,7 @@ def env_get_os_name_wrapper(self):
def is_os_raw(target_os, os_list_to_check):
okay = False
- posix_os_list = [ 'linux', 'openbsd', 'freebsd', 'osx', 'solaris' ]
+ posix_os_list = [ 'linux', 'openbsd', 'freebsd', 'osx', 'solaris', 'dragonfly', 'netbsd' ]
for p in os_list_to_check:
if p == 'posix' and target_os in posix_os_list:
@@ -831,6 +835,7 @@ envDict = dict(BUILD_ROOT=buildDir,
INSTALL_DIR=installDir,
CONFIG_HEADER_DEFINES={},
LIBDEPS_TAG_EXPANSIONS=[],
+ ENV = os.environ,
)
env = Environment(variables=env_vars, **envDict)
@@ -968,7 +973,9 @@ def CheckForProcessor(context, which_arc
os_macros = {
"windows": "_WIN32",
"solaris": "__sun",
+ "dragonfly": "__DragonFly__",
"freebsd": "__FreeBSD__",
+ "netbsd": "__NetBSD__",
"openbsd": "__OpenBSD__",
"osx": "__APPLE__",
"linux": "__linux__",
@@ -1233,7 +1240,7 @@ if env['_LIBDEPS'] == '$_LIBDEPS_OBJS':
libdeps.setup_environment(env, emitting_shared=(link_model.startswith("dynamic")))
-if env.TargetOSIs('linux', 'freebsd', 'openbsd'):
+if env.TargetOSIs('linux', 'dragonfly', 'freebsd', 'netbsd', 'openbsd'):
env['LINK_LIBGROUP_START'] = '-Wl,--start-group'
env['LINK_LIBGROUP_END'] = '-Wl,--end-group'
env['LINK_WHOLE_ARCHIVE_START'] = '-Wl,--whole-archive'
@@ -1261,10 +1268,24 @@ if env.TargetOSIs('linux'):
elif env.TargetOSIs('solaris'):
env.Append( LIBS=["socket","resolv","lgrp"] )
+elif os.sys.platform.startswith( "dragonfly" ):
+ env.Append( CPPPATH=[ "@PREFIX@/include" ] )
+ env.Append( LIBPATH=[ "@PREFIX@/lib" ] )
+ env.Append( LIBS=[ "m" ] )
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( CPPDEFINES=[ "__dragonfly__" ] )
+
elif env.TargetOSIs('freebsd'):
env.Append( LIBS=[ "kvm" ] )
env.Append( CCFLAGS=[ "-fno-omit-frame-pointer" ] )
+elif os.sys.platform.startswith( "netbsd" ):
+ env.Append( CPPPATH=[ "@PREFIX@/include" ] )
+ env.Append( LIBPATH=[ "@PREFIX@/lib" ] )
+ env.Append( LIBS=[ "m" ] )
+ env.Append( LIBS=[ "kvm" ] )
+ env.Append( CPPDEFINES=[ "__netbsd__" ] )
+
elif env.TargetOSIs('openbsd'):
env.Append( LIBS=[ "kvm" ] )
@@ -1432,8 +1453,11 @@ if env.TargetOSIs('posix'):
if not has_option("disable-warnings-as-errors"):
env.Append( CCFLAGS=["-Werror"] )
+ env.Append( CPPDEFINES=["XP_UNIX=1"] )
env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
+ env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
+ env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
# SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
# startup.
@@ -2406,6 +2430,7 @@ def doConfigure(myenv):
# permit more than four parameters.
"BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD",
"BOOST_SYSTEM_NO_DEPRECATED",
+ "BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE",
]
)
@@ -2472,7 +2497,7 @@ def doConfigure(myenv):
myenv.ConfError("Couldn't find SASL header/libraries")
# requires ports devel/libexecinfo to be installed
- if env.TargetOSIs('freebsd', 'openbsd'):
+ if env.TargetOSIs('dragonfly', 'freebsd', 'netbsd', 'openbsd'):
if not conf.CheckLib("execinfo"):
myenv.ConfError("Cannot find libexecinfo, please install devel/libexecinfo.")
|