forked from wukezhan/su
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.m4
More file actions
68 lines (54 loc) · 1.44 KB
/
Copy pathconfig.m4
File metadata and controls
68 lines (54 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
dnl $Id$
dnl config.m4 for extension su
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
dnl If your extension references something external, use with:
dnl PHP_ARG_WITH(su, for su support,
dnl Make sure that the comment is aligned:
dnl [ --with-su Include su support])
dnl Otherwise use enable:
PHP_ARG_ENABLE(su, whether to enable su support,
dnl Make sure that the comment is aligned:
[ --enable-su Enable su support])
DEPS_DIR="$srcdir/deps"
AC_DEFUN([SU_CHECK_REUSEPORT],
[
AC_MSG_CHECKING([for reuseport])
AC_TRY_COMPILE([
#include <sys/socket.h>
], [
int on = 1;
setsockopt(0, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on));
], [
AC_DEFINE([HAVE_REUSEPORT], 1, [have SO_REUSEPORT?])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])
if test "$PHP_SU" != "no"; then
SU_CHECK_REUSEPORT
PHP_ADD_INCLUDE("$DEPS_DIR/libctx")
PHP_ADD_INCLUDE("$DEPS_DIR/libuv/include")
PHP_SUBST(SU_SHARED_LIBADD)
shared_objects_su="$DEPS_DIR/build/lib/libctx.a $DEPS_DIR/build/lib/libuv.a $shared_objects_su"
PHP_SUBST([CFLAGS])
PHP_NEW_EXTENSION(su,
su.c \
src/chan.c \
src/co.c \
src/coco/coco.c \
src/fs.c \
src/fs_watcher.c \
src/pipe.c \
src/pipe_server.c \
src/process.c \
src/rbuf/rbuf.c \
src/tcp_conn.c \
src/tcp_server.c \
src/timer.c \
src/udp.c \
, $ext_shared)
PHP_ADD_MAKEFILE_FRAGMENT([deps/Makefile])
fi