Skip to content

Commit

Permalink
Show built-in features in --version output
Browse files Browse the repository at this point in the history
  • Loading branch information
zeha committed Aug 24, 2013
1 parent cd91689 commit 3613a51
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -269,6 +269,11 @@ then
AC_DEFINE(HAVE_BOTAN18,1,[If we have botan 1.8])
fi

if test "x$enable_cryptopp" = "xyes"
then
AC_DEFINE(HAVE_CRYPTOPP,1,[If we have cryptopp])
fi

AC_ARG_ENABLE(remotebackend_http, AC_HELP_STRING([--enable-remotebackend-http],[enable HTTP connector for remotebackend]),[enable_remotebackend_http=yes], [enable_remotebackend_http=no])
AC_MSG_CHECKING(whether to enable http connector in remotebackend)
AC_MSG_RESULT($enable_remotebackend_http)
Expand Down Expand Up @@ -327,6 +332,7 @@ AC_ARG_WITH(socketdir, AC_HELP_STRING([--with-socketdir],[where the controlsocke
AC_SUBST(moduledirs)
AC_SUBST(moduleobjects)
AC_SUBST(modulelibs)
AC_DEFINE_UNQUOTED(PDNS_MODULES,"$modules", [Built-in modules])

AC_MSG_CHECKING(whether we will be building the server)
AC_ARG_ENABLE(pdns-server,
Expand Down
1 change: 1 addition & 0 deletions pdns/pdns_recursor.cc
Expand Up @@ -2115,6 +2115,7 @@ int main(int argc, char **argv)
}
if(::arg().mustDo("version")) {
showProductVersion();
showBuildConfiguration();
exit(99);
}

Expand Down
1 change: 1 addition & 0 deletions pdns/receiver.cc
Expand Up @@ -425,6 +425,7 @@ int main(int argc, char **argv)

if(::arg().mustDo("version")) {
showProductVersion();
showBuildConfiguration();
exit(99);
}

Expand Down
31 changes: 31 additions & 0 deletions pdns/version.cc
Expand Up @@ -46,6 +46,37 @@ void showProductVersion()
"according to the terms of the GPL version 2." << endl;
}

void showBuildConfiguration()
{
theL()<<Logger::Warning<<"Features: "<<
#ifdef HAVE_BOTAN110
"botan1.10 " <<
#endif
#ifdef HAVE_BOTAN18
"botan1.8" <<
#endif
#ifdef HAVE_CRYPTOPP
"cryptopp " <<
#endif
#ifdef HAVE_LIBDL
"libdl " <<
#endif
#ifdef HAVE_LUA
"lua " <<
#endif
#ifdef REMOTEBACKEND_HTTP
"remotebackend-http" <<
#endif
#ifdef VERBOSELOG
"verboselog" <<
#endif
endl;
#ifdef PDNS_MODULES
// Auth only
theL()<<Logger::Warning<<"Built-in modules: "<<PDNS_MODULES<<endl;
#endif
}

string fullVersionString()
{
ostringstream s;
Expand Down
1 change: 1 addition & 0 deletions pdns/version.hh
Expand Up @@ -22,6 +22,7 @@

string compilerVersion();
void showProductVersion();
void showBuildConfiguration();
string fullVersionString();
void versionSetProduct(string product);

Expand Down

0 comments on commit 3613a51

Please sign in to comment.