Extend GCRYCTL_PRINT_CONFIG to print compiler version.
authorWerner Koch <wk@gnupg.org>
Tue, 3 Jan 2017 15:30:54 +0000 (16:30 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 3 Jan 2017 15:30:54 +0000 (16:30 +0100)
* src/global.c (print_config): Print version of libgpg-error and used
compiler.

Signed-off-by: Werner Koch <wk@gnupg.org>
NEWS
src/global.c

diff --git a/NEWS b/NEWS
index ef882b7..179b18d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,11 @@ Noteworthy changes in version 1.8.0 (unreleased)  [C21/A1/R_]
 
    - GCRYCTL_REINIT_SYSCALL_CLAMP allows to init nPth after Libgcrypt.
 
+ * Extended interfaces:
+
+   - GCRYCTL_PRINT_CONFIG does now also print build information for
+     libgpg-error and the used compiler version.
+
  * Internal changes:
 
    - Libgpg-error 1.25 is now required.  This avoids stalling of nPth
index cfb7618..25815dd 100644 (file)
@@ -279,7 +279,25 @@ print_config ( int (*fnc)(FILE *fp, const char *format, ...), FILE *fp)
   int i;
   const char *s;
 
-  fnc (fp, "version:%s:\n", VERSION);
+  fnc (fp, "version:%s:%x:%s:%x:\n",
+       VERSION, GCRYPT_VERSION_NUMBER,
+       GPGRT_VERSION, GPGRT_VERSION_NUMBER);
+  fnc (fp, "cc:%d:%s:\n",
+#if GPGRT_VERSION_NUMBER >= 0x011b00 /* 1.27 */
+       GPGRT_GCC_VERSION
+#else
+       _GPG_ERR_GCC_VERSION /* Due to a bug in gpg-error.h.  */
+#endif
+       ,
+#ifdef __clang__
+       "clang:" __VERSION__
+#elif __GNUC__
+       "gcc:" __VERSION__
+#else
+       ":"
+#endif
+       );
+
   fnc (fp, "ciphers:%s:\n", LIBGCRYPT_CIPHERS);
   fnc (fp, "pubkeys:%s:\n", LIBGCRYPT_PUBKEY_CIPHERS);
   fnc (fp, "digests:%s:\n", LIBGCRYPT_DIGESTS);