diff --git a/config.m4 b/config.m4 index 5b8eb11..121f9c0 100644 --- a/config.m4 +++ b/config.m4 @@ -110,22 +110,32 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], dnl link in libplatform to make our life easier. PHP_ADD_INCLUDE($V8_DIR) - SEARCH_FOR="lib/libv8_libplatform.a" - AC_MSG_CHECKING([for libv8_libplatform.a]) + case $host_os in + darwin* ) + static_link_extra="libv8_libplatform.a libv8_libbase.a" + ;; + * ) + static_link_extra="libv8_libplatform.a" + ;; + esac - for i in $PHP_V8JS $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - LIBPLATFORM_DIR=$i - AC_MSG_RESULT(found in $i) + for static_link_extra_file in $static_link_extra; do + AC_MSG_CHECKING([for $static_link_extra_file]) + + for i in $PHP_V8JS $SEARCH_PATH ; do + if test -r $i/lib/$static_link_extra_file; then + static_link_dir=$i + AC_MSG_RESULT(found in $i) + fi + done + + if test -z "$static_link_dir"; then + AC_MSG_RESULT([not found]) + AC_MSG_ERROR([Please provide $static_link_extra_file next to the libv8.so, see README.md for details]) fi + + LDFLAGS="$LDFLAGS $static_link_dir/lib/$static_link_extra_file" done - - if test -z "$LIBPLATFORM_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please provide libv8_libplatform.a next to the libv8.so, see README.md for details]) - fi - - LDFLAGS="$LDFLAGS $LIBPLATFORM_DIR/$SEARCH_FOR" fi AC_CACHE_CHECK(for C standard version, ac_cv_v8_cstd, [