root/eaccelerator/tags/0.9.4/config.m4

Revision 150, 10.8 kB (checked in by zoeloelip, 3 years ago)

The owner of the a sysvipc mutex will now be changed on creation of

of the mutex. The user will be set to the uid set with
--with-eaccelerator-userid. This way the semaphore doesn't need to
be public writable anymore.

Moved some inactive contributors to the inactive list.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 AC_DEFUN([EA_REMOVE_IPC_TEST], [
2   # for cygwin ipc error
3   if test -f conftest* ; then
4     echo $ECHO_N "Wait for conftest* to exit$ECHO_C"
5     while ! rm -f conftest* 2>/dev/null ; do
6       echo $ECHO_N ".$ECHO_C"
7       sleep 1
8     done
9     echo
10   fi
11 ])
12
13 AC_ARG_WITH(eaccelerator,[],[enable_eaccelerator=$withval])
14
15 PHP_ARG_ENABLE(eaccelerator, whether to enable eaccelerator support,
16 [  --enable-eaccelerator        Enable eaccelerator support])
17
18 AC_ARG_WITH(eaccelerator-crash-detection,
19 [  --without-eaccelerator-crash-detection  Do not include eaccelerator crash detection],[
20   eaccelerator_crash_detection=$withval
21 ],[
22   eaccelerator_crash_detection=yes
23 ])
24
25 AC_ARG_WITH(eaccelerator-optimizer,
26 [  --without-eaccelerator-optimizer        Do not include eaccelerator optimizer],[
27   eaccelerator_optimizer=$withval
28 ],[
29   eaccelerator_optimizer=yes
30 ])
31
32 AC_ARG_WITH(eaccelerator-encoder,
33 [  --without-eaccelerator-encoder          Do not include eaccelerator encoder],[
34   eaccelerator_encoder=$withval
35 ],[
36   eaccelerator_encoder=yes
37 ])
38
39 AC_ARG_WITH(eaccelerator-loader,
40 [  --without-eaccelerator-loader           Do not include eaccelerator loader],[
41   eaccelerator_loader=$withval
42 ],[
43   eaccelerator_loader=yes
44 ])
45
46 AC_ARG_WITH(eaccelerator-shared-memory,
47 [  --without-eaccelerator-shared-memory    Do not include eaccelerator shared memory functions],[
48   eaccelerator_shm=$withval
49 ],[
50   eaccelerator_shm=yes
51 ])
52
53 AC_ARG_WITH(eaccelerator-webui,
54 [  --without-eaccelerator-webui        Do not include the eaccelerator WebUI],[
55   eaccelerator_webui=$withval
56 ],[
57   eaccelerator_webui=yes
58 ])
59
60 AC_ARG_WITH(eaccelerator-sessions,
61 [  --without-eaccelerator-sessions         Do not include eaccelerator sessions],[
62   eaccelerator_sessions=$withval
63 ],[
64   eaccelerator_sessions=yes
65 ])
66
67 AC_ARG_WITH(eaccelerator-content-caching,
68 [  --without-eaccelerator-content-caching  Do not include eaccelerator content caching],[
69   eaccelerator_content_caching=$withval
70 ],[
71   eaccelerator_content_caching=yes
72 ])
73
74 AC_ARG_WITH(eaccelerator-disassembler,
75 [  --with-eaccelerator-disassembler        Include disassembler],[
76   eaccelerator_disassembler=$withval
77 ],[
78   eaccelerator_disassemmbler=no
79 ])
80
81 AC_ARG_WITH(eaccelerator-use-inode,
82 [  --without-eaccelerator-use-inode            Don't use inodes to determine hash keys (never used on win32)],[
83   eaccelerator_inode=$withval
84 ],[
85   eaccelerator_inode=yes
86 ])
87
88 AC_ARG_WITH(eaccelerator-debug,
89 [  --with-eaccelerator-debug                    Enable the debug code so eaccelerator logs verbose.],[
90   eaccelerator_debug=$withval
91 ],[
92   eaccelerator_debug=no
93 ])
94
95 AC_ARG_WITH(eaccelerator-userid,
96 [  --with-eaccelerator-userid               eAccelerator runs under this userid, only needed when using sysvipc semaphores.],[
97   ea_userid=$withval
98 ],[
99   ea_userid=0
100 ])
101
102 dnl PHP_BUILD_SHARED
103 if test "$PHP_EACCELERATOR" != "no"; then
104   PHP_EXTENSION(eaccelerator, $ext_shared)
105   AC_DEFINE(HAVE_EACCELERATOR, 1, [Define if you like to use eAccelerator])
106
107   AC_DEFINE_UNQUOTED(EA_USERID, $ea_userid, [The userid eAccelerator will be running under.])
108    
109   if test "$eaccelerator_crash_detection" = "yes"; then
110     AC_DEFINE(WITH_EACCELERATOR_CRASH_DETECTION, 1, [Define if you like to release eAccelerator resources on PHP crash])
111   fi
112   if test "$eaccelerator_optimizer" = "yes"; then
113     AC_DEFINE(WITH_EACCELERATOR_OPTIMIZER, 1, [Define if you like to use peephole opcode optimization])
114   fi
115   if test "$eaccelerator_encoder" = "yes"; then
116     AC_DEFINE(WITH_EACCELERATOR_ENCODER, 1, [Define if you like to use eAccelerator enoder])
117   fi
118   if test "$eaccelerator_loader" = "yes"; then
119     AC_DEFINE(WITH_EACCELERATOR_LOADER, 1, [Define if you like to load files encoded by eAccelerator encoder])
120   fi
121   if test "$eaccelerator_shm" = "yes"; then
122     AC_DEFINE(WITH_EACCELERATOR_SHM, 1, [Define if you like to use the eAccelerator functions to store keys in shared memory])
123   fi
124   if test "$eaccelerator_webui" = "yes"; then
125     AC_DEFINE(WITH_EACCELERATOR_WEBUI, 1, [Define if you like to use the eAccelerator WebUI])
126   fi
127   if test "$eaccelerator_sessions" = "yes"; then
128     AC_DEFINE(WITH_EACCELERATOR_SESSIONS, 1, [Define if you like to use eAccelerator session handlers to store session's information in shared memory])
129   fi
130   if test "$eaccelerator_content_caching" = "yes"; then
131     AC_DEFINE(WITH_EACCELERATOR_CONTENT_CACHING, 1, [Define if you like to use eAccelerator content cachin API])
132   fi
133   if test "$eaccelerator_disassembler" = "yes"; then
134     AC_DEFINE(WITH_EACCELERATOR_DISASSEMBLER, 1, [Define if you like to explore Zend bytecode])
135   fi
136   if test "$eaccelerator_inode" = "yes"; then
137     AC_DEFINE(WITH_EACCELERATOR_USE_INODE, 1, [Undef if you don't wan't to use inodes to determine hash keys])
138   fi
139   if test "$eaccelerator_debug" = "yes"; then
140     AC_DEFINE(DEBUG, 1, [Undef when you want to enable eaccelerator debug code])
141   fi
142
143   AC_REQUIRE_CPP()
144
145   AC_HAVE_HEADERS(unistd.h limits.h sys/param.h sched.h)
146
147   AC_MSG_CHECKING(mandatory system headers)
148   AC_TRY_CPP([#include <stdio.h>
149 #include <stdlib.h>
150 #include <string.h>
151 #include <malloc.h>
152 #include <errno.h>
153 #include <fcntl.h>
154 #include <sys/stat.h>
155 #include <sys/types.h>],msg=yes,msg=no)
156   AC_MSG_RESULT([$msg])
157
158   AC_MSG_CHECKING(whether union semun is defined in sys/sem.h)
159   AC_TRY_COMPILE([
160   #include <sys/types.h>
161   #include <sys/ipc.h>
162   #include <sys/sem.h>
163   ],[
164   union semun arg;
165   semctl(0, 0, 0, arg);
166   ],
167   AC_DEFINE(HAVE_UNION_SEMUN, 1, [Define if you have semun union in sys/sem.h])
168   msg=yes,msg=no)
169   AC_MSG_RESULT([$msg])
170
171   mm_shm_ipc=no
172   mm_shm_mmap_anon=no
173   mm_shm_mmap_zero=no
174   mm_shm_mmap_file=no
175   mm_shm_mmap_posix=no
176
177   AC_MSG_CHECKING(for sysvipc shared memory support)
178   AC_TRY_RUN([#define MM_SEM_NONE
179 #define MM_SHM_IPC
180 #define MM_TEST_SHM
181 #include "$ext_srcdir/mm.c"
182 ],dnl
183     mm_shm_ipc=yes
184     msg=yes,msg=no,msg=no)
185   AC_MSG_RESULT([$msg])
186   EA_REMOVE_IPC_TEST()
187
188   AC_MSG_CHECKING(for mmap shared memory support)
189   AC_TRY_RUN([#define MM_SEM_NONE
190 #define MM_SHM_MMAP_FILE
191 #define MM_TEST_SHM
192 #include "$ext_srcdir/mm.c"
193 ],dnl
194     mm_shm_mmap_file=yes
195     msg=yes,msg=no,msg=no)
196   AC_MSG_RESULT([$msg])
197
198   AC_MSG_CHECKING(for mmap on /dev/zero shared memory support)
199   AC_TRY_RUN([#define MM_SEM_NONE
200 #define MM_SHM_MMAP_ZERO
201 #define MM_TEST_SHM
202 #include "$ext_srcdir/mm.c"
203 ],dnl
204     mm_shm_mmap_zero=yes
205     msg=yes,msg=no,msg=no)
206   AC_MSG_RESULT([$msg])
207
208   AC_MSG_CHECKING(for anonymous mmap shared memory support)
209   AC_TRY_RUN([#define MM_SEM_NONE
210 #define MM_SHM_MMAP_ANON
211 #define MM_TEST_SHM
212 #include "$ext_srcdir/mm.c"
213 ],dnl
214     mm_shm_mmap_anon=yes
215     msg=yes,msg=no,msg=no)
216   AC_MSG_RESULT([$msg])
217
218   AC_MSG_CHECKING(for posix mmap shared memory support)
219   AC_TRY_RUN([#define MM_SEM_NONE
220 #define MM_SHM_MMAP_POSIX
221 #define MM_TEST_SHM
222 #include "$ext_srcdir/mm.c"
223 ],dnl
224     mm_shm_mmap_posix=yes
225     msg=yes,msg=no,msg=no)
226   AC_MSG_RESULT([$msg])
227
228   AC_MSG_CHECKING(for best shared memory type)
229   if test "$mm_shm_ipc" = "yes"; then
230     AC_DEFINE(MM_SHM_IPC, 1, [Define if you like to use sysvipc based shared memory])
231     msg="sysvipc"
232   elif test "$mm_shm_mmap_anon" = "yes"; then
233     AC_DEFINE(MM_SHM_MMAP_ANON, 1, [Define if you like to use anonymous mmap based shared memory])
234     msg="anonymous mmap"
235   elif test "$mm_shm_mmap_zero" = "yes"; then
236     AC_DEFINE(MM_SHM_MMAP_ZERO, 1, [Define if you like to use mmap on /dev/zero based shared memory])
237     msg="mmap on /dev/zero"
238   elif test "$mm_shm_mmap_posix" = "yes"; then
239     AC_DEFINE(MM_SHM_MMAP_POSIX, 1, [Define if you like to use posix mmap based shared memory])
240     msg="posix mmap"
241   elif test "$mm_shm_mmap_file" = "yes"; then
242     AC_DEFINE(MM_SHM_MMAP_FILE, 1, [Define if you like to use mmap on temporary file shared memory])
243     msg="mmap"
244   else
245     msg="no"
246   fi
247   AC_MSG_RESULT([$msg])
248   if test "$msg" = "no" ; then
249     AC_MSG_WARN([eaccelerator cannot detect shared memory type, which is required])
250   fi
251
252   AC_MSG_CHECKING(for spinlock semaphores support)
253   AC_TRY_RUN([#define MM_SEM_SPINLOCK
254 #define MM_TEST_SEM
255 #include "$ext_srcdir/mm.c"
256 ],dnl
257     mm_sem_spinlock=yes
258     msg=yes,msg=no,msg=no)
259   AC_MSG_RESULT([$msg])
260
261   AC_MSG_CHECKING(for pthread semaphores support)
262   AC_TRY_RUN([#define MM_SEM_PTHREAD
263 #define MM_TEST_SEM
264 #include "$ext_srcdir/mm.c"
265 ],dnl
266     mm_sem_pthread=yes
267     msg=yes,msg=no,msg=no)
268   AC_MSG_RESULT([$msg])
269
270   AC_MSG_CHECKING(for posix semaphores support)
271   AC_TRY_RUN([#define MM_SEM_POSIX
272 #define MM_TEST_SEM
273 #include "$ext_srcdir/mm.c"
274 ],dnl
275     mm_sem_posix=yes
276     msg=yes,msg=no,msg=no)
277   AC_MSG_RESULT([$msg])
278
279   AC_MSG_CHECKING(for sysvipc semaphores support)
280   AC_TRY_RUN([#define MM_SEM_IPC
281 #define MM_TEST_SEM
282 #include "$ext_srcdir/mm.c"
283 ],dnl
284     mm_sem_ipc=yes
285     msg=yes,msg=no,msg=no)
286   AC_MSG_RESULT([$msg])
287   EA_REMOVE_IPC_TEST()
288
289   AC_MSG_CHECKING(for fcntl semaphores support)
290   AC_TRY_RUN([#define MM_SEM_FCNTL
291 #define MM_TEST_SEM
292 #include "$ext_srcdir/mm.c"
293 ],dnl
294     mm_sem_fcntl=yes
295     msg=yes,msg=no,msg=no)
296   AC_MSG_RESULT([$msg])
297
298   AC_MSG_CHECKING(for flock semaphores support)
299   AC_TRY_RUN([#define MM_SEM_FLOCK
300 #define MM_TEST_SEM
301 #include "$ext_srcdir/mm.c"
302 ],dnl
303     mm_sem_flock=yes
304     msg=yes,msg=no,msg=no)
305   AC_MSG_RESULT([$msg])
306
307   AC_MSG_CHECKING(for best semaphores type)
308   if test "$mm_sem_spinlock" = "yes"; then
309     AC_DEFINE(MM_SEM_SPINLOCK, 1, [Define if you like to use spinlock based semaphores])
310     msg="spinlock"
311   elif test "$mm_sem_ipc" = "yes"; then
312     if test $ea_userid = 0; then
313         AC_MSG_ERROR("You need to pass the user id eaccelerator will be running under when using sysvipc semaphores")
314     else
315         AC_DEFINE(MM_SEM_IPC, 1, [Define if you like to use sysvipc based semaphores])
316         msg="sysvipc"
317     fi
318   elif test "$mm_sem_fcntl" = "yes"; then
319     AC_DEFINE(MM_SEM_FCNTL, 1, [Define if you like to use fcntl based semaphores])
320     msg="fcntl"
321   elif test "$mm_sem_flock" = "yes"; then
322     AC_DEFINE(MM_SEM_FLOCK, 1, [Define if you like to use flock based semaphores])
323     msg="flock"
324   elif test "$mm_sem_pthread" = "yes"; then
325     AC_DEFINE(MM_SEM_PTHREAD, 1, [Define if you like to use pthread based semaphores])
326     msg="pthread"
327   elif test "$mm_sem_posix" = "yes"; then
328     AC_DEFINE(MM_SEM_POSIX, 1, [Define if you like to use posix based semaphores])
329     msg="posix"
330   else
331     msg="no"
332   fi
333   AC_MSG_RESULT([$msg])
334   if test "$msg" = "no" ; then
335     AC_MSG_WARN([eaccelerator cannot semaphores type, which is required])
336   fi
337
338   AC_CHECK_FUNC(sched_yield,[
339       AC_DEFINE(HAVE_SCHED_YIELD, 1, [Define if ou have sched_yield function])
340     ])
341
342   AC_CHECK_FUNC(mprotect,[
343       AC_DEFINE(HAVE_MPROTECT, 1, [Define if ou have mprotect function])
344     ])
345
346   old_cppflags="$CPPFLAGS"
347   CPPFLAGS="$CPPFLAGS $INCLUDES -I$abs_srcdir"
348   AC_MSG_CHECKING(for ext/session/php_session.h)
349   AC_TRY_CPP([#include "ext/session/php_session.h"],msg="yes",msg="no")
350   if test "$msg" = "yes"; then
351     AC_DEFINE(HAVE_EXT_SESSION_PHP_SESSION_H, 1, [Define if you have the <ext/session/php_session.h> header file.])
352   fi
353   AC_MSG_RESULT([$msg])
354   CPPFLAGS="$old_cppflags"
355
356 fi
Note: See TracBrowser for help on using the browser.