@@ -10,39 +10,26 @@ PHP_ARG_ENABLE([apcu-rwlocks],
10
10
[ yes] ,
11
11
[ no] )
12
12
13
- AC_MSG_CHECKING ( if APCu should be built in debug mode )
14
- AC_ARG_ENABLE ( [ apcu- debug] ,
13
+ PHP_ARG_ENABLE( [ apcu- debug] ,
14
+ [ if APCu should be built in debug mode ] ,
15
15
[ AS_HELP_STRING ( [ --enable-apcu-debug] ,
16
16
[ Enable APCu debugging] ) ] ,
17
- [ PHP_APCU_DEBUG=$enableval] ,
18
- [ PHP_APCU_DEBUG=no] )
19
- AC_MSG_RESULT ( $PHP_APCU_DEBUG )
17
+ [ no] ,
18
+ [ no] )
20
19
21
- AC_MSG_CHECKING ( if APCu should clear on SIGUSR1 )
22
- AC_ARG_ENABLE ( [ apcu- clear-signal ] ,
20
+ PHP_ARG_ENABLE( [ apcu- clear-signal ] ,
21
+ [ if APCu should clear on SIGUSR1 ] ,
23
22
[ AS_HELP_STRING ( [ --enable-apcu-clear-signal] ,
24
23
[ Enable SIGUSR1 clearing handler] ) ] ,
25
- [
26
- AC_DEFINE ( APC_CLEAR_SIGNAL , 1 , [ ] )
27
- AC_MSG_RESULT ( yes )
28
- ] ,
29
- [
30
- AC_MSG_RESULT ( no )
31
- ] )
32
-
33
- PHP_APCU_MMAP=yes
34
- AC_MSG_CHECKING ( [ if APCu will use mmap (or shm)] )
35
- AC_ARG_ENABLE ( [ apcu-mmap] ,
24
+ [ no] ,
25
+ [ no] )
26
+
27
+ PHP_ARG_ENABLE([ apcu-mmap] ,
28
+ [ if APCu should use mmap instead of shm] ,
36
29
[ AS_HELP_STRING ( [ --disable-apcu-mmap] ,
37
30
[ Disable mmap, falls back on shm] ) ] ,
38
- [
39
- if test "x$enableval" = "xno"; then
40
- PHP_APCU_MMAP=no
41
- else
42
- PHP_APCU_MMAP=yes
43
- fi
44
- ] )
45
- AC_MSG_RESULT ( $PHP_APCU_MMAP )
31
+ [ yes] ,
32
+ [ no] )
46
33
47
34
PHP_ARG_ENABLE([ apcu-spinlocks] ,
48
35
[ if APCu should utilize spinlocks before flocks] ,
@@ -51,7 +38,37 @@ PHP_ARG_ENABLE([apcu-spinlocks],
51
38
[ no] ,
52
39
[ no] )
53
40
41
+ PHP_ARG_ENABLE([ valgrind-checks] ,
42
+ [ whether to enable Valgrind-based memory checks] ,
43
+ [ AS_HELP_STRING ( [ --disable-valgrind-checks] ,
44
+ [ Disable Valgrind-based memory checks] ) ] ,
45
+ [ yes] ,
46
+ [ no] )
47
+
48
+ PHP_ARG_ENABLE([ coverage] ,
49
+ [ whether to include code coverage symbols] ,
50
+ [ AS_HELP_STRING ( [ --enable-coverage] ,
51
+ [ Include code coverage symbols (DEVELOPERS ONLY!!)] ) ] ,
52
+ [ no] ,
53
+ [ no] )
54
+
54
55
if test "$PHP_APCU" != "no"; then
56
+ AS_VAR_IF ( [ PHP_APCU_DEBUG] , [ no] , [ ] ,
57
+ [ AC_DEFINE ( [ APC_DEBUG] , [ 1] ,
58
+ [ Define to 1 if APCu debugging mode is enabled.] ) ] )
59
+
60
+ AS_VAR_IF ( [ PHP_APCU_CLEAR_SIGNAL] , [ no] , [ ] ,
61
+ [ AC_DEFINE ( [ APC_CLEAR_SIGNAL] , [ 1] ,
62
+ [ Define to 1 if SIGUSR1 clearing handler is enabled.] ) ] )
63
+
64
+ AS_VAR_IF ( [ PHP_APCU_MMAP] , [ no] , [ ] ,
65
+ [ AC_DEFINE ( [ APC_MMAP] , [ 1] ,
66
+ [ Define to 1 if APCu uses mmap instead of shm.] ) ] )
67
+
68
+ AS_VAR_IF ( [ PHP_VALGRIND_CHECKS] , [ no] , [ ] ,
69
+ [ AC_CHECK_HEADERS ( [ valgrind/memcheck.h] , [ ] ,
70
+ [ AC_MSG_NOTICE ( [ Valgrind-based memory checks are disabled.] ) ] ) ] )
71
+
55
72
AS_VAR_IF ( [ PHP_APCU_RWLOCKS] , [ no] , [ ] , [
56
73
AC_CACHE_CHECK ( [ whether the target compiler supports builtin atomics] ,
57
74
[ PHP_cv_APCU_GCC_ATOMICS] ,
@@ -65,14 +82,6 @@ if test "$PHP_APCU" != "no"; then
65
82
[ AC_MSG_FAILURE ( [ Compiler does not support atomics] ) ] )
66
83
] )
67
84
68
- if test "$PHP_APCU_DEBUG" != "no"; then
69
- AC_DEFINE ( APC_DEBUG , 1 , [ ] )
70
- fi
71
-
72
- if test "$PHP_APCU_MMAP" != "no"; then
73
- AC_DEFINE ( APC_MMAP , 1 , [ ] )
74
- fi
75
-
76
85
if test "$PHP_APCU_RWLOCKS" != "no"; then
77
86
orig_LIBS="$LIBS"
78
87
LIBS="$LIBS -lpthread"
@@ -192,16 +201,6 @@ if test "$PHP_APCU" != "no"; then
192
201
193
202
AC_CHECK_FUNCS ( sigaction )
194
203
195
- AC_ARG_ENABLE ( [ valgrind-checks] ,
196
- [ AS_HELP_STRING ( [ --disable-valgrind-checks] ,
197
- [ Disable Valgrind based memory checks] ) ] ,
198
- [ PHP_APCU_VALGRIND=no] ,
199
- [
200
- PHP_APCU_VALGRIND=yes
201
- AC_CHECK_HEADER ( valgrind/memcheck.h ,
202
- [ AC_DEFINE ( [ HAVE_VALGRIND_MEMCHECK_H] ,1 , [ enable valgrind memchecks] ) ] )
203
- ] )
204
-
205
204
for i in -Wall -Wextra -Wno-unused-parameter; do
206
205
AX_CHECK_COMPILE_FLAG ( [ $i] , [ APCU_CFLAGS="$APCU_CFLAGS $i"] )
207
206
done
@@ -225,13 +224,6 @@ if test "$PHP_APCU" != "no"; then
225
224
AC_DEFINE ( HAVE_APCU , 1 , [ ] )
226
225
fi
227
226
228
- PHP_ARG_ENABLE([ coverage] ,
229
- [ whether to include code coverage symbols] ,
230
- [ AS_HELP_STRING ( [ --enable-coverage] ,
231
- [ Include code coverage symbols (DEVELOPERS ONLY!!)] ) ] ,
232
- [ no] ,
233
- [ no] )
234
-
235
227
if test "$PHP_COVERAGE" = "yes"; then
236
228
237
229
if test "$GCC" != "yes"; then
0 commit comments