]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/cversion.c
Copyright consolidation 08/10
[thirdparty/openssl.git] / crypto / cversion.c
CommitLineData
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
d420ac2c 12#ifndef NO_WINDOWS_BRAINDEATH
0f113f3e 13# include "buildinf.h"
d420ac2c 14#endif
d02b48c6 15
39e46af6 16unsigned long OpenSSL_version_num(void)
0f113f3e 17{
b0700d2c
RS
18 return OPENSSL_VERSION_NUMBER;
19}
20
21const char *OpenSSL_version(int t)
22{
23 if (t == OPENSSL_VERSION)
0f113f3e 24 return OPENSSL_VERSION_TEXT;
b0700d2c 25 if (t == OPENSSL_BUILT_ON) {
d02b48c6 26#ifdef DATE
264212b6 27# ifdef OPENSSL_USE_BUILD_DATE
0f113f3e 28 return (DATE);
264212b6 29# else
0f113f3e 30 return ("built on: reproducible build, date unspecified");
264212b6 31# endif
d02b48c6 32#else
0f113f3e 33 return ("built on: date not available");
d02b48c6 34#endif
0f113f3e 35 }
b0700d2c 36 if (t == OPENSSL_CFLAGS) {
d02b48c6 37#ifdef CFLAGS
0f113f3e 38 return (CFLAGS);
d02b48c6 39#else
0f113f3e 40 return ("compiler: information not available");
dfeab068 41#endif
0f113f3e 42 }
b0700d2c 43 if (t == OPENSSL_PLATFORM) {
dfeab068 44#ifdef PLATFORM
0f113f3e 45 return (PLATFORM);
dfeab068 46#else
0f113f3e 47 return ("platform: information not available");
673b3fde 48#endif
0f113f3e 49 }
b0700d2c 50 if (t == OPENSSL_DIR) {
673b3fde 51#ifdef OPENSSLDIR
0f113f3e 52 return "OPENSSLDIR: \"" OPENSSLDIR "\"";
673b3fde 53#else
0f113f3e 54 return "OPENSSLDIR: N/A";
e09621ff
RL
55#endif
56 }
57 if (t == OPENSSL_ENGINES_DIR) {
58#ifdef ENGINESDIR
59 return "ENGINESDIR: \"" ENGINESDIR "\"";
60#else
61 return "ENGINESDIR: N/A";
d02b48c6 62#endif
0f113f3e
MC
63 }
64 return ("not available");
65}