Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 303ab95

Browse files
committed
More robust scanning, override SEARCH_PATH by explicitly given dir
1 parent 8edc8b6 commit 303ab95

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

‎config.m4

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,41 @@ if test "$PHP_V8JS" != "no"; then
66
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
77

88
if test -d "$PHP_V8JS"; then
9-
SEARCH_PATH="$PHP_V8JS $SEARCH_PATH"
9+
SEARCH_PATH="$PHP_V8JS"
10+
11+
# set rpath, so library loader picks up libv8 even if it's not on the
12+
# system's library search path
13+
case $host_os in
14+
darwin* )
15+
# MacOS does not support --rpath
16+
;;
17+
* )
18+
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
19+
;;
20+
esac
1021
fi
1122

12-
case $host_os in
13-
darwin* )
14-
# MacOS does not support --rpath
15-
;;
16-
* )
17-
LDFLAGS="$LDFLAGS -Wl,--rpath=$PHP_V8JS/$PHP_LIBDIR"
18-
;;
19-
esac
20-
2123
AC_MSG_CHECKING([for V8 files in default path])
2224
ARCH=$(uname -m)
2325

2426
for i in $SEARCH_PATH ; do
25-
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR; then
26-
V8_INCLUDE_DIR=$i/include/v8
27-
V8_LIBRARY_DIR=$i/$PHP_LIBDIR
27+
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/v8/v8.h"; then
28+
V8_INCLUDE_DIR="$i/include/v8"
29+
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
2830
AC_MSG_RESULT(found in $i)
2931
fi
3032

3133
# Debian installations
32-
if test -r $i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR; then
33-
V8_INCLUDE_DIR=$i/include/v8
34-
V8_LIBRARY_DIR=$i/$PHP_LIBDIR/$ARCH-linux-gnu
34+
if test -r "$i/$PHP_LIBDIR/$ARCH-linux-gnu/$SEARCH_FOR"; then
35+
V8_INCLUDE_DIR="$i/include/v8"
36+
V8_LIBRARY_DIR="$i/$PHP_LIBDIR/$ARCH-linux-gnu"
3537
AC_MSG_RESULT(found in $i)
3638
fi
3739

3840
# Manual installations
39-
if test -r $i/$PHP_LIBDIR/$SEARCH_FOR && test -r $i/include/libplatform/libplatform.h; then
40-
V8_INCLUDE_DIR=$i/include
41-
V8_LIBRARY_DIR=$i/$PHP_LIBDIR
41+
if test -r "$i/$PHP_LIBDIR/$SEARCH_FOR" -a -r "$i/include/libplatform/libplatform.h"; then
42+
V8_INCLUDE_DIR="$i/include"
43+
V8_LIBRARY_DIR="$i/$PHP_LIBDIR"
4244
AC_MSG_RESULT(found in $i)
4345
fi
4446
done

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /