summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-09-03 05:13:48 +0300
committerimarom <imarom@cisco.com>2015-09-03 05:13:48 +0300
commit2cacf95c9b15915f826bc421c3d32e08d3e57f64 (patch)
tree3cb8ee7be9277759474a9256cad037e7168b041e
parent7925e8e3a1d5da83474242ef3848f0198ec8c33e (diff)
added RPATH support - this allows the mock server to be run from scripts
-rwxr-xr-xlinux/ws_main.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/ws_main.py b/linux/ws_main.py
index 218cbe24..dc22be07 100755
--- a/linux/ws_main.py
+++ b/linux/ws_main.py
@@ -249,7 +249,7 @@ PLATFORM_32 = "32"
class build_option:
- def __init__(self, name, src, platform, debug_mode, is_pie, use = [], flags = []):
+ def __init__(self, name, src, platform, debug_mode, is_pie, use = [], flags = [], rpath = []):
self.mode = debug_mode; ##debug,release
self.platform = platform; #['32','64']
self.is_pie = is_pie
@@ -257,6 +257,7 @@ class build_option:
self.src = src
self.use = use
self.flags = flags
+ self.rpath = rpath
def __str__(self):
s=self.mode+","+self.platform;
@@ -337,6 +338,9 @@ class build_option:
def get_src (self):
return self.src.file_list(top)
+ def get_rpath (self):
+ return self.rpath
+
def get_link_flags(self):
# add here basic flags
base_flags = ['-pthread'];
@@ -363,7 +367,8 @@ build_types = [
build_option(name = "bp-sim", src = bp, debug_mode= RELEASE_,platform = PLATFORM_32, is_pie = False),
build_option(name = "bp-sim", src = bp, debug_mode= RELEASE_,platform = PLATFORM_64, is_pie = False),
- build_option(name = "mock-rpc-server", use = ['zmq'], src = rpc_server_mock, debug_mode= DEBUG_,platform = PLATFORM_64, is_pie = False, flags = ['-DTREX_RPC_MOCK_SERVER']),
+ build_option(name = "mock-rpc-server", use = ['zmq'], src = rpc_server_mock, debug_mode= DEBUG_,platform = PLATFORM_64, is_pie = False, flags = ['-DTREX_RPC_MOCK_SERVER'],
+ rpath = ['.']),
]
@@ -378,7 +383,7 @@ def build_prog (bld, build_obj):
linkflags = build_obj.get_link_flags(),
source = build_obj.get_src(),
use = build_obj.get_use_libs(),
- rpath = bld.env.RPATH,
+ rpath = bld.env.RPATH + build_obj.get_rpath(),
target = build_obj.get_target())