@@ -18,7 +18,7 @@ AC_ARG_ENABLE(apcu-debug,
18
18
[ --enable-apcu-debug Enable APCu debugging] ,
19
19
[
20
20
PHP_APCU_DEBUG=$enableval
21
- ] ,
21
+ ] ,
22
22
[
23
23
PHP_APCU_DEBUG=no
24
24
] )
@@ -61,133 +61,133 @@ AC_ARG_ENABLE(apcu-spinlocks,
61
61
AC_MSG_RESULT ( $PHP_APCU_SPINLOCK )
62
62
63
63
if test "$PHP_APCU_RWLOCKS" != "no"; then
64
- AC_CACHE_CHECK ( [ whether the target compiler supports builtin atomics] , PHP_cv_APCU_GCC_ATOMICS , [
65
-
66
- AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ ] ] , [ [
67
- int foo = 0;
68
- __sync_add_and_fetch(&foo, 1);
69
- __sync_sub_and_fetch(&foo, 1);
70
- return 0;
71
- ] ] ) ] ,[ PHP_cv_APCU_GCC_ATOMICS=yes] ,[ PHP_cv_APCU_GCC_ATOMICS=no] )
72
- ] )
73
-
74
- if test "x${PHP_cv_APCU_GCC_ATOMICS}" != "xyes"; then
75
- AC_MSG_ERROR ( [ Compiler does not support atomics] )
76
- fi
64
+ AC_CACHE_CHECK ( [ whether the target compiler supports builtin atomics] , PHP_cv_APCU_GCC_ATOMICS , [
65
+
66
+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [ ] ] , [ [
67
+ int foo = 0;
68
+ __sync_add_and_fetch(&foo, 1);
69
+ __sync_sub_and_fetch(&foo, 1);
70
+ return 0;
71
+ ] ] ) ] ,[ PHP_cv_APCU_GCC_ATOMICS=yes] ,[ PHP_cv_APCU_GCC_ATOMICS=no] )
72
+ ] )
73
+
74
+ if test "x${PHP_cv_APCU_GCC_ATOMICS}" != "xyes"; then
75
+ AC_MSG_ERROR ( [ Compiler does not support atomics] )
76
+ fi
77
77
fi
78
78
79
79
if test "$PHP_APCU" != "no"; then
80
- if test "$PHP_APCU_DEBUG" != "no"; then
81
- AC_DEFINE ( APC_DEBUG , 1 , [ ] )
82
- fi
83
-
84
- if test "$PHP_APCU_MMAP" != "no"; then
85
- AC_DEFINE ( APC_MMAP , 1 , [ ] )
86
- fi
80
+ if test "$PHP_APCU_DEBUG" != "no"; then
81
+ AC_DEFINE ( APC_DEBUG , 1 , [ ] )
82
+ fi
83
+
84
+ if test "$PHP_APCU_MMAP" != "no"; then
85
+ AC_DEFINE ( APC_MMAP , 1 , [ ] )
86
+ fi
87
87
88
88
if test "$PHP_APCU_RWLOCKS" != "no"; then
89
- orig_LIBS="$LIBS"
90
- LIBS="$LIBS -lpthread"
89
+ orig_LIBS="$LIBS"
90
+ LIBS="$LIBS -lpthread"
91
91
AC_MSG_CHECKING ( [ for pthread rwlocks] )
92
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
93
- #include <sys/types.h>
94
- #include <pthread.h>
92
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
93
+ #include <sys/types.h>
94
+ #include <pthread.h>
95
95
#include <stdio.h>
96
96
int main() {
97
- pthread_rwlock_t rwlock;
98
- pthread_rwlockattr_t attr;
99
-
100
- if(pthread_rwlockattr_init(&attr)) {
101
- puts("Unable to initialize pthread attributes (pthread_rwlockattr_init).");
102
- return -1;
103
- }
104
- if(pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) {
105
- puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_rwlockattr_setpshared), your system may not support shared rwlock's.");
106
- return -1;
107
- }
108
- if(pthread_rwlock_init(&rwlock, &attr)) {
109
- puts("Unable to initialize the rwlock (pthread_rwlock_init).");
110
- return -1;
111
- }
112
- if(pthread_rwlockattr_destroy(&attr)) {
113
- puts("Unable to destroy rwlock attributes (pthread_rwlockattr_destroy).");
114
- return -1;
115
- }
116
- if(pthread_rwlock_destroy(&rwlock)) {
117
- puts("Unable to destroy rwlock (pthread_rwlock_destroy).");
118
- return -1;
119
- }
120
-
121
- return 0;
97
+ pthread_rwlock_t rwlock;
98
+ pthread_rwlockattr_t attr;
99
+
100
+ if(pthread_rwlockattr_init(&attr)) {
101
+ puts("Unable to initialize pthread attributes (pthread_rwlockattr_init).");
102
+ return -1;
103
+ }
104
+ if(pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) {
105
+ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_rwlockattr_setpshared), your system may not support shared rwlock's.");
106
+ return -1;
107
+ }
108
+ if(pthread_rwlock_init(&rwlock, &attr)) {
109
+ puts("Unable to initialize the rwlock (pthread_rwlock_init).");
110
+ return -1;
111
+ }
112
+ if(pthread_rwlockattr_destroy(&attr)) {
113
+ puts("Unable to destroy rwlock attributes (pthread_rwlockattr_destroy).");
114
+ return -1;
115
+ }
116
+ if(pthread_rwlock_destroy(&rwlock)) {
117
+ puts("Unable to destroy rwlock (pthread_rwlock_destroy).");
118
+ return -1;
119
+ }
120
+
121
+ return 0;
122
122
}
123
- ] ] ) ] ,[ dnl -Success-
124
- APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
125
- PHP_ADD_LIBRARY(pthread)
126
- PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
127
- AC_DEFINE ( APC_NATIVE_RWLOCK , 1 , [ ] )
128
- AC_MSG_RESULT ( [ yes] )
129
- ] ,[ dnl -Failure-
130
- AC_MSG_RESULT ( [ no] )
131
- PHP_APCU_RWLOCKS=no
132
- ] ,[
133
- APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
134
- PHP_ADD_LIBRARY(pthread)
135
- PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
123
+ ] ] ) ] ,[ dnl -Success-
124
+ APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
125
+ PHP_ADD_LIBRARY(pthread)
126
+ PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
127
+ AC_DEFINE ( APC_NATIVE_RWLOCK , 1 , [ ] )
128
+ AC_MSG_RESULT ( [ yes] )
129
+ ] ,[ dnl -Failure-
130
+ AC_MSG_RESULT ( [ no] )
131
+ PHP_APCU_RWLOCKS=no
132
+ ] ,[
133
+ APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
134
+ PHP_ADD_LIBRARY(pthread)
135
+ PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
136
136
] )
137
137
LIBS="$orig_LIBS"
138
138
fi
139
-
139
+
140
140
if test "$PHP_APCU" != "no"; then
141
141
orig_LIBS="$LIBS"
142
- LIBS="$LIBS -lpthread"
142
+ LIBS="$LIBS -lpthread"
143
143
AC_MSG_CHECKING ( [ for pthread mutexes] )
144
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
145
- #include <sys/types.h>
146
- #include <pthread.h>
144
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
145
+ #include <sys/types.h>
146
+ #include <pthread.h>
147
147
#include <stdio.h>
148
148
int main() {
149
- pthread_mutex_t mutex;
150
- pthread_mutexattr_t attr;
151
-
152
- if(pthread_mutexattr_init(&attr)) {
153
- puts("Unable to initialize pthread attributes (pthread_mutexattr_init).");
154
- return -1;
155
- }
156
- if(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) {
157
- puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_mutexattr_setpshared), your system may not support shared mutex's.");
158
- return -1;
159
- }
160
- if(pthread_mutex_init(&mutex, &attr)) {
161
- puts("Unable to initialize the mutex (pthread_mutex_init).");
162
- return -1;
163
- }
164
- if(pthread_mutexattr_destroy(&attr)) {
165
- puts("Unable to destroy mutex attributes (pthread_mutexattr_destroy).");
166
- return -1;
167
- }
168
- if(pthread_mutex_destroy(&mutex)) {
169
- puts("Unable to destroy mutex (pthread_mutex_destroy).");
170
- return -1;
171
- }
172
- return 0;
149
+ pthread_mutex_t mutex;
150
+ pthread_mutexattr_t attr;
151
+
152
+ if(pthread_mutexattr_init(&attr)) {
153
+ puts("Unable to initialize pthread attributes (pthread_mutexattr_init).");
154
+ return -1;
155
+ }
156
+ if(pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) {
157
+ puts("Unable to set PTHREAD_PROCESS_SHARED (pthread_mutexattr_setpshared), your system may not support shared mutex's.");
158
+ return -1;
159
+ }
160
+ if(pthread_mutex_init(&mutex, &attr)) {
161
+ puts("Unable to initialize the mutex (pthread_mutex_init).");
162
+ return -1;
163
+ }
164
+ if(pthread_mutexattr_destroy(&attr)) {
165
+ puts("Unable to destroy mutex attributes (pthread_mutexattr_destroy).");
166
+ return -1;
167
+ }
168
+ if(pthread_mutex_destroy(&mutex)) {
169
+ puts("Unable to destroy mutex (pthread_mutex_destroy).");
170
+ return -1;
171
+ }
172
+ return 0;
173
173
}
174
- ] ] ) ] ,[ dnl -Success-
175
- APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
176
- PHP_ADD_LIBRARY(pthread)
177
- PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
178
- AC_MSG_RESULT ( [ yes] )
179
- AC_DEFINE ( APC_HAS_PTHREAD_MUTEX , 1 , [ ] )
180
- ] ,[ dnl -Failure-
181
- AC_MSG_RESULT ( [ no] )
182
- PHP_APCU_MUTEX=no
183
- ] ,[
184
- APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
185
- PHP_ADD_LIBRARY(pthread)
186
- PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
187
- ] )
188
- LIBS="$orig_LIBS"
174
+ ] ] ) ] ,[ dnl -Success-
175
+ APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
176
+ PHP_ADD_LIBRARY(pthread)
177
+ PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
178
+ AC_MSG_RESULT ( [ yes] )
179
+ AC_DEFINE ( APC_HAS_PTHREAD_MUTEX , 1 , [ ] )
180
+ ] ,[ dnl -Failure-
181
+ AC_MSG_RESULT ( [ no] )
182
+ PHP_APCU_MUTEX=no
183
+ ] ,[
184
+ APCU_CFLAGS="-D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
185
+ PHP_ADD_LIBRARY(pthread)
186
+ PHP_LDFLAGS="$PHP_LDFLAGS -lpthread"
187
+ ] )
188
+ LIBS="$orig_LIBS"
189
189
fi
190
-
190
+
191
191
if test "$PHP_APCU_RWLOCKS" = "no"; then
192
192
if test "$PHP_APCU_MUTEX" = "no"; then
193
193
if test "$PHP_APCU_SPINLOCK" != "no"; then
@@ -199,7 +199,7 @@ if test "$PHP_APCU" != "no"; then
199
199
fi
200
200
fi
201
201
fi
202
-
202
+
203
203
AC_CHECK_FUNCS ( sigaction )
204
204
AC_CACHE_CHECK ( for union semun , php_cv_semun ,
205
205
[
@@ -226,8 +226,8 @@ if test "$PHP_APCU" != "no"; then
226
226
PHP_APCU_VALGRIND=no
227
227
] , [
228
228
PHP_APCU_VALGRIND=yes
229
- AC_CHECK_HEADER ( valgrind/memcheck.h ,
230
- [ AC_DEFINE ( [ HAVE_VALGRIND_MEMCHECK_H] ,1 , [ enable valgrind memchecks] ) ] )
229
+ AC_CHECK_HEADER ( valgrind/memcheck.h ,
230
+ [ AC_DEFINE ( [ HAVE_VALGRIND_MEMCHECK_H] ,1 , [ enable valgrind memchecks] ) ] )
231
231
] )
232
232
233
233
for i in -Wall -Wextra -Wno-unused-parameter; do
@@ -244,7 +244,7 @@ if test "$PHP_APCU" != "no"; then
244
244
apc_time.c \
245
245
apc_iterator.c \
246
246
apc_persist.c"
247
-
247
+
248
248
PHP_CHECK_LIBRARY(rt, shm_open, [ PHP_ADD_LIBRARY(rt,,APCU_SHARED_LIBADD)] )
249
249
PHP_NEW_EXTENSION(apcu, $apc_sources, $ext_shared,, \\$(APCU_CFLAGS))
250
250
PHP_SUBST(APCU_SHARED_LIBADD)
@@ -262,18 +262,18 @@ if test "$PHP_COVERAGE" = "yes"; then
262
262
if test "$GCC" != "yes"; then
263
263
AC_MSG_ERROR ( [ GCC is required for --enable-coverage] )
264
264
fi
265
-
265
+
266
266
dnl Check if ccache is being used
267
267
case `$php_shtool path $CC` in
268
268
*ccache*[ )] gcc_ccache=yes;;
269
269
*[ )] gcc_ccache=no;;
270
270
esac
271
271
272
272
if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
273
- AC_MSG_ERROR ( [ ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable
273
+ AC_MSG_ERROR ( [ ccache must be disabled when --enable-coverage option is used. You can disable ccache by setting environment variable
274
274
CCACHE_DISABLE=1.] )
275
275
fi
276
-
276
+
277
277
lcov_version_list="1.5 1.6 1.7 1.9"
278
278
279
279
AC_CHECK_PROG ( LCOV , lcov , lcov )
@@ -292,7 +292,7 @@ CCACHE_DISABLE=1.])
292
292
done
293
293
] )
294
294
else
295
- lcov_msg="To enable code coverage reporting you must have one of the following LCOV versions installed: $lcov_version_list"
295
+ lcov_msg="To enable code coverage reporting you must have one of the following LCOV versions installed: $lcov_version_list"
296
296
AC_MSG_ERROR ( [ $lcov_msg] )
297
297
fi
298
298
@@ -320,4 +320,4 @@ CCACHE_DISABLE=1.])
320
320
CFLAGS="$CFLAGS -O0 -ggdb -fprofile-arcs -ftest-coverage"
321
321
CXXFLAGS="$CXXFLAGS -ggdb -O0 -fprofile-arcs -ftest-coverage"
322
322
fi
323
- dnl vim: set ts=2
323
+ dnl vim: set ts=2
0 commit comments