Add compile-in flag to program version output.

Then we can check if tools are compiled with a support for specific
extension/library.
This commit is contained in:
Milan Broz
2022-04-14 13:59:32 +02:00
parent 3363bad8c2
commit ebabf3ffee
5 changed files with 36 additions and 7 deletions

View File

@@ -432,3 +432,32 @@ int tools_write_mk(const char *file, const char *key, int keysize)
close(fd);
return r;
}
void tools_package_version(const char *name, bool use_pwlibs)
{
log_std("%s %s flags: %s%s\n", name, PACKAGE_VERSION,
#ifdef USE_UDEV
"UDEV "
#endif
#ifdef HAVE_BLKID
"BLKID "
#endif
#ifdef KERNEL_KEYRING
"KEYRING "
#endif
#ifdef ENABLE_FIPS
"FIPS "
#endif
#ifdef ENABLE_AF_ALG
"KERNEL_CAPI "
#endif
,
#if defined(ENABLE_PWQUALITY)
use_pwlibs ? "PWQUALITY " : ""
#elif defined(ENABLE_PASSWDQC)
use_pwlibs ? "PASSWDQC " : ""
#else
""
#endif
);
}