Skip to content

Commit

Permalink
OLSR/BGP: Allow to not compile OLSR and BGP.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Jun 8, 2010
1 parent ad03606 commit 020be97
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 25 deletions.
6 changes: 4 additions & 2 deletions xorp/SConscript
Expand Up @@ -43,11 +43,13 @@ subdirs = [
'static_routes',
'utils',
'vrrp',
'bgp',
]

if env['WITH_OLSR']:
if env['enable_olsr']:
subdirs.append('contrib/olsr')

if env['enable_bgp']:
subdirs.append('bgp')


SConscript(dirs = subdirs, exports='env')
31 changes: 25 additions & 6 deletions xorp/SConstruct
Expand Up @@ -84,7 +84,7 @@ vars.AddVariables(
BoolVariable('enable_olsr', 'Build OLSR', True),
BoolVariable('enable_tests', 'Build Test Programs', False),
BoolVariable('enable_click', 'Build CLICK support', False),
BoolVariable('enable_bgp', 'Build BGP', False),
BoolVariable('enable_bgp', 'Build BGP', True),
BoolVariable('debug_xrldb', 'Build with runtime XRL syntax validation in Router Manager', False),
EnumVariable('debug', 'Build with debug symbols', 'full',
allowed_values=('no', 'yes', 'full', 'override'),
Expand Down Expand Up @@ -344,17 +344,36 @@ env['xorp_tooldir'] = env['libdir'] + '/xorp/bin' # tools/*
env['xorp_xrlsdir'] = env['datadir'] + '/xorp/xrls' # *.xrls
env['xorp_sourcedir'] = sourcedir # rtrmgr/util.cc and xif need this

env['WITH_BGP'] = ARGUMENTS.get('enable_bgp', False)
env['WITH_OLSR'] = ARGUMENTS.get('enable_olsr', True)
env['WITH_TESTS'] = ARGUMENTS.get('enable_tests', False)
env['WITH_CLICK'] = ARGUMENTS.get('enable_click', False)

tst = ARGUMENTS.get('enable_boost', False)
if tst and not (tst == "no"):
env['enable_boost'] = True;
else:
env['enable_boost'] = False

tst = ARGUMENTS.get('enable_tests', False)
if tst and not (tst == "no"):
env['enable_tests'] = True;
else:
env['enable_tests'] = False

tst = ARGUMENTS.get('enable_click', False)
if tst and not (tst == "no"):
env['enable_click'] = True;
else:
env['enable_click'] = False

tst = ARGUMENTS.get('enable_bgp', False)
if tst and not (tst == "no"):
env['enable_bgp'] = True;
else:
env['enable_bgp'] = False

tst = ARGUMENTS.get('enable_olsr', False)
if tst and not (tst == "no"):
env['enable_olsr'] = True;
else:
env['enable_olsr'] = False

tst = ARGUMENTS.get('disable_ipv6', False)
if tst and not (tst == "no"):
env['disable_ipv6'] = True;
Expand Down
2 changes: 1 addition & 1 deletion xorp/bgp/harness/SConscript
Expand Up @@ -118,7 +118,7 @@ test_trie = env.Program(target = 'test_trie', source = test_trie_srcs)

harnesspath = '$exec_prefix/bgp/harness'

if env['WITH_TESTS']:
if env['enable_tests']:
env.Alias('install', env.InstallProgram(harnesspath, coord))
env.Alias('install', env.InstallProgram(harnesspath, test_peer))
env.Alias('install', env.InstallProgram(harnesspath, test_trie))
Expand Down
1 change: 1 addition & 0 deletions xorp/bgp/harness/peer.cc
Expand Up @@ -1600,6 +1600,7 @@ Peer::datain(const bool& status, const TimeVal& tv,
void
Peer::datain_error(const string& reason)
{
UNUSED(reason);
XLOG_WARNING("Error on TCP connection from test_peer: %s to %s reason: %s",
_peername.c_str(), _target_hostname.c_str(), reason.c_str());
}
Expand Down
8 changes: 5 additions & 3 deletions xorp/etc/templates/SConscript
Expand Up @@ -23,7 +23,6 @@ Import('env')
e = env.Clone()

cmds = [
'bgp',
'fea',
'host',
'igmp',
Expand All @@ -44,7 +43,6 @@ cmds = [
]

tps = [
'bgp',
'fib2mrib',
'igmp',
'interfaces',
Expand Down Expand Up @@ -73,10 +71,14 @@ tp_raw = [
if not (env.has_key('disable_fw') and env['disable_fw']):
tps.append('firewall')

if env['WITH_OLSR']:
if env['enable_olsr']:
cmds.append('olsr4')
tps.append('olsr4')

if env['enable_bgp']:
cmds.append('bgp')
tps.append('bgp')

# Total hack for now, might want to consider some sort of lame CPP syntax
# instead of hard-coding the pattern matching below.
def BuildXrlTemplate(target, source, env):
Expand Down
2 changes: 1 addition & 1 deletion xorp/fea/SConscript
Expand Up @@ -227,7 +227,7 @@ env.Alias('install', env.InstallProgram(env['xorp_moduledir'], feadummy))

#######################

if env['WITH_CLICK']:
if env['enable_click']:
clickgen = 'fea_click_config_generator'
env.Alias('install', env.InstallScript(env['xorp_tooldir'], clickgen))

Expand Down
2 changes: 1 addition & 1 deletion xorp/fea/data_plane/control_socket/SConscript
Expand Up @@ -37,7 +37,7 @@ sources = [
'routing_socket_utilities.cc',
]

if env['WITH_CLICK']:
if env['enable_click']:
sources.append('click_socket.cc')

if is_shared:
Expand Down
2 changes: 1 addition & 1 deletion xorp/fea/data_plane/fibconfig/SConscript
Expand Up @@ -58,7 +58,7 @@ sources = [
'fibconfig_table_set_routing_socket.cc',
]

if env['WITH_CLICK']:
if env['enable_click']:
sources.append('fibconfig_entry_get_click.cc')
sources.append('fibconfig_entry_set_click.cc')
sources.append('fibconfig_table_set_click.cc')
Expand Down
2 changes: 1 addition & 1 deletion xorp/fea/data_plane/managers/SConscript
Expand Up @@ -36,7 +36,7 @@ sources = [
'fea_data_plane_manager_linux.cc',
]

if env['WITH_CLICK']:
if env['enable_click']:
sources.append('fea_data_plane_manager_click.cc')

if is_shared:
Expand Down
4 changes: 2 additions & 2 deletions xorp/libxipc/SConscript
Expand Up @@ -24,7 +24,7 @@ env = env.Clone();

libxipc_env = env.Clone()

if env['WITH_TESTS']:
if env['enable_tests']:
subdirs = [ 'tests' ]
SConscript(dirs=subdirs, exports='env')

Expand Down Expand Up @@ -224,7 +224,7 @@ call_xrl = env.Program(target = 'call_xrl',
# applications wanting to configure XRL via shell scripts.
env.Alias('install', env.InstallProgram('$exec_prefix/sbin/', call_xrl))

if env['WITH_TESTS']:
if env['enable_tests']:
env.Alias('install', env.InstallProgram(env['xorp_moduledir'], xorp_finder))

Default(libxipc, libfinder, call_xrl, xorp_finder)
Expand Down
2 changes: 2 additions & 0 deletions xorp/libxipc/call_xrl.cc
Expand Up @@ -53,6 +53,8 @@ response_handler(const XrlError& e,
bool* resolve_failed,
Xrl* xrl)
{
UNUSED(xrl);

if (e == XrlError::RESOLVE_FAILED()) {
XLOG_ERROR("Failed. Reason: %s (\"%s\")",
e.str().c_str(), xrl->str().c_str());
Expand Down
2 changes: 1 addition & 1 deletion xorp/utils/SConscript
Expand Up @@ -50,7 +50,7 @@ runit_srcs = [

runit = env.Program(target = 'runit', source = runit_srcs)

if env['WITH_TESTS']:
if env['enable_tests']:
env.Alias('install', env.InstallProgram(env['xorp_tooldir'], runit))

# Install scripts
Expand Down
8 changes: 5 additions & 3 deletions xorp/xrl/interfaces/SConscript
Expand Up @@ -35,7 +35,6 @@ env.AppendUnique(LIBS = [ 'xorp_ipc',
'xorp_core' ])

xifs = [
'bgp.xif',
'cli_manager.xif',
'cli_processor.xif',
'common.xif',
Expand Down Expand Up @@ -85,6 +84,9 @@ xifs = [
'vrrp.xif',
]

if env['enable_bgp']:
xifs.append('bgp.xif')

if not (env.has_key('disable_ipv6') and env['disable_ipv6']):
xifs.append('socket6.xif')
xifs.append('socket6_user.xif')
Expand All @@ -99,7 +101,7 @@ if not (env.has_key('disable_profile') and env['disable_profile']):
if not (env.has_key('disable_fw') and env['disable_fw']):
xifs.append('fea_firewall.xif')

if env['WITH_OLSR']:
if env['enable_olsr']:
xifs.append('olsr4.xif')

Depends('common.xif', '../../xorp_config.h');
Expand Down Expand Up @@ -127,7 +129,7 @@ for xif in xifs:

all_xif_libs.append(lib)

if env['WITH_TESTS'] or base[:4] != "test":
if env['enable_tests'] or base[:4] != "test":
if is_shared:
env.Alias('install', env.InstallLibrary(env['xorp_libdir'], lib))

Expand Down
8 changes: 5 additions & 3 deletions xorp/xrl/targets/SConscript
Expand Up @@ -40,7 +40,6 @@ env.AppendUnique(LIBS = [
env['TGTGEN_CPPPATH'] = [ '#/xrl/interfaces', '$BUILDDIR' ]

tgts = [
'bgp.tgt',
'cli.tgt',
'coord.tgt',
'fea.tgt',
Expand Down Expand Up @@ -72,11 +71,14 @@ tgts = [
'xorpsh.tgt',
]

if env['enable_bgp']:
tgts.append('bgp.tgt')

if not (env.has_key('disable_ipv6') and env['disable_ipv6']):
tgts.append('test_socket6.tgt')
tgts.append('ospfv3.tgt')

if env['WITH_OLSR']:
if env['enable_olsr']:
tgts.append('olsr4.tgt')

if not (env.has_key('disable_profile') and env['disable_profile']):
Expand Down Expand Up @@ -112,7 +114,7 @@ def BuildXrlTarget(tgt):

xrls = '$BUILDDIR/xrl/targets/' + base + '.xrls'

if env['WITH_TESTS'] or base[:4] != "test":
if env['enable_tests'] or base[:4] != "test":
if is_shared:
env.Alias('install', env.InstallLibrary(env['xorp_libdir'], lib))
if env['debug_xrldb']:
Expand Down

0 comments on commit 020be97

Please sign in to comment.