mirror of https://gitee.com/bigwinds/arangodb
172 lines
5.2 KiB
Plaintext
172 lines
5.2 KiB
Plaintext
dnl -*- mode: Autoconf; -*-
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl --SECTION-- V8
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
V8_CPPFLAGS=""
|
|
V8_LDFLAGS=""
|
|
V8_LIBS=""
|
|
|
|
AC_ARG_WITH(v8,
|
|
AS_HELP_STRING([--with-v8=DIR], [where the v8 library and includes are located]),
|
|
[V8_CPPFLAGS="-I$withval/include"
|
|
V8_LDFLAGS="-L$withval/lib"
|
|
V8_LIB_PATH="$withval/lib"
|
|
V8="$withval"]
|
|
)
|
|
|
|
AC_ARG_WITH(v8-lib,
|
|
AS_HELP_STRING([--with-v8-lib=DIR], [where the v8 library is located]),
|
|
[V8_LDFLAGS="-L$withval"
|
|
V8_LIB_PATH="$withval"]
|
|
)
|
|
|
|
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
|
|
AC_MSG_NOTICE([CHECKING FOR GOOGLE V8])
|
|
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl save flags
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
SAVE_CPPFLAGS="$CPPFLAGS"
|
|
CPPFLAGS="$CPPFLAGS $V8_CPPFLAGS"
|
|
|
|
SAVE_LDFLAGS="$LDFLAGS"
|
|
LDFLAGS="$LDFLAGS $V8_LDFLAGS"
|
|
|
|
SAVE_LIBS="$LIBS"
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl checks for the V8 library
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
AC_LANG(C++)
|
|
|
|
tr_V8="yes"
|
|
|
|
LIBS="$LIBS -lv8_nosnapshot"
|
|
|
|
AX_CXX_CHECK_LIB([v8_base], [#include <v8.h>], [v8::V8::GetVersion()], [V8_LIBS="-lv8_base -lv8_nosnapshot"], [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])
|
|
fi
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl add substitutions
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
AC_SUBST(V8_CPPFLAGS)
|
|
AC_SUBST(V8_LDFLAGS)
|
|
AC_SUBST(V8_LIBS)
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl save flags
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
LIBS="$LIBS ${V8_LIBS}"
|
|
LDFLAGS="$LDFLAGS ${V8_LDFLAGS}"
|
|
CPPFLAGS="$CPPFLAGS ${V8_CPPFLAGS}"
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl grep V8 version number
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
if test "$cross_compiling" = yes; then :
|
|
TRI_V8_VERSION="V8"
|
|
AC_MSG_WARN([cannot compute V8 version number when cross compiling])
|
|
else
|
|
if test "x`type -t ac_fn_cxx_try_run`" = "xfunction" 2> /dev/null; then
|
|
|
|
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
|
|
|
|
if test "x$V8_LIB_PATH" != x; then
|
|
if test "$USE_DYLD" = yes; then
|
|
save_DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH"
|
|
DYLD_LIBRARY_PATH="$V8_LIB_PATH:$DYLD_LIBRARY_PATH"
|
|
else
|
|
save_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
|
|
DYLD_LIBRARY_PATH="$V8_LIB_PATH:$LD_LIBRARY_PATH"
|
|
fi
|
|
fi
|
|
|
|
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
|
|
|
|
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.beam conftest.$ac_ext conftest.output
|
|
|
|
if test "x$V8_LIB_PATH" != x; then
|
|
if test "$USE_DYLD" = yes; then
|
|
DYLD_LIBRARY_PATH="$save_DYLD_LIBRARY_PATH"
|
|
else
|
|
LD_LIBRARY_PATH="$save_LD_LIBRARY_PATH"
|
|
fi
|
|
fi
|
|
else
|
|
TRI_V8_VERSION="V8"
|
|
AC_MSG_WARN([cannot compute V8 version number, old autoconf version])
|
|
fi
|
|
fi
|
|
|
|
if test "x$TRI_V8_VERSION" != "xV8"; then
|
|
[tr_v8_version=`echo "$TRI_V8_VERSION" | awk -F. '{print $1 * 10000 + $2 * 100 + $3}'`]
|
|
|
|
if test "$tr_v8_version" -lt 31600; then
|
|
AC_MSG_ERROR([V8 version found is too low: $TRI_V8_VERSION. Please install V8 with version 3.16.0 or higher or use the option --enable-all-in-one-v8.])
|
|
fi
|
|
fi
|
|
|
|
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: system version"
|
|
LIB_INFO="$LIB_INFO|V8 VERSION: ${TRI_V8_VERSION}"
|
|
|
|
LIB_INFO="$LIB_INFO|V8_CPPFLAGS: ${V8_CPPFLAGS}"
|
|
LIB_INFO="$LIB_INFO|V8_LDFLAGS: ${V8_LDFLAGS}"
|
|
LIB_INFO="$LIB_INFO|V8_LIBS: ${V8_LIBS}"
|
|
|
|
dnl LIB_INFO="$LIB_INFO|."
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
dnl --SECTION-- END-OF-FILE
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl Local Variables:
|
|
dnl mode: outline-minor
|
|
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
|
|
dnl End:
|