-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.m4
45 lines (40 loc) · 1.02 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
38
39
40
41
42
43
44
45
dnl $Id: config.m4 274405 2009-01-23 17:53:42Z tony2001 $
PHP_ARG_ENABLE(funcmap, whether to enable funcmap support,
[ --enable-funcmap Enable funcmap support])
if test "$PHP_FUNCMAP" != "no"; then
orig_LIBS="$LIBS"
LIBS="$LIBS -pthread"
AC_MSG_CHECKING([for pthread_atfork()])
AC_TRY_RUN(
[
#include <pthread.h>
#include <stdio.h>
void pthread_atfork_test(void)
{
}
main() {
if(pthread_atfork(NULL, NULL, pthread_atfork_test)) {
puts("pthread_atfork() failed.");
return -1;
}
return 0;
}
],
[ dnl -Success-
AC_MSG_RESULT([ok])
PHP_ADD_LIBRARY(pthread, 1, FUNCMAP_SHARED_LIBADD)
PHP_LDFLAGS="$PHP_LDFLAGS -pthread"
],
[ dnl -Failure-
AC_MSG_ERROR([Pthreads are broken in your system?])
],
[ dnl -Cross-compiling-
dnl *fingers crossed*
AC_MSG_RESULT([ok])
PHP_ADD_LIBRARY(pthread, 1, FUNCMAP_SHARED_LIBADD)
PHP_LDFLAGS="$PHP_LDFLAGS -pthread"
])
LIBS="$orig_LIBS"
PHP_SUBST(FUNCMAP_SHARED_LIBADD)
PHP_NEW_EXTENSION(funcmap, funcmap.c, $ext_shared)
fi