mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 12:51:52 +00:00
Check for libnode (additional/instead of libv8)
This commit is contained in:
parent
9f854c5343
commit
56eb76bd9a
20
config.m4
20
config.m4
@ -3,7 +3,9 @@ PHP_ARG_WITH(v8js, for V8 Javascript Engine,
|
|||||||
|
|
||||||
if test "$PHP_V8JS" != "no"; then
|
if test "$PHP_V8JS" != "no"; then
|
||||||
SEARCH_PATH="/usr/local /usr"
|
SEARCH_PATH="/usr/local /usr"
|
||||||
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
|
|
||||||
|
for libname in v8 node; do
|
||||||
|
SEARCH_FOR="lib$libname.$SHLIB_SUFFIX_NAME"
|
||||||
|
|
||||||
if test -d "$PHP_V8JS"; then
|
if test -d "$PHP_V8JS"; then
|
||||||
SEARCH_PATH="$PHP_V8JS"
|
SEARCH_PATH="$PHP_V8JS"
|
||||||
@ -24,17 +26,20 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
for i in $SEARCH_PATH ; do
|
for i in $SEARCH_PATH ; do
|
||||||
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/v8/v8.h"; then
|
echo checking "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/$libname/v8.h"
|
||||||
V8_INCLUDE_DIR="$i/include/v8"
|
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/$libname/v8.h"; then
|
||||||
|
V8_INCLUDE_DIR="$i/include/$libname"
|
||||||
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
|
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
|
||||||
AC_MSG_RESULT(found in $i)
|
AC_MSG_RESULT(found in $i)
|
||||||
|
break 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Debian installations
|
# Debian installations
|
||||||
if test -r "$i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR"; then
|
if test -r "$i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR"; then
|
||||||
V8_INCLUDE_DIR="$i/include/v8"
|
V8_INCLUDE_DIR="$i/include/$libname"
|
||||||
V8_LIBRARY_DIR="$i/$PHP_LIBDIR/$ARCH-linux-gnu"
|
V8_LIBRARY_DIR="$i/$PHP_LIBDIR/$ARCH-linux-gnu"
|
||||||
AC_MSG_RESULT(found in $i)
|
AC_MSG_RESULT(found in $i)
|
||||||
|
break 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Manual installations
|
# Manual installations
|
||||||
@ -42,8 +47,10 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
V8_INCLUDE_DIR="$i/include"
|
V8_INCLUDE_DIR="$i/include"
|
||||||
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
|
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
|
||||||
AC_MSG_RESULT(found in $i)
|
AC_MSG_RESULT(found in $i)
|
||||||
|
break 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([PHP_V8_EXEC_PATH], "$V8_LIBRARY_DIR/$SEARCH_FOR", [Full path to libv8 library file])
|
AC_DEFINE_UNQUOTED([PHP_V8_EXEC_PATH], "$V8_LIBRARY_DIR/$SEARCH_FOR", [Full path to libv8 library file])
|
||||||
|
|
||||||
@ -53,8 +60,9 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PHP_ADD_INCLUDE($V8_INCLUDE_DIR)
|
PHP_ADD_INCLUDE($V8_INCLUDE_DIR)
|
||||||
PHP_ADD_LIBRARY_WITH_PATH(v8, $V8_LIBRARY_DIR, V8JS_SHARED_LIBADD)
|
PHP_ADD_LIBRARY_WITH_PATH($libname, $V8_LIBRARY_DIR, V8JS_SHARED_LIBADD)
|
||||||
PHP_SUBST(V8JS_SHARED_LIBADD)
|
PHP_SUBST(V8JS_SHARED_LIBADD)
|
||||||
|
|
||||||
PHP_REQUIRE_CXX()
|
PHP_REQUIRE_CXX()
|
||||||
|
|
||||||
|
|
||||||
@ -112,6 +120,7 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
CPPFLAGS="$CPPFLAGS -I$V8_INCLUDE_DIR -std=$ac_cv_v8_cstd"
|
CPPFLAGS="$CPPFLAGS -I$V8_INCLUDE_DIR -std=$ac_cv_v8_cstd"
|
||||||
LDFLAGS="$LDFLAGS -L$V8_LIBRARY_DIR"
|
LDFLAGS="$LDFLAGS -L$V8_LIBRARY_DIR"
|
||||||
|
|
||||||
|
if test "$libname" = "v8"; then
|
||||||
AC_MSG_CHECKING([for libv8_libplatform])
|
AC_MSG_CHECKING([for libv8_libplatform])
|
||||||
AC_DEFUN([V8_CHECK_LINK], [
|
AC_DEFUN([V8_CHECK_LINK], [
|
||||||
save_LIBS="$LIBS"
|
save_LIBS="$LIBS"
|
||||||
@ -132,6 +141,7 @@ if test "$PHP_V8JS" != "no"; then
|
|||||||
AC_MSG_ERROR([could not find libv8_libplatform library])
|
AC_MSG_ERROR([could not find libv8_libplatform library])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
|
Loading…
Reference in New Issue
Block a user