]>
git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/version.cc
2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * In addition, for the avoidance of any doubt, permission is granted to
10 * link this program with OpenSSL and to (re)distribute the binaries
11 * produced as the result of such linking.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <botan/version.h>
30 #endif /* HAVE_BOTAN */
32 static ProductType productType
;
34 string
compilerVersion()
36 #if defined(__clang__)
37 return string("clang " __clang_version__
);
38 #elif defined(__GNUC__)
39 return string("gcc " __VERSION__
);
40 #else // add other compilers here
41 return string("Unknown compiler");
45 // Human-readable product name
46 string
productName() {
47 switch (productType
) {
48 case ProductAuthoritative
:
49 return "PowerDNS Authoritative Server";
51 return "PowerDNS Recursor";
56 string
getPDNSVersion()
61 // REST API product type
62 string
productTypeApiType() {
63 switch (productType
) {
64 case ProductAuthoritative
:
65 return "authoritative";
72 void showProductVersion()
74 theL()<<Logger::Warning
<<productName()<<" "<< VERSION
<< " (C) 2001-2018 "
75 "PowerDNS.COM BV" << endl
;
76 theL()<<Logger::Warning
<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
77 "Built using " << compilerVersion()
79 <<" on " __DATE__
" " __TIME__
" by " BUILD_HOST
82 theL()<<Logger::Warning
<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
83 "This is free software, and you are welcome to redistribute it "
84 "according to the terms of the GPL version 2." << endl
;
87 void showBuildConfiguration()
89 theL()<<Logger::Warning
<<"Features: "<<
91 "botan" << BOTAN_VERSION_MAJOR
<< "." << BOTAN_VERSION_MINOR
<< " " <<
106 #ifdef REMOTEBACKEND_ZEROMQ
107 "remotebackend-zeromq " <<
118 theL()<<Logger::Warning
<<"Built-in modules: "<<PDNS_MODULES
<<endl
;
120 #ifdef PDNS_CONFIG_ARGS
121 #define double_escape(s) #s
122 #define escape_quotes(s) double_escape(s)
123 theL()<<Logger::Warning
<<"Configured with: "<<escape_quotes(PDNS_CONFIG_ARGS
)<<endl
;
129 string
fullVersionString()
132 s
<<productName()<<" " VERSION
;
134 s
<<" (built " __DATE__
" " __TIME__
" by " BUILD_HOST
")";
139 void versionSetProduct(ProductType pt
)
144 ProductType
versionGetProduct()