diff options
Diffstat (limited to 'src/FeatureConfig.cc')
| -rw-r--r-- | src/FeatureConfig.cc | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/FeatureConfig.cc b/src/FeatureConfig.cc index 6b28f07a..36f8e90a 100644 --- a/src/FeatureConfig.cc +++ b/src/FeatureConfig.cc @@ -34,6 +34,34 @@ /* copyright --> */ #include "FeatureConfig.h" +#ifdef HAVE_ZLIB +# include <zlib.h> +#endif // HAVE_ZLIB +#ifdef HAVE_LIBXML2 +# include <libxml/xmlversion.h> +#endif // HAVE_LIBXML2 +#ifdef HAVE_LIBEXPAT +# include <expat.h> +#endif // HAVE_LIBEXPAT +#ifdef HAVE_SQLITE3 +# include <sqlite3.h> +#endif // HAVE_SQLITE3 +#ifdef HAVE_LIBGNUTLS +# include <gnutls/gnutls.h> +#endif // HAVE_LIBGNUTLS +#ifdef HAVE_OPENSSL +# include <openssl/opensslv.h> +#endif // HAVE_OPENSSL +#ifdef HAVE_LIBGMP +# include <gmp.h> +#endif // HAVE_LIBGMP +#ifdef HAVE_LIBGCRYPT +# include <gcrypt.h> +#endif // HAVE_LIBGCRYPT +#ifdef HAVE_LIBCARES +# include <ares.h> +#endif // HAVE_LIBCARES + #include "util.h" namespace aria2 { @@ -141,4 +169,57 @@ const char* strSupportedFeature(int feature) } } +std::string usedLibs() +{ + std::string res; +#ifdef HAVE_ZLIB + res += "zlib/"ZLIB_VERSION" "; +#endif // HAVE_ZLIB +#ifdef HAVE_LIBXML2 + res += "libxml2/"LIBXML_DOTTED_VERSION" "; +#endif // HAVE_LIBXML2 +#ifdef HAVE_LIBEXPAT + res += fmt("expat/%d.%d.%d ", + XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION); +#endif // HAVE_LIBEXPAT +#ifdef HAVE_SQLITE3 + res += "sqlite3/"SQLITE_VERSION" "; +#endif // HAVE_SQLITE3 +#ifdef HAVE_APPLETLS + res += "appleTLS "; +#endif // HAVE_APPLETLS +#ifdef HAVE_LIBGNUTLS + res += "GnuTLS/"GNUTLS_VERSION" "; +#endif // HAVE_LIBGNUTLS +#ifdef HAVE_OPENSSL + res += fmt("OpenSSL/%d.%d.%d", + OPENSSL_VERSION_NUMBER >> 28, + (OPENSSL_VERSION_NUMBER >> 20) & 0xff, + (OPENSSL_VERSION_NUMBER >> 12) & 0xff); + if((OPENSSL_VERSION_NUMBER >> 4) & 0xff) { + res += 'a' + ((OPENSSL_VERSION_NUMBER >> 4) & 0xff) - 1; + } + res += " "; +#endif // HAVE_OPENSSL +#ifdef HAVE_LIBNETTLE + // No library version in header files. + res += "nettle "; +#endif // HAVE_LIBNETTLE +#ifdef HAVE_LIBGMP + res += fmt("GMP/%d.%d.%d ", + __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR, + __GNU_MP_VERSION_PATCHLEVEL); +#endif // HAVE_LIBGMP +#ifdef HAVE_LIBGCRYPT + res += "libgcrypt/"GCRYPT_VERSION" "; +#endif // HAVE_LIBGCRYPT +#ifdef HAVE_LIBCARES + res += "c-ares/"ARES_VERSION_STR" "; +#endif // HAVE_LIBCARES + if(!res.empty()) { + res.erase(res.length()-1); + } + return res; +} + } // namespace aria2 |
