Skip to content

Commit

Permalink
xorpsh: Allow disabling compile of xorpsh, saves around 820k on disk.
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 10, 2010
1 parent be7dace commit cb22659
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 34 deletions.
3 changes: 1 addition & 2 deletions xorp/SConscript
Expand Up @@ -20,6 +20,7 @@
Import('env')

subdirs = [
'cli',
'libcomm',
'libxorp',
'libxipc',
Expand All @@ -29,7 +30,6 @@ subdirs = [
'xrl/interfaces',
#'xrl/tests', # XXX not in use.
'etc/templates',
'cli',
'fea',
'fib2mrib',
'mld6igmp',
Expand Down Expand Up @@ -57,5 +57,4 @@ if env['enable_rip']:
if env['enable_vrrp']:
subdirs.append('vrrp')


SConscript(dirs = subdirs, exports='env')
12 changes: 12 additions & 0 deletions xorp/SConstruct
Expand Up @@ -86,6 +86,7 @@ vars.AddVariables(
BoolVariable('enable_ospf', 'Build OSPF', True),
BoolVariable('enable_rip', 'Build RIP', True),
BoolVariable('enable_vrrp', 'Build VRRP', True),
BoolVariable('enable_xorpsh', 'Build xorpsh', True),
BoolVariable('enable_tests', 'Build Test Programs', False),
BoolVariable('enable_click', 'Build CLICK support', False),
BoolVariable('enable_fea_dummy', 'Build fea-dummy target', True),
Expand Down Expand Up @@ -238,6 +239,7 @@ print 'Enable OLSR: ', env['enable_olsr']
print 'Enable OSPF: ', env['enable_ospf']
print 'Enable RIP: ', env['enable_rip']
print 'Enable VRRP: ', env['enable_vrrp']
print 'Enable xorpsh ', env['enable_xorpsh']
print 'Enable Test Programs: ', env['enable_tests']
print 'Enable CLICK: ', env['enable_click']
print 'Enable FEA Dummy: ', env['enable_fea_dummy']
Expand Down Expand Up @@ -412,6 +414,13 @@ if tst and (tst == "no"):
else:
env['enable_vrrp'] = True

# Default to enabled
tst = ARGUMENTS.get('enable_xorpsh', True)
if tst and (tst == "no"):
env['enable_xorpsh'] = False
else:
env['enable_xorpsh'] = True

tst = ARGUMENTS.get('disable_ipv6', False)
if tst and not (tst == "no"):
env['disable_ipv6'] = True;
Expand Down Expand Up @@ -576,6 +585,9 @@ if not env.GetOption('clean') and \
if tst and not (tst == "no"):
conf.Define('XORP_USE_FEA_DUMMY')

if env['enable_xorpsh']:
conf.Define('XORP_USE_XORPSH')

# Note: hard-coded paths pushed down to rtrmgr/util.cc environment.

# Print warnings about missing/skipped dependencies.
Expand Down
4 changes: 3 additions & 1 deletion xorp/etc/templates/SConscript
Expand Up @@ -36,7 +36,6 @@ cmds = [
'pim6',
'policy',
'rib',
'xorpsh',
]

tps = [
Expand Down Expand Up @@ -83,6 +82,9 @@ if env['enable_vrrp']:
cmds.append('vrrp')
tps.append('vrrp')

if env['enable_xorpsh']:
cmds.append('xorpsh')

# 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
53 changes: 30 additions & 23 deletions xorp/rtrmgr/SConscript
Expand Up @@ -163,34 +163,35 @@ env.Alias('install',

### xorpsh

xorpsh_env = env.Clone()

xorpsh_env.AppendUnique(LIBS = [
'xorp_rtrmgr',
'xorp_cli',
'xst_cli', # XXX Not picked up automagically?
'xif_cli_processor', # XXX ditto?
'xorp_proto',
'xorp_tecla',
'xif_rtrmgr',
'xst_xorpsh',
'xif_finder_event_notifier',
'xorp_ipc',
'xorp_comm',
'xorp_core',
'curses' # XXX only for non-windows
])
if env['enable_xorpsh']:
xorpsh_env = env.Clone()

xorpsh_env.AppendUnique(LIBS = [
'xorp_rtrmgr',
'xorp_cli',
'xst_cli', # XXX Not picked up automagically?
'xif_cli_processor', # XXX ditto?
'xorp_proto',
'xorp_tecla',
'xif_rtrmgr',
'xst_xorpsh',
'xif_finder_event_notifier',
'xorp_ipc',
'xorp_comm',
'xorp_core',
'curses' # XXX only for non-windows
])

xorpsh_srcs = [
xorpsh_srcs = [
'xorpsh_main.cc',
'xrl_xorpsh_interface.cc',
'cli.cc',
]

xorpsh = xorpsh_env.Program(target = 'xorpsh', source = xorpsh_srcs)
xorpsh = xorpsh_env.Program(target = 'xorpsh', source = xorpsh_srcs)

env.Alias('install',
env.InstallProgram(env['xorp_sbindir'], xorpsh))
env.Alias('install',
env.InstallProgram(env['xorp_sbindir'], xorpsh))

if not (env.has_key('disable_profile') and env['disable_profile']):
### profiler
Expand All @@ -216,7 +217,13 @@ if not (env.has_key('disable_profile') and env['disable_profile']):
env.Alias('install',
env.InstallProgram(env['xorp_sbindir'], profiler))

Default(rtrmgr, xorpsh, profiler)
if env['enable_xorpsh']:
Default(rtrmgr, xorpsh, profiler)
else:
Default(rtrmgr, profiler)
else:
Default(rtrmgr, xorpsh)
if env['enable_xorpsh']:
Default(rtrmgr, xorpsh)
else:
Default(rtrmgr)

3 changes: 2 additions & 1 deletion xorp/rtrmgr/xorpsh_main.hh
Expand Up @@ -17,7 +17,7 @@
// XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/rtrmgr/xorpsh_main.hh,v 1.37 2008/10/02 21:58:27 bms Exp $
#ifdef XORP_USE_XORPSH

#ifndef __RTRMGR_XORPSH_MAIN_HH__
#define __RTRMGR_XORPSH_MAIN_HH__
Expand Down Expand Up @@ -181,3 +181,4 @@ private:
};

#endif // __RTRMGR_XORPSH_MAIN_HH__
#endif // XORPSH
6 changes: 4 additions & 2 deletions xorp/rtrmgr/xrl_xorpsh_interface.hh
Expand Up @@ -17,12 +17,13 @@
// XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/rtrmgr/xrl_xorpsh_interface.hh,v 1.17 2008/10/02 21:58:27 bms Exp $

#ifdef XORP_USE_XORPSH


#ifndef __RTRMGR_XRL_XORPSH_INTERFACE_HH__
#define __RTRMGR_XRL_XORPSH_INTERFACE_HH__


#include "xrl/targets/xorpsh_base.hh"


Expand Down Expand Up @@ -85,3 +86,4 @@ private:
};

#endif // __RTRMGR_XRL_XORPSH_INTERFACE_HH__
#endif
12 changes: 7 additions & 5 deletions xorp/xrl/targets/SConscript
Expand Up @@ -64,7 +64,6 @@ tgts = [
'test_peer.tgt',
'test_socket4.tgt',
'test_xrls.tgt',
'xorpsh.tgt',
]

if env['enable_bgp']:
Expand All @@ -78,15 +77,18 @@ if not (env.has_key('disable_ipv6') and env['disable_ipv6']):
if env['enable_olsr']:
tgts.append('olsr4.tgt')

if env['enable_vrrp']:
tgts.append('vrrp.tgt')
if env['enable_ospf']:
tgts.append('ospfv2.tgt')

if env['enable_rip']:
tgts.append('rip.tgt')
tgts.append('ripng.tgt')

if env['enable_ospf']:
tgts.append('ospfv2.tgt')
if env['enable_vrrp']:
tgts.append('vrrp.tgt')

if env['enable_xorpsh']:
tgts.append('xorpsh.tgt')

if not (env.has_key('disable_profile') and env['disable_profile']):
tgts.append('profiler.tgt')
Expand Down

0 comments on commit cb22659

Please sign in to comment.