@@ -6,39 +6,41 @@ if test "$PHP_V8JS" != "no"; then
6
6
SEARCH_FOR="libv8.$SHLIB_SUFFIX_NAME"
7
7
8
8
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
10
21
fi
11
22
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
-
21
23
AC_MSG_CHECKING([for V8 files in default path])
22
24
ARCH=$(uname -m)
23
25
24
26
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"
28
30
AC_MSG_RESULT(found in $i)
29
31
fi
30
32
31
33
# 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"
35
37
AC_MSG_RESULT(found in $i)
36
38
fi
37
39
38
40
# 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"
42
44
AC_MSG_RESULT(found in $i)
43
45
fi
44
46
done
0 commit comments