/
SConscript
174 lines (148 loc) · 4.26 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Copyright (c) 2009 XORP, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, Version 2, June
# 1991 as published by the Free Software Foundation. Redistribution
# and/or modification of this program under the terms of any other
# version of the GNU General Public License is not permitted.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
# see the GNU General Public License, Version 2, a copy of which can be
# found in the XORP LICENSE.gpl file.
#
# XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
# http://xorp.net
# $XORP$
import os
Import('env')
subdirs = [
'tools',
'tests',
'harness',
]
SConscript(dirs = subdirs, exports='env')
is_shared = env.has_key('SHAREDLIBS')
if not is_shared:
env.AppendUnique(LIBS = [
"crypto",
"rt",
])
bgp_env = env.Clone()
bgp_env.AppendUnique(CPPPATH = [
'#',
'$BUILDDIR',
])
bgp_env.PrependUnique(LIBPATH = [
'.',
'$BUILDDIR/policy/backend',
'$BUILDDIR/policy/common',
'$BUILDDIR/libfeaclient',
'$BUILDDIR/xrl/interfaces',
'$BUILDDIR/xrl/targets',
'$BUILDDIR/libxipc',
'$BUILDDIR/libxorp',
'$BUILDDIR/libcomm',
])
bgp_env.AppendUnique(LIBS = [
'xorp_policy_backend',
'xorp_policy_common',
'xorp_fea_client',
'xst_bgp',
'xst_fea_ifmgr_mirror',
'xif_rib',
'xif_finder_event_notifier',
'xif_fea_ifmgr_mirror',
'xif_fea_ifmgr_replicator',
'xorp_ipc',
'xorp_core',
'xorp_comm',
])
if not (bgp_env.has_key('disable_profile') and bgp_env['disable_profile']):
bgp_env.AppendUnique(LIBS = [ 'xif_profile_client' ])
bgp_env.Replace(RPATH = [
bgp_env.Literal(bgp_env['xorp_module_rpath'])
])
### libxorp_bgp
libxorp_bgp_env = bgp_env.Clone()
libxorp_bgp_srcs = [
'aspath.cc',
'attribute_manager.cc',
'bgp.cc',
'bgp_trie.cc',
'bgp_varrw.cc',
'bgp_varrw_export.cc',
'crash_dump.cc',
'damping.cc',
'dump_iterators.cc',
'internal_message.cc',
'iptuple.cc',
'local_data.cc',
'next_hop_resolver.cc',
'notification_packet.cc',
'open_packet.cc',
'packet.cc',
'parameter.cc',
'path_attribute.cc',
'peer.cc',
'peer_data.cc',
'peer_handler.cc',
'peer_list.cc',
'plumbing.cc',
'process_watch.cc',
'rib_ipc_handler.cc',
'route_queue.cc',
'route_table_aggregation.cc',
'route_table_base.cc',
'route_table_cache.cc',
'route_table_damping.cc',
'route_table_decision.cc',
'route_table_deletion.cc',
'route_table_dump.cc',
'route_table_fanout.cc',
'route_table_filter.cc',
'route_table_nhlookup.cc',
'route_table_policy.cc',
'route_table_policy_ex.cc',
'route_table_policy_im.cc',
'route_table_policy_sm.cc',
'route_table_reader.cc',
'route_table_ribin.cc',
'route_table_ribout.cc',
'socket.cc',
'subnet_route.cc',
'update_attrib.cc',
'update_packet.cc',
'xrl_target.cc',
]
if not (bgp_env.has_key('disable_profile') and bgp_env['disable_profile']):
libxorp_bgp_srcs.append('profile_vars.cc')
if is_shared:
libxorp_bgp = bgp_env.SharedLibrary(target = 'libxorp_bgp',
source = libxorp_bgp_srcs,
LIBS = '')
if bgp_env['rtld_origin']:
for obj in libxorp_bgp:
bgp_env.AddPostAction(libxorp_bgp,
bgp_env.Symlink(obj.abspath,
os.path.join(bgp_env['xorp_alias_libdir'], str(obj))))
else:
libxorp_ospf = bgp_env.StaticLibrary(target = 'libxorp_bgp',
source = libxorp_bgp_srcs,
LIBS = '')
### xorp_bgp
#bgp_env2 = bgp_env.Clone()
bgp_env.PrependUnique(LIBS = [
'xorp_bgp',
])
bgpsrcs = [
'main.cc',
]
bgp = bgp_env.Program(target = 'xorp_bgp', source = bgpsrcs)
bgp_env.Alias('install', bgp_env.InstallProgram(bgp_env['xorp_moduledir'], bgp))
if is_shared:
bgp_env.Alias('install', env.InstallLibrary(bgp_env['xorp_libdir'], libxorp_bgp))
# Install scripts
env.Alias('install', env.InstallScript('$exec_prefix/sbin/', env.Entry('bgp_xrl_shell_funcs.sh')))
Default(bgp)