0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-10-18 13:28:41 +00:00

More robust scanning, override SEARCH_PATH by explicitly given dir

This commit is contained in:
Stefan Siegl 2024-09-20 23:23:04 +02:00
parent 8edc8b65d8
commit 303ab95a90

View File

@ -6,9 +6,10 @@ if test "$PHP_V8JS" != "no"; then
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
if test -d "$PHP_V8JS"; then
SEARCH_PATH="$PHP_V8JS $SEARCH_PATH"
fi
SEARCH_PATH="$PHP_V8JS"
# set rpath, so library loader picks up libv8 even if it's not on the
# system's library search path
case $host_os in
darwin* )
# MacOS does not support --rpath
@ -17,28 +18,29 @@ if test "$PHP_V8JS" != "no"; then
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
;;
esac
fi
AC_MSG_CHECKING([for V8 files in default path])
ARCH=$(uname -m)
for i in $SEARCH_PATH ; do
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR; then
V8_INCLUDE_DIR=$i/include/v8
V8_LIBRARY_DIR=$i/$PHP_LIBDIR
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/v8/v8.h"; then
V8_INCLUDE_DIR="$i/include/v8"
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
AC_MSG_RESULT(found in $i)
fi
# Debian installations
if test -r $i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR; then
V8_INCLUDE_DIR=$i/include/v8
V8_LIBRARY_DIR=$i/$PHP_LIBDIR/$ARCH-linux-gnu
if test -r "$i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR"; then
V8_INCLUDE_DIR="$i/include/v8"
V8_LIBRARY_DIR="$i/$PHP_LIBDIR/$ARCH-linux-gnu"
AC_MSG_RESULT(found in $i)
fi
# Manual installations
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR && test -r $i/include/libplatform/libplatform.h; then
V8_INCLUDE_DIR=$i/include
V8_LIBRARY_DIR=$i/$PHP_LIBDIR
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/libplatform/libplatform.h"; then
V8_INCLUDE_DIR="$i/include"
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
AC_MSG_RESULT(found in $i)
fi
done