diff options
Diffstat (limited to 'apps/version.c')
-rw-r--r-- | apps/version.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/apps/version.c b/apps/version.c index 7185e9edcd..efd23a4064 100644 --- a/apps/version.c +++ b/apps/version.c @@ -19,6 +19,9 @@ typedef enum OPTION_choice { OPT_COMMON, OPT_B, OPT_D, OPT_E, OPT_M, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A, OPT_R, OPT_C +#if defined(_WIN32) + ,OPT_W +#endif } OPTION_CHOICE; const OPTIONS version_options[] = { @@ -37,6 +40,9 @@ const OPTIONS version_options[] = { {"r", OPT_R, '-', "Show random seeding options"}, {"v", OPT_V, '-', "Show library version"}, {"c", OPT_C, '-', "Show CPU settings info"}, +#if defined(_WIN32) + {"w", OPT_W, '-', "Show Windows install context"}, +#endif {NULL} }; @@ -45,8 +51,12 @@ int version_main(int argc, char **argv) int ret = 1, dirty = 0, seed = 0; int cflags = 0, version = 0, date = 0, options = 0, platform = 0, dir = 0; int engdir = 0, moddir = 0, cpuinfo = 0; +#if defined(_WIN32) + int windows = 0; +#endif char *prog; OPTION_CHOICE o; + const char *tmp; prog = opt_init(argc, argv, version_options); while ((o = opt_next()) != OPT_EOF) { @@ -90,6 +100,11 @@ opthelp: case OPT_C: dirty = cpuinfo = 1; break; +#if defined(_WIN32) + case OPT_W: + dirty = windows = 1; + break; +#endif case OPT_A: seed = options = cflags = version = date = platform = dir = engdir = moddir = cpuinfo @@ -119,18 +134,28 @@ opthelp: } if (cflags) printf("%s\n", OpenSSL_version(OPENSSL_CFLAGS)); - if (dir) - printf("%s\n", OpenSSL_version(OPENSSL_DIR)); - if (engdir) - printf("%s\n", OpenSSL_version(OPENSSL_ENGINES_DIR)); - if (moddir) - printf("%s\n", OpenSSL_version(OPENSSL_MODULES_DIR)); + if (dir) { + tmp = OpenSSL_version(OPENSSL_DIR); + printf("OPENSSLDIR: %s\n", tmp == NULL ? "Undefined" : tmp); + } + if (engdir) { + tmp = OpenSSL_version(OPENSSL_ENGINES_DIR); + printf("ENGINESDIR: %s\n", tmp == NULL ? "Undefined" : tmp); + } + if (moddir) { + tmp = OpenSSL_version(OPENSSL_MODULES_DIR); + printf("MODULESDIR: %s\n", tmp == NULL ? "Undefined" : tmp); + } if (seed) { const char *src = OPENSSL_info(OPENSSL_INFO_SEED_SOURCE); printf("Seeding source: %s\n", src ? src : "N/A"); } if (cpuinfo) printf("%s\n", OpenSSL_version(OPENSSL_CPU_INFO)); +#if defined(_WIN32) + if (windows) + printf("OSSL_WINCTX: %s\n", OpenSSL_version(OPENSSL_WINCTX)); +#endif ret = 0; end: return ret; |