diff options
Diffstat (limited to 'linux_dpdk/ws_main.py')
-rwxr-xr-x | linux_dpdk/ws_main.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 89f41376..e5ac40fb 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -12,6 +12,7 @@ import shutil; import copy; import re import uuid +import subprocess # these variables are mandatory ('/' are converted automatically) @@ -95,6 +96,7 @@ main_src = SrcGroup(dir='src', 'global_io_mode.cpp', 'main_dpdk.cpp', 'bp_sim.cpp', + 'latency.cpp', 'platform_cfg.cpp', 'tuple_gen.cpp', 'rx_check.cpp', @@ -701,6 +703,15 @@ def get_build_num (): return s; def create_version_files (): + git_sha="N/A" + try: + r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1") + if r[0]==0: + git_sha=r[1] + except : + pass; + + s ='' s +="#ifndef __TREX_VER_FILE__ \n" s +="#define __TREX_VER_FILE__ \n" @@ -711,6 +722,7 @@ def create_version_files (): s +='extern const char * get_build_date(void); \n' s +='extern const char * get_build_time(void); \n' s +='#define VERSION_UIID "%s" \n' % uuid.uuid1() + s +='#define VERSION_GIT_SHA "%s" \n' % git_sha s +='#define VERSION_BUILD_NUM "%s" \n' % get_build_num() s +="#ifdef __cplusplus \n" s +=" } \n" @@ -876,6 +888,12 @@ def publish_ext(bld): +def test (bld): + r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1") + if r[0]==0: + print r[1] + + |