Browse code

Print C++ compiler version.

This requires exporting a function from libclamav, since clamconf is not C++...

Török Edvin authored on 2010/04/20 00:35:30
Showing 6 changed files
... ...
@@ -277,6 +277,7 @@ static void print_build(void)
277 277
 #ifdef __SUNPRO_C
278 278
     printf("Sun studio %u\n", __SUNPRO_C);
279 279
 #endif
280
+    cli_printcxxver();
280 281
     printf("CPPFLAGS: %s\nCFLAGS: %s\nCXXFLAGS: %s\nLDFLAGS: %s\nConfigure: %s\n",
281 282
 	   BUILD_CPPFLAGS, BUILD_CFLAGS, BUILD_CXXFLAGS, BUILD_LDFLAGS,
282 283
 	   BUILD_CONFIGURE_FLAGS);
... ...
@@ -123,6 +123,7 @@ int bytecode_init(void);
123 123
 void cli_bytecode_debug(int argc, char **argv);
124 124
 void cli_bytecode_printversion(void);
125 125
 void cli_bytecode_debug_printsrc(const struct cli_bc_ctx *ctx);
126
+void cli_printcxxver(void);
126 127
 
127 128
 typedef void (*bc_dbg_callback_trace)(struct cli_bc_ctx*, unsigned event);
128 129
 typedef void (*bc_dbg_callback_trace_op)(struct cli_bc_ctx*, const char *op);
... ...
@@ -74,3 +74,7 @@ void cli_bytecode_printversion(void) {
74 74
   printf("LLVM not compiled in\n");
75 75
 }
76 76
 int have_clamjit=0;
77
+void cli_printcxxver()
78
+{
79
+    /* Empty */
80
+}
... ...
@@ -2013,6 +2013,21 @@ void cli_bytecode_printversion()
2013 2013
   cl::PrintVersionMessage();
2014 2014
 }
2015 2015
 
2016
+void cli_printcxxver()
2017
+{
2018
+    /* Try to print information about some commonly used compilers */
2019
+#ifdef __GNUC__
2020
+    printf("GNU C++: %s (%u.%u.%u)\n", __VERSION__, __GNUC__, __GNUC_MINOR__,
2021
+	   __GNUC_PATCHLEVEL__);
2022
+#endif
2023
+#ifdef __INTEL_COMPILER
2024
+    printf("Intel Compiler C++ %u\n", __INTEL_COMPILER);
2025
+#endif
2026
+#ifdef _MSC_VER
2027
+    printf("Microsoft Visual C++ %u\n", _MSC_VER);
2028
+#endif
2029
+}
2030
+
2016 2031
 namespace ClamBCModule {
2017 2032
 void stop(const char *msg, llvm::Function* F, llvm::Instruction* I)
2018 2033
 {
... ...
@@ -171,6 +171,7 @@ CLAMAV_PRIVATE {
171 171
     cli_bytecode_debug_printsrc;
172 172
     cli_bytecode_printversion;
173 173
     cli_bytecode_describe;
174
+    cli_printcxxver;
174 175
   local:
175 176
     *;
176 177
 };
... ...
@@ -94,6 +94,7 @@ EXPORTS cli_bytecode_init @44238 NONAME
94 94
 EXPORTS cli_bytecode_debug @44239 NONAME
95 95
 EXPORTS cli_bytecode_debug_printsrc @44240 NONAME
96 96
 EXPORTS cli_bytecode_printversion @44241 NONAME
97
+EXPORTS cli_printcxxver @44336 NONAME
97 98
 EXPORTS cli_bytecode_describe @44242 NONAME
98 99
 EXPORTS cli_malloc @44243 NONAME
99 100
 EXPORTS cli_wm_decrypt_macro @44244 NONAME