add compiler information to "show version" cli 49/49/1
authorDamjan Marion <damarion@cisco.com>
Mon, 14 Dec 2015 15:17:41 +0000 (16:17 +0100)
committerDamjan Marion <damarion@cisco.com>
Mon, 14 Dec 2015 15:20:03 +0000 (16:20 +0100)
Change-Id: If95b45c87f6d2f1d6dad9fdaee9430129b2f4962
Signed-off-by: Damjan Marion <damarion@cisco.com>
vpp/app/version.c

index f6aaa0b..9949b13 100644 (file)
@@ -22,6 +22,21 @@ static char * vpe_version_string =
     " at " VPP_BUILD_DATE;
 static char * vpe_dir_string = "Built in " VPP_BUILD_TOPDIR;
 
+static char * vpe_compiler = "Compiled with "
+#if defined(__INTEL_COMPILER)
+#define __(x) #x
+#define _(x) __(x)
+       "icc " _(__INTEL_COMPILER) " (" __VERSION__ ")";
+#undef _
+#undef __
+#elif defined(__clang__)
+       "Clang/LLVM " __clang_version__;
+#elif defined (__GNUC__)
+       "GCC " __VERSION__;
+#else
+       "unknown compiler";
+#endif
+
 static clib_error_t *
 show_vpe_version_command_fn (vlib_main_t * vm,
                 unformat_input_t * input,
@@ -30,6 +45,7 @@ show_vpe_version_command_fn (vlib_main_t * vm,
   vlib_cli_output (vm, "%s", vpe_version_string);
   if (unformat (input, "verbose")){
      vlib_cli_output (vm, "%s", vpe_dir_string);
+     vlib_cli_output (vm, "%s", vpe_compiler);
   }
   return 0;
 }