Skip to content

Commit 5817bfe

Browse files
committed
Merge pull request #57 from datibbaw/build-fixups
Assorted fixes
2 parents 424faae + f2389fc commit 5817bfe

File tree

13 files changed

+386
-336
lines changed

13 files changed

+386
-336
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "libuv"]
2-
path = libuv
3-
url = https://github.com/joyent/libuv.git
4-
ignore = dirty
51
[submodule "http-parser"]
62
path = http-parser
73
url = https://github.com/joyent/http-parser.git

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
language: php
22

33
php:
4-
- 5.3
54
- 5.4
65
- 5.5
6+
- 5.6
77

88
before_script:
9-
- cd libuv && make libuv.a CFLAGS=-fPIC -s && cd ..
10-
- phpize && ./configure && make && sudo make install
9+
- sudo apt-add-repository -y ppa:linuxjedi/ppa
10+
- sudo apt-get update -qq
11+
- sudo apt-get -y install libuv-dev
12+
- phpize && ./configure --with-uv --enable-httpparser && make && sudo make install
1113
- echo "extension=uv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
1214

1315
notifications:

config.m4

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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])
33

44
PHP_ARG_ENABLE(httpparser, Whether to enable the "httpparser" module,
5-
[ --enable-httpparser Enable "httpparser" module support])
5+
[ --enable-httpparser Enable "httpparser" module support], no, no)
66

77
PHP_ARG_ENABLE(uv-debug, for uv debug support,
8-
[ --enable-uv-debug Enable enable uv deubg support], no, no)
8+
[ --enable-uv-debug Enable enable uv debug support], no, no)
99

1010
PHP_ARG_ENABLE(dtrace, Whether to enable the "dtrace" debug,
1111
[ --enable-dtrace Enable "dtrace" support], no, no)
@@ -44,32 +44,49 @@ if test $PHP_UV != "no"; then
4444
SOURCES=""
4545

4646
if test $PHP_HTTPPARSER != "no"; then
47-
SOURCES=" http-parser/http_parser.c"
47+
SOURCES=" uv_http_parser.c http-parser/http_parser.c"
4848
AC_DEFINE([ENABLE_HTTPPARSER], [1], [ Enable http parser])
4949
fi
5050

5151
PHP_NEW_EXTENSION(uv, php_uv.c uv.c $SOURCES, $ext_shared)
5252

53+
PHP_ADD_EXTENSION_DEP(uv, sockets)
54+
5355
if test $PHP_HTTPPARSER != "no"; then
5456
PHP_ADD_INCLUDE([$ext_srcdir/http-parser])
5557
fi
56-
PHP_ADD_INCLUDE([$ext_srcdir/libuv/include])
5758

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"
59+
SEARCH_PATH="/usr/local /usr"
60+
SEARCH_FOR="/include/uv.h"
61+
if test -r $PHP_UV/$SEARCH_FOR; then # path given as parameter
62+
UV_DIR=$PHP_UV
63+
else # search default path list
64+
AC_MSG_CHECKING([for libuv files in default path])
65+
for i in $SEARCH_PATH ; do
66+
if test -r $i/$SEARCH_FOR; then
67+
UV_DIR=$i
68+
AC_MSG_RESULT(found in $i)
69+
fi
70+
done
71+
fi
5972

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)
73+
PHP_ADD_INCLUDE($UV_DIR/include)
6674

67-
CFLAGS="$CFLAGS -framework CoreServices -framework Carbon"
68-
;;
75+
PHP_CHECK_LIBRARY(uv, uv_version,
76+
[
77+
PHP_ADD_LIBRARY_WITH_PATH(uv, $UV_DIR/lib, UV_SHARED_LIBADD)
78+
AC_DEFINE(HAVE_UVLIB,1,[ ])
79+
],[
80+
AC_MSG_ERROR([wrong uv library version or library not found])
81+
],[
82+
-L$UV_DIR/lib -lm
83+
])
84+
85+
case $host in
6986
*linux*)
7087
CFLAGS="$CFLAGS -lrt"
7188
esac
7289

90+
PHP_SUBST([CFLAGS])
7391
PHP_SUBST(UV_SHARED_LIBADD)
74-
PHP_SUBST([CFLAGS])
7592
fi

libuv

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)