forked from krakjoe/pthreads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.m4
37 lines (30 loc) · 1.35 KB
/
config.m4
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
PHP_ARG_ENABLE(pthreads, whether to enable pthreads,
[ --enable-pthreads Enable pthreads])
PHP_ARG_WITH(pthreads-sanitize, whether to enable AddressSanitizer for pthreads,
[ --with-pthreads-sanitize Enable AddressSanitizer for pthreads], no, no)
PHP_ARG_WITH(pthreads-dmalloc, whether to enable dmalloc for pthreads,
[ --with-pthreads-dmalloc Enable dmalloc for pthreads], no, no)
if test "$PHP_PTHREADS" != "no"; then
AC_MSG_CHECKING([for ZTS])
if test "$PHP_THREAD_SAFETY" != "no"; then
AC_MSG_RESULT([ok])
else
AC_MSG_ERROR([pthreads requires ZTS, please re-compile PHP with ZTS enabled])
fi
AC_DEFINE(HAVE_PTHREADS, 1, [Whether you have pthreads support])
if test "$PHP_PTHREADS_SANITIZE" != "no"; then
EXTRA_LDFLAGS="-lasan"
EXTRA_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
fi
if test "$PHP_PTHREADS_DMALLOC" != "no"; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldmalloc"
EXTRA_CFLAGS="$EXTRA_CFLAGS -DDMALLOC"
fi
PHP_NEW_EXTENSION(pthreads, php_pthreads.c src/monitor.c src/stack.c src/globals.c src/prepare.c src/store.c src/resources.c src/handlers.c src/object.c src/socket.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_BUILD_DIR($ext_builddir/src, 1)
PHP_ADD_INCLUDE($ext_builddir)
PHP_SUBST(PTHREADS_SHARED_LIBADD)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST(EXTRA_CFLAGS)
PHP_ADD_MAKEFILE_FRAGMENT
fi