0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 08:11:52 +00:00

Merge pull request #534 from stesie/bugfix/pr-532-more-robust-scanning

More robust scanning, override SEARCH_PATH by explicitly given dir
This commit is contained in:
Stefan Siegl 2024-09-24 20:56:27 +02:00 committed by GitHub
commit aac40cd72e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,39 +6,41 @@ if test "$PHP_V8JS" != "no"; then
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME" SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
if test -d "$PHP_V8JS"; then if test -d "$PHP_V8JS"; then
SEARCH_PATH="$PHP_V8JS $SEARCH_PATH" SEARCH_PATH="$PHP_V8JS"
fi
case $host_os in # set rpath, so library loader picks up libv8 even if it's not on the
darwin* ) # system's library search path
# MacOS does not support --rpath case $host_os in
;; darwin* )
* ) # MacOS does not support --rpath
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR" ;;
;; * )
esac LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
;;
esac
fi
AC_MSG_CHECKING([for V8 files in default path]) AC_MSG_CHECKING([for V8 files in default path])
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; then if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/v8/v8.h"; then
V8_INCLUDE_DIR=$i/include/v8 V8_INCLUDE_DIR="$i/include/v8"
V8_LIBRARY_DIR=$i/$PHP_LIBDIR V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
AC_MSG_RESULT(found in $i) AC_MSG_RESULT(found in $i)
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/v8"
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)
fi fi
# Manual installations # Manual installations
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR && test -r $i/include/libplatform/libplatform.h; then if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/libplatform/libplatform.h"; 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)
fi fi
done done