forked from tungstenfabric/tf-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscript
123 lines (107 loc) · 5.16 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
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
120
121
122
123
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
import platform
import subprocess
import sys
subdirs = [
'base',
'io',
'http',
'database',
'libpartition',
'zookeeper',
'config-client-mgr',
]
include = ['#src/contrail-common', '#/build/include']
libpath = ['#/build/lib']
libs = ['boost_system', 'boost_thread', 'log4cplus', 'pthread', 'tbb']
common = DefaultEnvironment().Clone()
common.Append(LIBPATH = libpath)
common.Prepend(LIBS = libs)
common.Append(CCFLAGS = ['-Wall', '-Werror', '-Wsign-compare'])
gpp_version = subprocess.check_output(
"g++ --version | grep g++ | awk '{print $3}'",
shell=True).rstrip()
if isinstance(gpp_version, bytes):
gpp_version = gpp_version.decode()
gpp_version_major = int(gpp_version.split(".")[0])
if gpp_version_major >= 8:
# auto_ptr is depricated - dont error on deprication warnings
common.Append(CCFLAGS = ['-Wno-error=deprecated-declarations', '-Wno-deprecated-declarations'])
common.Append(CCFLAGS = ['-Wno-error=nonnull-compare', '-Wno-nonnull-compare'])
if not sys.platform.startswith('darwin') and platform.system().startswith('Linux'):
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'] + '/http',
'#src/contrail-common/http/http_request.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http',
'#src/contrail-common/http/http_server.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http',
'#src/contrail-common/http/http_session.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http',
'#src/contrail-common/http/client/vncapi.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http',
'#src/contrail-common/http/client/http_curl.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/http',
'#src/contrail-common/http/client/http_client.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/zookeeper',
'#src/contrail-common/zookeeper/zookeeper_client.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database',
'#src/contrail-common/database/gendb_if.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd',
'#src/contrail-common/database/etcd/eql_if.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd/proto',
'#src/contrail-common/database/etcd/proto/auth.pb.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd/proto',
'#src/contrail-common/database/etcd/proto/etcdserver.pb.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd/proto',
'#src/contrail-common/database/etcd/proto/kv.pb.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd/proto',
'#src/contrail-common/database/etcd/proto/rpc.grpc.pb.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/etcd/proto',
'#src/contrail-common/database/etcd/proto/rpc.pb.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/cassandra/cql',
'#src/contrail-common/database/cassandra/cql/cql_if.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/cassandra/cql',
'#src/contrail-common/database/cassandra/cql/cql_if_impl.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database/cassandra/cql',
'#src/contrail-common/database/cassandra/cql/cql_lib_if.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/database',
'#src/contrail-common/database/gendb_statistics.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_json_parser_base.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_cass2json_adapter.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/json_adapter_data.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_client_manager.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_client_options.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_factory.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/config-client-mgr',
'#src/contrail-common/config-client-mgr/config_factory.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/ifmap',
'#controller/src/ifmap/autogen.h')
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/ifmap',
"#controller/src/ifmap/ifmap_object.h")
BuildEnv.Install(BuildEnv['TOP_INCLUDE'] + '/ifmap',
"#controller/src/ifmap/ifmap_origin.h")
BuildEnv.SConscript(dirs=['sandesh'])
for dir in subdirs:
BuildEnv.SConscript(dir + '/SConscript',
exports='BuildEnv',
variant_dir=BuildEnv['TOP'] + '/' + dir,
duplicate=0)