From 4382e977f74e41f65170b4d9292678859c9e521f Mon Sep 17 00:00:00 2001 From: Guinness Date: Tue, 17 Nov 2020 10:43:00 +0100 Subject: Add the compiler name, version and libs used to compile This changes the behaviour of `tor --version` in such a way. ```console src/app/tor --version Tor version 0.4.5.1-alpha-dev (git-46ccde66a97d7985). Tor is running on Linux with Libevent 2.1.12-stable, OpenSSL 1.1.1h, Zlib 1.2.11, Liblzma 5.2.4, Libzstd 1.4.5 and Glibc 2.31 as libc. Tor compiled with GCC version 10.2.0 ``` Fixes #32102 --- src/app/config/config.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/app') diff --git a/src/app/config/config.c b/src/app/config/config.c index 458067af4d..d9cc4c8fa8 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -4485,6 +4485,25 @@ options_init_from_torrc(int argc, char **argv) if (config_line_find(cmdline_only_options, "--version")) { printf("Tor version %s.\n",get_version()); + printf("Tor is running on %s with Libevent %s, " + "%s %s, Zlib %s, Liblzma %s, Libzstd %s and %s %s as libc.\n", + get_uname(), + tor_libevent_get_version_str(), + crypto_get_library_name(), + crypto_get_library_version_string(), + tor_compress_supports_method(ZLIB_METHOD) ? + tor_compress_version_str(ZLIB_METHOD) : "N/A", + tor_compress_supports_method(LZMA_METHOD) ? + tor_compress_version_str(LZMA_METHOD) : "N/A", + tor_compress_supports_method(ZSTD_METHOD) ? + tor_compress_version_str(ZSTD_METHOD) : "N/A", + tor_libc_get_name() ? + tor_libc_get_name() : "Unknown", + tor_libc_get_version_str()); + printf("Tor compiled with %s version %s\n", + strcmp(COMPILER_VENDOR, "gnu") == 0? + COMPILER:COMPILER_VENDOR, COMPILER_VERSION); + return 1; } -- cgit v1.2.3-54-g00ecf