forked from Juniper/contrail-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscript
68 lines (53 loc) · 2.04 KB
/
SConscript
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
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
import sys
import platform
subdirs = [
'base',
'io',
]
include = ['#src/contrail-common', '#/build/include']
libpath = ['#/build/lib']
libs = ['boost_system', 'boost_thread', 'log4cplus']
if sys.platform.startswith('win'):
libs.append('windowsstubs')
else:
libs.append('pthread')
common = DefaultEnvironment().Clone()
if common['OPT'] == 'production' or common.UseSystemTBB():
libs.append('tbb')
else:
libs.append('tbb_debug')
common.Append(LIBPATH = libpath)
common.Prepend(LIBS = libs)
if sys.platform != 'win32':
common.Append(CCFLAGS = '-Wall -Werror -Wsign-compare')
if not sys.platform.startswith('darwin'):
if platform.system().startswith('Linux'):
if not platform.linux_distribution()[0].startswith('XenServer'):
common.Append(CCFLAGS = ['-Wno-unused-local-typedefs'])
if sys.platform.startswith('freebsd'):
common.Append(CCFLAGS = ['-Wno-unused-local-typedefs'])
common.Append(CPPPATH = include)
common.Append(CCFLAGS = [common['CPPDEFPREFIX'] + 'RAPIDJSON_NAMESPACE=contrail_rapidjson'])
BuildEnv = common.Clone()
if sys.platform.startswith('linux'):
BuildEnv.Append(CCFLAGS = ['-DLINUX'])
elif sys.platform.startswith('darwin'):
BuildEnv.Append(CCFLAGS = ['-DDARWIN'])
if sys.platform.startswith('freebsd'):
BuildEnv.Prepend(LINKFLAGS = ['-lprocstat'])
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/net', '#controller/src/net/address.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http', '#controller/src/http/http_request.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http', '#controller/src/http/http_server.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http', '#controller/src/http/http_session.h')
BuildEnv.SConscript(dirs=['sandesh'])
for dir in subdirs:
BuildEnv.SConscript(dir + '/SConscript',
exports='BuildEnv',
variant_dir=BuildEnv['TOP'] + '/' + dir,
duplicate=0)
# Local Variables:
# mode: python
# End: