1
0
Fork 0

version info

This commit is contained in:
Frank Celler 2012-01-11 12:03:34 +01:00
parent c46bbd2905
commit 5209ef15fc
18 changed files with 290 additions and 23 deletions

2
.gitignore vendored
View File

@ -33,7 +33,7 @@ avocadodb
libavocadodb.a
build.c
build.info
config/config.h*
config/config.h
Doxygen/avocado.doxy
Doxygen/html/
Doxygen/js/

View File

@ -54,6 +54,11 @@ namespace triagens {
string revision = "$Revision: BASICS " TRIAGENS_VERSION " (c) triAGENS GmbH $";
LOGGER_TRACE << revision;
#ifdef BOOST_VERSION
revision = "$Revision: BOOST " TRI_BOOST_VERSION " $";
LOGGER_TRACE << revision;
#endif
#ifdef TRI_BROKEN_CXA_GUARD
pthread_cond_t cond;
pthread_cond_init(&cond, 0);

View File

@ -299,6 +299,8 @@ void TRI_InitialiseError () {
TRI_set_errno_string(3, "illegal number");
TRI_set_errno_string(4, "numeric overflow");
TRI_set_errno_string(5, "illegal option");
TRI_set_errno_string(6, "dead process identifier");
TRI_set_errno_string(7, "unlocked file");
#if defined(TRI_GCC_THREAD_LOCAL_STORAGE) || defined(TRI_WIN32_THREAD_LOCAL_STORAGE)
ErrorNumber._number = 0;

View File

@ -81,6 +81,18 @@ extern "C" {
#define TRI_ERROR_ILLEGAL_OPTION (5)
////////////////////////////////////////////////////////////////////////////////
/// @brief dead process identifier
////////////////////////////////////////////////////////////////////////////////
#define TRI_ERROR_DEAD_PID (6)
////////////////////////////////////////////////////////////////////////////////
/// @brief lock can be obtained
////////////////////////////////////////////////////////////////////////////////
#define TRI_ERROR_UNLOCKED_FILE (7)
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////

View File

@ -129,6 +129,55 @@ bool TRI_fsync (int fd);
char* TRI_SlurpFile (char const* filename);
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a lock file based on the PID
///
/// Creates a file containing a the current process identifier and locks
/// that file. Under Unix the call uses the @FN{open} system call with
/// O_EXCL to ensure that the file is created atomically. Then the
/// file is filled with the process identifier as decimal number and a
/// lock on the file is obtained using @FN{flock}.
///
/// On success 0 is returned. An error number is returned on failure. See
/// @fn{TRI_errno} for details.
///
/// Internally, the functions keeps a list of open pid files. Calling the
/// function twice with the same @FA{filename} will succeed and will not
/// create a new entry in this list. The system uses @FN{atexit} to release
/// all open locks upon exit.
////////////////////////////////////////////////////////////////////////////////
int TRI_CreateLockFile (char const* filename);
////////////////////////////////////////////////////////////////////////////////
/// @brief verifies a lock file based on the PID
///
/// The function checks if the file named @FA{filename} exists. If it does not
/// then TRI_ERROR_NO_ERROR is returned. If the file exists, then the
/// following checks are performed:
///
/// - Does the file contain a valid decimal number? Otherwise
/// TRI_ERROR_ILLEGAL_NUMBER is returned.
///
/// - Does this number belong to a living process? Otherwise
/// TRI_ERROR_DEAD_PID is returned.
///
/// - Is it possible to lock the file using @FN{flock}. This should failed.
/// If the lock can be obtained, then TRI_ERROR_UNLOCKED_FILE is returned and
/// the lock is released.
///
/// If the verification returns an error, than @FN{TRI_UnlinkFile} should be
/// used to remove the lock file.
////////////////////////////////////////////////////////////////////////////////
int VerifyLockFile (char const* filename);
////////////////////////////////////////////////////////////////////////////////
/// @brief releases a lock file based on the PID
////////////////////////////////////////////////////////////////////////////////
int TRI_DestroyLockFile (char const* filename);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////

View File

@ -32,6 +32,8 @@
#include "BasicsC/random.h"
#include "BasicsC/socket-utils.h"
#include "build.h"
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
@ -51,6 +53,12 @@ void TRI_InitialiseC () {
TRI_InitialiseHashes();
TRI_InitialiseRandom();
TRI_InitialiseSockets();
LOG_TRACE("%s", "$Revision: BASICS-C " TRIAGENS_VERSION " (c) triAGENS GmbH $");
#ifdef TRI_NCURSES_VERSION
LOG_TRACE("%s", "$Revision: NCURSES " TRI_NCURSES_VERSION " $");
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -124,6 +124,16 @@ namespace triagens {
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
#ifdef TRI_OPENSSL_VERSION
revision = "$Revision: OPENSSL " TRI_OPENSSL_VERSION " $";
LOGGER_TRACE << revision;
#endif
#ifdef TRI_LIBEV_VERSION
revision = "$Revision: LIBEV " TRI_LIBEV_VERSION " $";
LOGGER_TRACE << revision;
#endif
#ifdef TRI_HAVE_POSIX_THREADS
opensslSetup();
#endif

View File

@ -839,6 +839,14 @@ void TRI_InitialiseVocBase () {
// document errors
TRI_set_errno_string(TRI_VOC_ERROR_DOCUMENT_NOT_FOUND, "document not found");
#ifdef TRI_READLINE_VERSION
LOG_TRACE("%s", "$Revision: READLINE " TRI_READLINE_VERSION " $");
#endif
#ifdef TRI_V8_VERSION
LOG_TRACE("%s", "$Revision: V8 " TRI_V8_VERSION " $");
#endif
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -1 +1 @@
#define TRIAGENS_VERSION "0.0.8 [exported]"
#define TRIAGENS_VERSION "0.0.8 [1152:1156M]"

View File

@ -30,6 +30,8 @@ m4_include([m4/configure.threads])
m4_include([m4/configure.flex-bison])
m4_include([m4/configure.dot])
FLAG_INFO="$FLAG_INFO|."
m4_include([m4/external.boost])
m4_include([m4/external.libev])
m4_include([m4/external.math])

View File

@ -45,6 +45,7 @@ case $target in
;;
esac
AC_PROG_CXXCPP
AC_PROG_CC($list_cc)
AC_PROG_CXX($list_cxx)
AC_PROG_CPP

View File

@ -24,6 +24,10 @@ if test "x$tr_flex_usable" != "xyes"; then
AC_MSG_ERROR([Please install flex version 2.5.35 or higher from http://ftp.gnu.org/gnu/flex/])
fi
AC_MSG_CHECKING([FLEX version])
TRI_FLEX_VERSION=`$LEX --version`
AC_MSG_RESULT([$TRI_FLEX_VERSION])
AM_CONDITIONAL(ENABLE_FLEX, test "x$tr_flex_usable" = xyes)
dnl -----------------------------------------------------------------------------------------
@ -50,11 +54,15 @@ if test "x$tr_bison_usable" != "xyes"; then
AC_MSG_ERROR([Please install bison version 2.4.1 or higher from http://ftp.gnu.org/gnu/bison/])
fi
AC_MSG_CHECKING([BISON version])
TRI_BISON_VERSION=`$BISON --version | head -1`
AC_MSG_RESULT([$TRI_BISON_VERSION])
AM_CONDITIONAL(ENABLE_BISON, test "x$tr_bison_usable" = xyes)
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
BASIC_INFO="$BASIC_INFO|ENABLE_FLEX: ${tr_flex_usable}"
BASIC_INFO="$BASIC_INFO|ENABLE_BISON: ${tr_bison_usable}"
LIB_INFO="$LIB_INFO|FLEX VERSION: ${TRI_FLEX_VERSION}"
LIB_INFO="$LIB_INFO|BISON VERSION: ${TRI_BISON_VERSION}"

View File

@ -49,13 +49,54 @@ AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_SUBST(BOOST_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
dnl -----------------------------------------------------------------------------------------
dnl grep boost version number
dnl -----------------------------------------------------------------------------------------
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <boost/version.hpp>
main () {
long sdnhg36ed = BOOST_VERSION ;
}
_ACEOF
AC_MSG_CHECKING([BOOST version])
eval "$ac_cpp conftest.$ac_ext" | fgrep "long sdnhg36ed" | awk '{ma = int($4 / 100000); mi = int($4 / 100) % 100; pl = ($4 % 100); print ma "." mi "." pl}' > conftest.output
TRI_BOOST_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_BOOST_VERSION])
rm -f conftest*
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
BOOST_CPPFLAGS="${BOOST_CPPFLAGS} -DTRI_BOOST_VERSION='\"${TRI_BOOST_VERSION}\"'"
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
LIB_INFO="$LIB_INFO|BOOST VERSION: $TRI_BOOST_VERSION"
FLAG_INFO="$FLAG_INFO|BOOST_CPPFLAGS: ${BOOST_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|BOOST_LDFLAGS: ${BOOST_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|BOOST_LIBS: ${BOOST_LIBS}"
FLAG_INFO="$FLAG_INFO|."
dnl Local Variables:
dnl mode: outline-minor

View File

@ -89,6 +89,25 @@ AC_SUBST(LIBEV_CPPFLAGS)
AC_SUBST(LIBEV_LDFLAGS)
AC_SUBST(LIBEV_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl grep libev version number
dnl -----------------------------------------------------------------------------------------
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ev.h>
main () {
long sdnhg36ed = EV_VERSION_MAJOR EV_VERSION_MINOR ;
}
_ACEOF
AC_MSG_CHECKING([LIBEV version])
eval "$ac_cpp conftest.$ac_ext" | fgrep "long sdnhg36ed" | awk '{print $4 "." $5}' > conftest.output
TRI_LIBEV_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_LIBEV_VERSION])
rm -f conftest*
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
@ -97,22 +116,21 @@ LIBS="$SAVE_LIBS"
LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
LIBEV_CPPFLAGS="${LIBEV_CPPFLAGS} -DTRI_LIBEV_VERSION='\"${TRI_LIBEV_VERSION}\"'"
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_LIBEV" = xyes; then
if test "x$LIBEV" = x; then
LIB_INFO="$LIB_INFO|LIBEV support: enabled"
LIB_INFO="$LIB_INFO|LIBEV VERSION: ${TRI_LIBEV_VERSION}"
FLAG_INFO="$FLAG_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
FLAG_INFO="$FLAG_INFO|."
else
LIB_INFO="$LIB_INFO|LIBEV support: enabled (path $LIBEV)"
fi
else
LIB_INFO="$LIB_INFO|LIBEV support: disabled"
LIB_INFO="$LIB_INFO|LIBEV VERSION: disabled"
fi
dnl Local Variables:

View File

@ -49,7 +49,11 @@ if test "x$tr_NCURSES" = xyes; then
fi
if test "x$tr_NCURSES" = xyes; then
AC_MSG_CHECKING([NCURSES version])
TRI_NCURSES_VERSION="`$NCURSES_CONFIG --version`"
AC_MSG_RESULT([$TRI_NCURSES_VERSION])
CPPFLAGS="$CPPFLAGS -DHAVE_NCURSES=1"
NCURSES_CPPFLAGS="${NCURSES_CPPFLAGS} -DTRI_NCURSES_VERSION='\"${TRI_NCURSES_VERSION}\"'"
fi
dnl -----------------------------------------------------------------------------------------
@ -75,13 +79,14 @@ dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_NCURSES" = xyes; then
LIB_INFO="$LIB_INFO|NCURSES support: enabled"
LIB_INFO="$LIB_INFO|NCURSES VERSION: ${TRI_NCURSES_VERSION}"
FLAG_INFO="$FLAG_INFO|NCURSES_CPPFLAGS: ${NCURSES_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|NCURSES_LDFLAGS: ${NCURSES_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|NCURSES_LIBS: ${NCURSES_LIBS}"
FLAG_INFO="$FLAG_INFO|."
else
LIB_INFO="$LIB_INFO|NCURSES support: disabled"
LIB_INFO="$LIB_INFO|NCURSES VERSION: disabled"
fi
dnl Local Variables:

View File

@ -47,6 +47,10 @@ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
SAVE_LIBS="$LIBS"
dnl -----------------------------------------------------------------------------------------
dnl check for header and library
dnl -----------------------------------------------------------------------------------------
if test "$tr_OPENSSL" = "yes"; then
AC_CHECK_HEADERS([openssl/ssl.h])
@ -128,6 +132,26 @@ AC_SUBST(OPENSSL_CPPFLAGS)
AC_SUBST(OPENSSL_LDFLAGS)
AC_SUBST(OPENSSL_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl grep libev version number
dnl -----------------------------------------------------------------------------------------
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <openssl/ssl.h>
main () {
long sdnhg36ed = OPENSSL_VERSION_TEXT
;
}
_ACEOF
AC_MSG_CHECKING([OPENSSL version])
eval "$ac_cpp conftest.$ac_ext" | fgrep "long sdnhg36ed" | awk '{print $4 " " $5 " " $6 " " $7 " " $8 " " $9}' > conftest.output
TRI_OPENSSL_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_OPENSSL_VERSION])
rm -f conftest*
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
@ -136,14 +160,21 @@ LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
LIBS="$SAVE_LIBS"
OPENSSL_CPPFLAGS="${OPENSSL_CPPFLAGS} -DTRI_OPENSSL_VERSION='${TRI_OPENSSL_VERSION}'"
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_OPENSSL" = xyes; then
LIB_INFO="$LIB_INFO|OPENSSL VERSION: ${TRI_OPENSSL_VERSION}"
FLAG_INFO="$FLAG_INFO|OPENSSL_CPPFLAGS: ${OPENSSL_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|OPENSSL_LDFLAGS: ${OPENSSL_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|OPENSSL_LIBS: ${OPENSSL_LIBS}"
FLAG_INFO="$FLAG_INFO|."
else
LIB_INFO="$LIB_INFO|OPENSSL VERSION: disabled"
fi
dnl Local Variables:

View File

@ -73,6 +73,25 @@ if test "x$tr_READLINE" = xyes -o "x$tr_READLINE" = xmaybe; then
fi
fi
dnl -----------------------------------------------------------------------------------------
dnl grep readline version number
dnl -----------------------------------------------------------------------------------------
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <readline/readline.h>
main () {
long sdnhg36ed = RL_VERSION_MAJOR RL_VERSION_MINOR ;
}
_ACEOF
AC_MSG_CHECKING([READLINE version])
eval "$ac_cpp conftest.$ac_ext" | fgrep "long sdnhg36ed" | awk '{print $4 "." $5}' > conftest.output
TRI_READLINE_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_READLINE_VERSION])
rm -f conftest*
dnl -----------------------------------------------------------------------------------------
dnl add substitutions
dnl -----------------------------------------------------------------------------------------
@ -93,6 +112,7 @@ CPPFLAGS="$SAVE_CPPFLAGS"
if test "x$tr_READLINE" = xyes; then
CPPFLAGS="$CPPFLAGS -DHAVE_READLINE=1"
READLINE_CPPFLAGS="${READLINE_CPPFLAGS} -DTRI_READLINE_VERSION='\"${TRI_READLINE_VERSION}\"'"
fi
dnl -----------------------------------------------------------------------------------------
@ -100,17 +120,14 @@ dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_READLINE" = xyes; then
if test "x$READLINE" = x; then
LIB_INFO="$LIB_INFO|READLINE support: enabled"
else
LIB_INFO="$LIB_INFO|READLINE support: enabled (path $READLINE)"
fi
LIB_INFO="$LIB_INFO|READLINE VERSION: ${TRI_READLINE_VERSION}"
FLAG_INFO="$FLAG_INFO|READLINE_CPPFLAGS: ${READLINE_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|READLINE_LDFLAGS: ${READLINE_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|READLINE_LIBS: ${READLINE_LIBS}"
FLAG_INFO="$FLAG_INFO|."
else
LIB_INFO="$LIB_INFO|READLINE support: disabled"
LIB_INFO="$LIB_INFO|READLINE VERSION: disabled"
fi
dnl Local Variables:

View File

@ -31,17 +31,25 @@ CPPFLAGS="$CPPFLAGS $V8_CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $V8_LDFLAGS"
SAVE_LIBS="$LIBS"
dnl -----------------------------------------------------------------------------------------
dnl checks for the V8 library
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR NCURSES])
AC_MSG_NOTICE([CHECKING FOR GOOGLE V8])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C++)
AC_CHECK_LIB([v8], [main], [V8_LIBS="-lv8"], )
tr_V8="yes"
AX_CXX_CHECK_LIB([v8], [#include <v8.h>], [v8::V8::GetVersion()], [V8_LIBS="-lv8"], [tr_V8="no"])
if test "x$tr_V8" != xyes; then
AC_MSG_ERROR([Please install the V8 library from Google])
fi
if test "x$V8_CPPFLAGS" != x; then
TR_INCLUDE([V8_CPPFLAGS])
@ -55,17 +63,59 @@ AC_SUBST(V8_CPPFLAGS)
AC_SUBST(V8_LDFLAGS)
AC_SUBST(V8_LIBS)
LIBS="$LIBS ${V8_LIBS}"
LDFLAGS="$LDFLAGS ${V8_LDFLAGS}"
CPPFLAGS="$CPPFLAGS ${V8_CPPFLAGS}"
dnl -----------------------------------------------------------------------------------------
dnl grep libev version number
dnl -----------------------------------------------------------------------------------------
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <v8.h>
#include <stdio.h>
int main (int, char**) {
printf("%s\n", v8::V8::GetVersion());
}
_ACEOF
AC_MSG_CHECKING([V8 version])
if ac_fn_cxx_try_run "$LINENO" >conftest.output; then
TRI_V8_VERSION=`cat conftest.output`
AC_MSG_RESULT([$TRI_V8_VERSION])
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([Please install the V8 library from Google])
fi
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.beam conftest.$ac_ext conftest.output
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
LIBS="$SAVE_LIBS"
LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
V8_CPPFLAGS="${V8_CPPFLAGS} -DTRI_V8_VERSION='\"${TRI_V8_VERSION}\"'"
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
LIB_INFO="$LIB_INFO|V8 VERSION: ${TRI_V8_VERSION}"
FLAG_INFO="$FLAG_INFO|V8_CPPFLAGS: ${V8_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|V8_LDFLAGS: ${V8_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|V8_LIBS: ${V8_LIBS}"
FLAG_INFO="$FLAG_INFO|."