0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 03:01:51 +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,39 +6,41 @@ 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"
case $host_os in
darwin* )
# MacOS does not support --rpath
;;
* )
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
;;
esac
# 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
;;
* )
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