]>
Commit | Line | Data |
---|---|---|
2039c421 RS |
1 | /* |
2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. | |
d02b48c6 | 3 | * |
2039c421 RS |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
d02b48c6 RE |
8 | */ |
9 | ||
b39fc560 | 10 | #include "internal/cryptlib.h" |
2e0fc875 | 11 | |
0904e79a | 12 | #include "buildinf.h" |
d02b48c6 | 13 | |
39e46af6 | 14 | unsigned long OpenSSL_version_num(void) |
0f113f3e | 15 | { |
b0700d2c RS |
16 | return OPENSSL_VERSION_NUMBER; |
17 | } | |
18 | ||
19 | const char *OpenSSL_version(int t) | |
20 | { | |
21 | if (t == OPENSSL_VERSION) | |
0f113f3e | 22 | return OPENSSL_VERSION_TEXT; |
b0700d2c | 23 | if (t == OPENSSL_BUILT_ON) { |
d02b48c6 | 24 | #ifdef DATE |
264212b6 | 25 | # ifdef OPENSSL_USE_BUILD_DATE |
0f113f3e | 26 | return (DATE); |
264212b6 | 27 | # else |
0f113f3e | 28 | return ("built on: reproducible build, date unspecified"); |
264212b6 | 29 | # endif |
d02b48c6 | 30 | #else |
0f113f3e | 31 | return ("built on: date not available"); |
d02b48c6 | 32 | #endif |
0f113f3e | 33 | } |
b0700d2c | 34 | if (t == OPENSSL_CFLAGS) { |
d02b48c6 | 35 | #ifdef CFLAGS |
0f113f3e | 36 | return (CFLAGS); |
d02b48c6 | 37 | #else |
0f113f3e | 38 | return ("compiler: information not available"); |
dfeab068 | 39 | #endif |
0f113f3e | 40 | } |
b0700d2c | 41 | if (t == OPENSSL_PLATFORM) { |
dfeab068 | 42 | #ifdef PLATFORM |
0f113f3e | 43 | return (PLATFORM); |
dfeab068 | 44 | #else |
0f113f3e | 45 | return ("platform: information not available"); |
673b3fde | 46 | #endif |
0f113f3e | 47 | } |
b0700d2c | 48 | if (t == OPENSSL_DIR) { |
673b3fde | 49 | #ifdef OPENSSLDIR |
0f113f3e | 50 | return "OPENSSLDIR: \"" OPENSSLDIR "\""; |
673b3fde | 51 | #else |
0f113f3e | 52 | return "OPENSSLDIR: N/A"; |
e09621ff RL |
53 | #endif |
54 | } | |
55 | if (t == OPENSSL_ENGINES_DIR) { | |
56 | #ifdef ENGINESDIR | |
57 | return "ENGINESDIR: \"" ENGINESDIR "\""; | |
58 | #else | |
59 | return "ENGINESDIR: N/A"; | |
d02b48c6 | 60 | #endif |
0f113f3e MC |
61 | } |
62 | return ("not available"); | |
63 | } |