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 --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index c880375988..0a1e7b9e02 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,8 @@ AC_CONFIG_SRCDIR([src/app/main/tor_main.c]) AC_CONFIG_MACRO_DIR([m4]) configure_flags="$*" +AC_DEFINE_UNQUOTED([CONFIG_FLAGS], ["$configure_flags"], [Flags passed to configure]) + # DO NOT EDIT THIS DEFINITION BY HAND UNLESS YOU KNOW WHAT YOU'RE DOING. # @@ -421,6 +423,17 @@ AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_SED +AX_COMPILER_VERSION +AX_COMPILER_VENDOR + +AC_DEFINE_UNQUOTED([COMPILER_VERSION],["$ax_cv_c_compiler_version"], [Compiler version]) +AC_DEFINE_UNQUOTED([COMPILER_VENDOR],["$ax_cv_c_compiler_vendor"], [Compiler vendor]) + +AS_CASE($ax_cv_c_compiler_vendor, + [gnu], AC_DEFINE([COMPILER],["GCC"],[Compiler name]), + AC_DEFINE([COMPILER],[],[Compiler name]) +) + AC_ARG_VAR([PERL], [path to Perl binary]) AC_CHECK_PROGS([PERL], [perl]) AM_CONDITIONAL(USE_PERL, [test "x$ac_cv_prog_PERL" != "x"]) -- cgit v1.2.3-54-g00ecf