mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 03:01:51 +00:00
parent
ccf94d83b4
commit
c01f24f5e4
28
config.m4
28
config.m4
@ -3,8 +3,8 @@ PHP_ARG_WITH(v8js, for V8 Javascript Engine,
|
||||
|
||||
if test "$PHP_V8JS" != "no"; then
|
||||
SEARCH_PATH="/usr/local /usr"
|
||||
SEARCH_FOR="$PHP_LIBDIR/libv8.$SHLIB_SUFFIX_NAME"
|
||||
|
||||
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
|
||||
|
||||
if test -r $PHP_V8JS/$SEARCH_FOR; then
|
||||
case $host_os in
|
||||
darwin* )
|
||||
@ -14,26 +14,28 @@ if test "$PHP_V8JS" != "no"; then
|
||||
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
|
||||
;;
|
||||
esac
|
||||
V8_DIR=$PHP_V8JS
|
||||
V8_INCLUDE_DIR=$PHP_V8JS/include/v8
|
||||
V8_LIBRARY_DIR=$PHP_V8JS/$PHP_LIBDIR
|
||||
else
|
||||
AC_MSG_CHECKING([for V8 files in default path])
|
||||
for i in $SEARCH_PATH ; do
|
||||
if test -r $i/$SEARCH_FOR; then
|
||||
V8_DIR=$i
|
||||
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR; then
|
||||
V8_INCLUDE_DIR=$i/include/v8
|
||||
V8_LIBRARY_DIR=$i/$PHP_LIBDIR
|
||||
AC_MSG_RESULT(found in $i)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_V8_EXEC_PATH], "$V8_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])
|
||||
|
||||
if test -z "$V8_DIR"; then
|
||||
if test -z "$V8_INCLUDE_DIR" || test -z "$V8_LIBRARY_DIR"; then
|
||||
AC_MSG_RESULT([not found])
|
||||
AC_MSG_ERROR([Please reinstall the v8 distribution])
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($V8_DIR/include)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(v8, $V8_DIR/$PHP_LIBDIR, V8JS_SHARED_LIBADD)
|
||||
PHP_ADD_INCLUDE($V8_INCLUDE_DIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(v8, $V8_LIBRARY_DIR, V8JS_SHARED_LIBADD)
|
||||
PHP_SUBST(V8JS_SHARED_LIBADD)
|
||||
PHP_REQUIRE_CXX()
|
||||
|
||||
@ -89,8 +91,8 @@ if test "$PHP_V8JS" != "no"; then
|
||||
|
||||
AC_LANG_PUSH([C++])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$V8_DIR/include -std=$ac_cv_v8_cstd"
|
||||
LDFLAGS="$LDFLAGS -L$V8_DIR/$PHP_LIBDIR"
|
||||
CPPFLAGS="$CPPFLAGS -I$V8_INCLUDE_DIR -std=$ac_cv_v8_cstd"
|
||||
LDFLAGS="$LDFLAGS -L$V8_LIBRARY_DIR"
|
||||
|
||||
AC_MSG_CHECKING([for libv8_libplatform])
|
||||
AC_DEFUN([V8_CHECK_LINK], [
|
||||
@ -161,7 +163,7 @@ int main ()
|
||||
AC_MSG_CHECKING([for $1])
|
||||
blob_found=0
|
||||
|
||||
for i in "$V8_DIR/$PHP_LIBDIR" "$V8_DIR/share/v8"; do
|
||||
for i in "$V8_LIBRARY_DIR" "$V8_INCLUDE_DIR/../share/v8"; do
|
||||
if test -r "$i/$1"; then
|
||||
AC_MSG_RESULT([found ($i/$1)])
|
||||
AC_DEFINE_UNQUOTED([$2], "$i/$1", [Full path to $1 file])
|
||||
@ -219,7 +221,7 @@ int main ()
|
||||
|
||||
AC_DEFINE([V8_DEPRECATION_WARNINGS], [1], [Enable compiler warnings when using V8_DEPRECATED apis.])
|
||||
|
||||
PHP_ADD_INCLUDE($V8_DIR)
|
||||
PHP_ADD_INCLUDE($V8_INCLUDE_DIR)
|
||||
PHP_NEW_EXTENSION(v8js, [ \
|
||||
v8js_array_access.cc \
|
||||
v8js_class.cc \
|
||||
|
Loading…
Reference in New Issue
Block a user