|
1 | | -PHP_ARG_ENABLE(uv, Whether to enable the "uv" extension, |
2 | | -[ --enable-uv Enable "uv" extension support]) |
| 1 | +PHP_ARG_WITH(uv, Whether to include "uv" support, |
| 2 | +[ --with-uv[=DIR] Include "uv" support]) |
3 | 3 |
|
4 | 4 | PHP_ARG_ENABLE(httpparser, Whether to enable the "httpparser" module, |
5 | 5 | [ --enable-httpparser Enable "httpparser" module support]) |
@@ -53,23 +53,43 @@ if test $PHP_UV != "no"; then |
53 | 53 | if test $PHP_HTTPPARSER != "no"; then |
54 | 54 | PHP_ADD_INCLUDE([$ext_srcdir/http-parser]) |
55 | 55 | fi |
56 | | - PHP_ADD_INCLUDE([$ext_srcdir/libuv/include]) |
57 | 56 |
|
58 | | - CFLAGS=" $CFLAGS -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libuv/libuv.a" |
| 57 | + SEARCH_PATH="/usr/local /usr" |
| 58 | + SEARCH_FOR="/include/uv.h" |
| 59 | + if test -r $PHP_UV/$SEARCH_FOR; then # path given as parameter |
| 60 | + UV_DIR=$PHP_UV |
| 61 | + else # search default path list |
| 62 | + AC_MSG_CHECKING([for libuv files in default path]) |
| 63 | + for i in $SEARCH_PATH ; do |
| 64 | + if test -r $i/$SEARCH_FOR; then |
| 65 | + UV_DIR=$i |
| 66 | + AC_MSG_RESULT(found in $i) |
| 67 | + fi |
| 68 | + done |
| 69 | + fi |
59 | 70 |
|
60 | | - case $host in |
61 | | - *darwin*) |
62 | | - dnl these macro does not work. why? |
63 | | - dnl |
64 | | - dnl PHP_ADD_FRAMEWORK(CoreServices) |
65 | | - dnl PHP_ADD_FRAMEWORK(Carbon) |
| 71 | + PHP_ADD_INCLUDE($UV_DIR/include) |
66 | 72 |
|
67 | | - CFLAGS="$CFLAGS -framework CoreServices -framework Carbon" |
68 | | - ;; |
69 | | - *linux*) |
70 | | - CFLAGS="$CFLAGS -lrt" |
71 | | - esac |
| 73 | + PHP_CHECK_LIBRARY(uv, uv_version, |
| 74 | + [ |
| 75 | + PHP_ADD_LIBRARY_WITH_PATH(uv, $UV_DIR/lib, UV_SHARED_LIBADD) |
| 76 | + AC_DEFINE(HAVE_UVLIB,1,[ ]) |
| 77 | + ],[ |
| 78 | + AC_MSG_ERROR([wrong uv library version or library not found]) |
| 79 | + ],[ |
| 80 | + -L$UV_DIR/lib -lm |
| 81 | + ]) |
72 | 82 |
|
73 | 83 | PHP_SUBST(UV_SHARED_LIBADD) |
74 | | - PHP_SUBST([CFLAGS]) |
| 84 | + |
| 85 | +# CFLAGS=" $CFLAGS -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement" |
| 86 | + |
| 87 | +# case $host in |
| 88 | +# *darwin*) |
| 89 | +# ;; |
| 90 | +# *linux*) |
| 91 | +# CFLAGS="$CFLAGS -lrt" |
| 92 | +# esac |
| 93 | + |
| 94 | +# PHP_SUBST([CFLAGS]) |
75 | 95 | fi |
0 commit comments