1
0
Fork 0

potential solution for #438 (non-windows)

This commit is contained in:
Jan Steemann 2013-03-07 10:50:40 +01:00
parent 424ab3e759
commit 092327058b
3 changed files with 152 additions and 15 deletions

View File

@ -144,6 +144,87 @@ static void DefineAdminHandlers (HttpHandlerFactory* factory,
admin->addHandlers(factory, "/_admin");
}
////////////////////////////////////////////////////////////////////////////////
/// @brief generate full version string
////////////////////////////////////////////////////////////////////////////////
static string GetFullVersionString () {
UVersionInfo icuVersion;
char icuVersionString[U_MAX_VERSION_STRING_LENGTH];
u_getVersion(icuVersion);
u_versionToString(icuVersion, icuVersionString);
ostringstream version;
version << "ArangoDB " << TRIAGENS_VERSION << " -- " <<
"ICU " << icuVersionString << ", " <<
"V8 version " << v8::V8::GetVersion() << ", "
"SSL engine " << ApplicationEndpointServer::getSslVersion();
return version.str();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief generate configure options string
////////////////////////////////////////////////////////////////////////////////
static string GetConfigureOptionsString () {
ostringstream configure;
#ifdef TRI_CONFIGURE_COMMAND
#ifdef TRI_CONFIGURE_OPTIONS
configure << "configure:" << TRI_CONFIGURE_COMMAND << TRI_CONFIGURE_OPTIONS;
#endif
#endif
return configure.str();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief generate configure environment options string
////////////////////////////////////////////////////////////////////////////////
static string GetConfigureEnvironmentString () {
ostringstream env;
#ifdef TRI_CONFIGURE_FLAGS
env << "env:" << TRI_CONFIGURE_FLAGS;
#endif
return env.str();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief return a verbose information string about ArangoDB
////////////////////////////////////////////////////////////////////////////////
static string GetVerboseInformationString () {
string info(GetFullVersionString());
string configure(GetConfigureOptionsString());
if (! configure.empty()) {
#ifdef _WIN32
info += "\r\n";
#else
info += "\n";
#endif
info.append(configure);
}
string env(GetConfigureEnvironmentString());
if (! env.empty()) {
#ifdef _WIN32
info += "\r\n";
#else
info += "\n";
#endif
info.append(env);
}
return info;
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
@ -194,7 +275,6 @@ ArangoServer::ArangoServer (int argc, char** argv)
_workingDirectory = "/var/tmp";
_defaultLanguage = Utf8Helper::DefaultUtf8Helper.getCollatorLanguage();
}
////////////////////////////////////////////////////////////////////////////////
@ -217,7 +297,7 @@ ArangoServer::ArangoServer (int argc, char** argv)
void ArangoServer::buildApplicationServer () {
map<string, ProgramOptionsDescription> additional;
_applicationServer = new ApplicationServer("arangod", "[<options>] <database-directory>", TRIAGENS_VERSION);
_applicationServer = new ApplicationServer("arangod", "[<options>] <database-directory>", GetVerboseInformationString());
_applicationServer->setSystemConfigFile("arangod.conf");
// arangod allows defining a user-specific configuration file. arangosh and the other binaries don't
@ -393,19 +473,19 @@ void ArangoServer::buildApplicationServer () {
CLEANUP_LOGGING_AND_EXIT_ON_FATAL_ERROR();
}
UVersionInfo icuVersion;
char icuVersionString[U_MAX_VERSION_STRING_LENGTH];
u_getVersion(icuVersion);
u_versionToString(icuVersion, icuVersionString);
// dump versions of important components
LOGGER_INFO("ArangoDB " << TRIAGENS_VERSION << " -- " <<
"ICU " << icuVersionString << ", " <<
"V8 version " << v8::V8::GetVersion() << ", "
"SSL engine " << ApplicationEndpointServer::getSslVersion());
LOGGER_INFO(GetFullVersionString());
// dump configure plus compile environment
#ifdef TRI_CONFIGURE_COMMAND
#ifdef TRI_CONFIGURE_OPTIONS
LOGGER_DEBUG(GetConfigureOptionsString());
#endif
#endif
#ifdef TRI_CONFIGURE_FLAGS
LOGGER_DEBUG(GetConfigureEnvironmentString());
#endif
// .............................................................................
// set language of default collator
@ -416,11 +496,9 @@ void ArangoServer::buildApplicationServer () {
Utf8Helper::DefaultUtf8Helper.setCollatorLanguage(_defaultLanguage);
if (Utf8Helper::DefaultUtf8Helper.getCollatorCountry() != "") {
languageName = string(Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() + "_" + Utf8Helper::DefaultUtf8Helper.getCollatorCountry());
// LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "_" << Utf8Helper::DefaultUtf8Helper.getCollatorCountry() << "'");
}
else {
languageName = Utf8Helper::DefaultUtf8Helper.getCollatorLanguage();
//LOGGER_INFO("using default language '" << Utf8Helper::DefaultUtf8Helper.getCollatorLanguage() << "'" );
}

View File

@ -22,6 +22,47 @@ AC_MSG_NOTICE([with CFLAGS='$CFLAGS'])
AC_MSG_NOTICE([with CXXFLAGS='$CXXFLAGS'])
AC_MSG_NOTICE([with LDFLAGS='$LDFLAGS'])
dnl ----------------------------------------------------------------------------
dnl grab the configure command and store it in m4 variables
dnl ----------------------------------------------------------------------------
if test `expr -- [$]0 : "'.*"` = 0; then
TRI_CONFIGURE_COMMAND="$TRI_CONFIGURE_COMMAND '[$]0'"
else
TRI_CONFIGURE_COMMAND="$TRI_CONFIGURE_COMMAND [$]0"
fi
for arg in $ac_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "--.*"` = 0; then
break;
fi
TRI_CONFIGURE_OPTIONS="$TRI_CONFIGURE_OPTIONS '[$]arg'"
else
if test `expr -- $arg : "'--.*"` = 0; then
break;
fi
TRI_CONFIGURE_OPTIONS="$TRI_CONFIGURE_OPTIONS [$]arg"
fi
done
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
eval val=\$$var
if test -n "$val"; then
TRI_CONFIGURE_FLAGS="$TRI_CONFIGURE_FLAGS $var='$val'"
fi
done
AC_SUBST(TRI_CONFIGURE_COMMAND)
AC_SUBST(TRI_CONFIGURE_OPTIONS)
AC_SUBST(TRI_CONFIGURE_FLAGS)
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_COMMAND, "$TRI_CONFIGURE_COMMAND", "" , [configure command])
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_OPTIONS, "$TRI_CONFIGURE_OPTIONS", "" , [configure options])
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_FLAGS, "$TRI_CONFIGURE_FLAGS", "" , [configure flags])
dnl ============================================================================
dnl --SECTION-- 3RD-PARTY LIBRARIES
dnl ============================================================================

View File

@ -83,6 +83,24 @@
#undef TRI_ENABLE_MRUBY
////////////////////////////////////////////////////////////////////////////////
/// @brief configure command
////////////////////////////////////////////////////////////////////////////////
#undef TRI_CONFIGURE_COMMAND
////////////////////////////////////////////////////////////////////////////////
/// @brief configure options
////////////////////////////////////////////////////////////////////////////////
#undef TRI_CONFIGURE_OPTIONS
////////////////////////////////////////////////////////////////////////////////
/// @brief configure flags
////////////////////////////////////////////////////////////////////////////////
#undef TRI_CONFIGURE_FLAGS
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////