From: Igor Maravic <[email protected]> Copy tool binaries to $BUILDDIR/lib/xorp/bin instead of making symlinks. We have to that so we could run binaries from $BUILDDIR. If we wouldn't do that, they would search for shared libraries on wrong places (eg. %tool_bin_native_dir/../lib)
Signed-off-by: Igor Maravic <[email protected]> --- xorp/SConstruct | 10 ++++++++++ xorp/bgp/tools/SConscript | 4 ++-- xorp/cli/tools/SConscript | 4 ++-- xorp/contrib/olsr/tools/SConscript | 4 ++-- xorp/fea/tools/SConscript | 2 +- xorp/ospf/tools/SConscript | 6 +++--- xorp/rib/tools/SConscript | 4 ++-- xorp/rip/tools/SConscript | 4 ++-- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/xorp/SConstruct b/xorp/SConstruct index 25f0f69..234f3c0 100644 --- a/xorp/SConstruct +++ b/xorp/SConstruct @@ -40,6 +40,7 @@ Help(""" import sys import os +import shutil import string import subprocess import fnmatch @@ -293,6 +294,15 @@ env['CONFIGUREDIR'] = str(builddir) + os.sep + '.sconf_temp' SConsEnvironment.Chmod = SCons.Action.ActionFactory(os.chmod, lambda dest, mode: 'Chmod("%s", 0%o)' % (dest, mode)) +def Copy(src, dest): + try: + os.unlink(dest) + except OSError: + pass + shutil.copy2(src, dest) +SConsEnvironment.Copy = SCons.Action.ActionFactory(Copy, + lambda src, link_name: 'Copy("%s", to "%s")' % (src, link_name)) + def Symlink(src, link_name): try: os.unlink(link_name) diff --git a/xorp/bgp/tools/SConscript b/xorp/bgp/tools/SConscript index 62875a8..eb13bd1 100644 --- a/xorp/bgp/tools/SConscript +++ b/xorp/bgp/tools/SConscript @@ -127,7 +127,7 @@ xppeers = env.Program(target = 'bgp_print_peers', source = xppeers_srcs) if env['rtld_origin']: for obj in xppeers: env.AddPostAction(xppeers, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], xppeers)) @@ -143,7 +143,7 @@ xproutes = env.Program(target = 'bgp_print_routes', source = xproutes_srcs) if env['rtld_origin']: for obj in xproutes: env.AddPostAction(xproutes, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], xproutes)) diff --git a/xorp/cli/tools/SConscript b/xorp/cli/tools/SConscript index d1fdfc0..7780711 100644 --- a/xorp/cli/tools/SConscript +++ b/xorp/cli/tools/SConscript @@ -84,11 +84,11 @@ sendcli = env.Program(target = 'cli_send_processor_xrl', source = sendclisrcs) if env['rtld_origin']: for obj in cligen: env.AddPostAction(cligen, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in sendcli: env.AddPostAction(sendcli, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], cligen)) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], sendcli)) diff --git a/xorp/contrib/olsr/tools/SConscript b/xorp/contrib/olsr/tools/SConscript index 6a61597..c0342d1 100644 --- a/xorp/contrib/olsr/tools/SConscript +++ b/xorp/contrib/olsr/tools/SConscript @@ -86,11 +86,11 @@ printdb = env.Program(target = 'olsr_print_databases', source = printdbsrcs) if env['rtld_origin']: for obj in cleardb: env.AddPostAction(cleardb, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in printdb: env.AddPostAction(printdb, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], cleardb)) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], printdb)) diff --git a/xorp/fea/tools/SConscript b/xorp/fea/tools/SConscript index a0c2cdf..96094c1 100644 --- a/xorp/fea/tools/SConscript +++ b/xorp/fea/tools/SConscript @@ -85,7 +85,7 @@ showif = env.Program(target = 'fea_show_interfaces', source = showifsrcs) if env['rtld_origin']: for obj in showif: env.AddPostAction(showif, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], showif)) diff --git a/xorp/ospf/tools/SConscript b/xorp/ospf/tools/SConscript index f7a86f4..cad0ecc 100644 --- a/xorp/ospf/tools/SConscript +++ b/xorp/ospf/tools/SConscript @@ -98,15 +98,15 @@ printneighbors = env.Program(target = 'ospf_print_neighbours', if env['rtld_origin']: for obj in cleardb: env.AddPostAction(cleardb, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in printlsas: env.AddPostAction(printlsas, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in printneighbors: env.AddPostAction(printneighbors, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], cleardb)) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], printlsas)) diff --git a/xorp/rib/tools/SConscript b/xorp/rib/tools/SConscript index 1697798..6e676a3 100644 --- a/xorp/rib/tools/SConscript +++ b/xorp/rib/tools/SConscript @@ -89,11 +89,11 @@ shrtes = env.Program(target = 'rib_show_routes', source = shrtessrcs) if env['rtld_origin']: for obj in shdist: env.AddPostAction(shdist, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in shrtes: env.AddPostAction(shrtes, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], shdist)) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], shrtes)) diff --git a/xorp/rip/tools/SConscript b/xorp/rip/tools/SConscript index 96d6075..b4676d1 100644 --- a/xorp/rip/tools/SConscript +++ b/xorp/rip/tools/SConscript @@ -76,11 +76,11 @@ shstats = env.Program(target = 'rip_show_stats', source = shstatssrcs) if env['rtld_origin']: for obj in shpeer: env.AddPostAction(shpeer, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) for obj in shstats: env.AddPostAction(shstats, - env.Symlink(obj.abspath, + env.Copy(obj.abspath, os.path.join(env['xorp_alias_tooldir'], str(obj)))) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], shpeer)) env.Alias('install', env.InstallProgram(env['xorp_tooldir'], shstats)) -- 1.7.5.4 _______________________________________________ Xorp-hackers mailing list [email protected] http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
