From 45d87529e3df7f1387a665fabc493ada7da39104 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 13 Jun 2012 12:07:34 +0100 Subject: [PATCH] Clean up build options printout Signed-off-by: David Woodhouse --- main.c | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/main.c b/main.c index f705a7e3..401d1ebb 100644 --- a/main.c +++ b/main.c @@ -180,28 +180,37 @@ static void helpmessage(void) static void print_build_opts(void) { + const char *comma = ", ", *sep = comma + 1; + +#if defined (OPENCONNECT_OPENSSL) + printf(_("Using OpenSSL. Features present:")); +#elif defined (OPENCONNECT_GNUTLS) + printf(_("Using GnuTLS. Features present:")); +#endif + + if (openconnect_has_tss_blob_support()) { + printf("%sTPM", sep); + sep = comma; + } #if defined (OPENCONNECT_OPENSSL) && defined (HAVE_ENGINE) - if (openconnect_has_tss_blob_support()) - printf(_("Using OpenSSL with TPM ENGINE support. Loading TPM engine succeeded.\n")); - else - printf(_("Using OpenSSL with TPM ENGINE support, but loading TPM engine failed.\n")); -#elif defined (OPENCONNECT_OPENSSL) - printf(_("Using OpenSSL without TPM ENGINE support\n")); -#elif defined (OPENCONNECT_GNUTLS) && defined (HAVE_P11KIT) - printf(_("Using GnuTLS with PKCS#11 token support\n")); -#elif defined (OPENCONNECT_GNUTLS) - printf(_("Using GnuTLS without PKCS#11 token support\n")); -#else -#error wtf + else { + printf("%sTPM (%s)", sep, _("OpenSSL ENGINE not present")); + sep = comma; + } #endif -#ifndef HAVE_DTLS - printf(_("No DTLS support in this binary\n")); -#elif defined (DTLS_OPENSSL) - printf(_("Using OpenSSL for DTLS support\n")); -#elif defined (DTLS_GNUTLS) - printf(_("Using GnuTLS for DTLS support\n")); + if (openconnect_has_pkcs11_support()) { + printf("%sPKCS#11", sep); + sep = comma; + } + +#ifdef HAVE_DTLS + printf("%sDTLS", sep); +#if defined (OPENCONNECT_GNUTLS) && defined (DTLS_OPENSSL) + printf(" (%s)", _("using OpenSSL")); +#endif + printf("\n"); #else -#error wtf + printf(_("\nWARNING: No DTLS support in this binary. Performance will be impaired.\n")); #endif }