diff --git a/.gitignore b/.gitignore index dbbb81a959..66915546e2 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,7 @@ avocadodb libavocadodb.a build.c build.info -config/config.h* +config/config.h Doxygen/avocado.doxy Doxygen/html/ Doxygen/js/ diff --git a/Basics/Initialise.cpp b/Basics/Initialise.cpp index d4d6f572b3..f378354157 100644 --- a/Basics/Initialise.cpp +++ b/Basics/Initialise.cpp @@ -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); diff --git a/BasicsC/error.c b/BasicsC/error.c index af1f86804d..8453cd25ab 100644 --- a/BasicsC/error.c +++ b/BasicsC/error.c @@ -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; diff --git a/BasicsC/error.h b/BasicsC/error.h index 549bea1dfd..a55ffafe7a 100644 --- a/BasicsC/error.h +++ b/BasicsC/error.h @@ -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) + //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// diff --git a/BasicsC/files.h b/BasicsC/files.h index e82d6f7a3f..f42da012c7 100644 --- a/BasicsC/files.h +++ b/BasicsC/files.h @@ -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); + //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// diff --git a/BasicsC/init.c b/BasicsC/init.c index 653477e50b..ebd5a6639f 100644 --- a/BasicsC/init.c +++ b/BasicsC/init.c @@ -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 } //////////////////////////////////////////////////////////////////////////////// diff --git a/Rest/Initialise.cpp b/Rest/Initialise.cpp index 5a42e54fcd..4046bb6bd3 100644 --- a/Rest/Initialise.cpp +++ b/Rest/Initialise.cpp @@ -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 diff --git a/VocBase/vocbase.c b/VocBase/vocbase.c index 32f01c3263..f952a156a0 100644 --- a/VocBase/vocbase.c +++ b/VocBase/vocbase.c @@ -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 } //////////////////////////////////////////////////////////////////////////////// diff --git a/build.h b/build.h index 7feb92aa2c..39194ece1d 100644 --- a/build.h +++ b/build.h @@ -1 +1 @@ -#define TRIAGENS_VERSION "0.0.8 [exported]" +#define TRIAGENS_VERSION "0.0.8 [1152:1156M]" diff --git a/configure.ac b/configure.ac index 4af0b87165..70731161b9 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/m4/configure.basics b/m4/configure.basics index 7b4cfedb36..91f73c0193 100644 --- a/m4/configure.basics +++ b/m4/configure.basics @@ -45,6 +45,7 @@ case $target in ;; esac +AC_PROG_CXXCPP AC_PROG_CC($list_cc) AC_PROG_CXX($list_cxx) AC_PROG_CPP diff --git a/m4/configure.flex-bison b/m4/configure.flex-bison index 61443dcedb..e50ee422c8 100644 --- a/m4/configure.flex-bison +++ b/m4/configure.flex-bison @@ -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}" diff --git a/m4/external.boost b/m4/external.boost index 120afd69db..a1b9dc7b08 100644 --- a/m4/external.boost +++ b/m4/external.boost @@ -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 + +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 diff --git a/m4/external.libev b/m4/external.libev index 16b414357f..b4e8c919f7 100644 --- a/m4/external.libev +++ b/m4/external.libev @@ -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 + +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}" - else - LIB_INFO="$LIB_INFO|LIBEV support: enabled (path $LIBEV)" - fi + 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: disabled" + LIB_INFO="$LIB_INFO|LIBEV VERSION: disabled" fi dnl Local Variables: diff --git a/m4/external.ncurses b/m4/external.ncurses index 3d616c562f..9c5394bc8f 100644 --- a/m4/external.ncurses +++ b/m4/external.ncurses @@ -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: diff --git a/m4/external.openssl b/m4/external.openssl index 83f5b697a1..12b1cc4c8e 100644 --- a/m4/external.openssl +++ b/m4/external.openssl @@ -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 + +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: diff --git a/m4/external.readline b/m4/external.readline index c072b4df0e..72436e3935 100644 --- a/m4/external.readline +++ b/m4/external.readline @@ -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 + +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: diff --git a/m4/external.v8 b/m4/external.v8 index ef17aa4fd6..531f4c499f 100644 --- a/m4/external.v8 +++ b/m4/external.v8 @@ -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::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 +#include + +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|."