root/eaccelerator/tags/0.9.4-rc1/config.m4

Revision 134, 10.4 kB (checked in by zoeloelip, 3 years ago)

* Removed executor hooks, they weren't used anyway.
* Check if eA has a valid cache directory.
* Make the init of php fail if the initialisation of the shared memory

or cache directory failes.

* set shared memory size in eaccelerator.ini to 0 so the default OS

size is used.

  • 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 dnl PHP_BUILD_SHARED
96 if test "$PHP_EACCELERATOR" != "no"; then
97   PHP_EXTENSION(eaccelerator, $ext_shared)
98   AC_DEFINE(HAVE_EACCELERATOR, 1, [Define if you like to use eAccelerator])
99
100   if test "$eaccelerator_crash_detection" = "yes"; then
101     AC_DEFINE(WITH_EACCELERATOR_CRASH_DETECTION, 1, [Define if you like to release eAccelerator resources on PHP crash])
102   fi
103   if test "$eaccelerator_optimizer" = "yes"; then
104     AC_DEFINE(WITH_EACCELERATOR_OPTIMIZER, 1, [Define if you like to use peephole opcode optimization])
105   fi
106   if test "$eaccelerator_encoder" = "yes"; then
107     AC_DEFINE(WITH_EACCELERATOR_ENCODER, 1, [Define if you like to use eAccelerator enoder])
108   fi
109   if test "$eaccelerator_loader" = "yes"; then
110     AC_DEFINE(WITH_EACCELERATOR_LOADER, 1, [Define if you like to load files encoded by eAccelerator encoder])
111   fi
112   if test "$eaccelerator_shm" = "yes"; then
113     AC_DEFINE(WITH_EACCELERATOR_SHM, 1, [Define if you like to use the eAccelerator functions to store keys in shared memory])
114   fi
115   if test "$eaccelerator_webui" = "yes"; then
116     AC_DEFINE(WITH_EACCELERATOR_WEBUI, 1, [Define if you like to use the eAccelerator WebUI])
117   fi
118   if test "$eaccelerator_sessions" = "yes"; then
119     AC_DEFINE(WITH_EACCELERATOR_SESSIONS, 1, [Define if you like to use eAccelerator session handlers to store session's information in shared memory])
120   fi
121   if test "$eaccelerator_content_caching" = "yes"; then
122     AC_DEFINE(WITH_EACCELERATOR_CONTENT_CACHING, 1, [Define if you like to use eAccelerator content cachin API])
123   fi
124   if test "$eaccelerator_disassembler" = "yes"; then
125     AC_DEFINE(WITH_EACCELERATOR_DISASSEMBLER, 1, [Define if you like to explore Zend bytecode])
126   fi
127   if test "$eaccelerator_inode" = "yes"; then
128     AC_DEFINE(WITH_EACCELERATOR_USE_INODE, 1, [Undef if you don't wan't to use inodes to determine hash keys])
129   fi
130   if test "$eaccelerator_debug" = "yes"; then
131     AC_DEFINE(DEBUG, 1, [Undef when you want to enable eaccelerator debug code])
132   fi
133
134   AC_REQUIRE_CPP()
135
136   AC_HAVE_HEADERS(unistd.h limits.h sys/param.h sched.h)
137
138   AC_MSG_CHECKING(mandatory system headers)
139   AC_TRY_CPP([#include <stdio.h>
140 #include <stdlib.h>
141 #include <string.h>
142 #include <malloc.h>
143 #include <errno.h>
144 #include <fcntl.h>
145 #include <sys/stat.h>
146 #include <sys/types.h>],msg=yes,msg=no)
147   AC_MSG_RESULT([$msg])
148
149   AC_MSG_CHECKING(whether union semun is defined in sys/sem.h)
150   AC_TRY_COMPILE([
151   #include <sys/types.h>
152   #include <sys/ipc.h>
153   #include <sys/sem.h>
154   ],[
155   union semun arg;
156   semctl(0, 0, 0, arg);
157   ],
158   AC_DEFINE(HAVE_UNION_SEMUN, 1, [Define if you have semun union in sys/sem.h])
159   msg=yes,msg=no)
160   AC_MSG_RESULT([$msg])
161
162   mm_shm_ipc=no
163   mm_shm_mmap_anon=no
164   mm_shm_mmap_zero=no
165   mm_shm_mmap_file=no
166   mm_shm_mmap_posix=no
167
168   AC_MSG_CHECKING(for sysvipc shared memory support)
169   AC_TRY_RUN([#define MM_SEM_NONE
170 #define MM_SHM_IPC
171 #define MM_TEST_SHM
172 #include "$ext_srcdir/mm.c"
173 ],dnl
174     mm_shm_ipc=yes
175     msg=yes,msg=no,msg=no)
176   AC_MSG_RESULT([$msg])
177   EA_REMOVE_IPC_TEST()
178
179   AC_MSG_CHECKING(for mmap shared memory support)
180   AC_TRY_RUN([#define MM_SEM_NONE
181 #define MM_SHM_MMAP_FILE
182 #define MM_TEST_SHM
183 #include "$ext_srcdir/mm.c"
184 ],dnl
185     mm_shm_mmap_file=yes
186     msg=yes,msg=no,msg=no)
187   AC_MSG_RESULT([$msg])
188
189   AC_MSG_CHECKING(for mmap on /dev/zero shared memory support)
190   AC_TRY_RUN([#define MM_SEM_NONE
191 #define MM_SHM_MMAP_ZERO
192 #define MM_TEST_SHM
193 #include "$ext_srcdir/mm.c"
194 ],dnl
195     mm_shm_mmap_zero=yes
196     msg=yes,msg=no,msg=no)
197   AC_MSG_RESULT([$msg])
198
199   AC_MSG_CHECKING(for anonymous mmap shared memory support)
200   AC_TRY_RUN([#define MM_SEM_NONE
201 #define MM_SHM_MMAP_ANON
202 #define MM_TEST_SHM
203 #include "$ext_srcdir/mm.c"
204 ],dnl
205     mm_shm_mmap_anon=yes
206     msg=yes,msg=no,msg=no)
207   AC_MSG_RESULT([$msg])
208
209   AC_MSG_CHECKING(for posix mmap shared memory support)
210   AC_TRY_RUN([#define MM_SEM_NONE
211 #define MM_SHM_MMAP_POSIX
212 #define MM_TEST_SHM
213 #include "$ext_srcdir/mm.c"
214 ],dnl
215     mm_shm_mmap_posix=yes
216     msg=yes,msg=no,msg=no)
217   AC_MSG_RESULT([$msg])
218
219   AC_MSG_CHECKING(for best shared memory type)
220   if test "$mm_shm_ipc" = "yes"; then
221     AC_DEFINE(MM_SHM_IPC, 1, [Define if you like to use sysvipc based shared memory])
222     msg="sysvipc"
223   elif test "$mm_shm_mmap_anon" = "yes"; then
224     AC_DEFINE(MM_SHM_MMAP_ANON, 1, [Define if you like to use anonymous mmap based shared memory])
225     msg="anonymous mmap"
226   elif test "$mm_shm_mmap_zero" = "yes"; then
227     AC_DEFINE(MM_SHM_MMAP_ZERO, 1, [Define if you like to use mmap on /dev/zero based shared memory])
228     msg="mmap on /dev/zero"
229   elif test "$mm_shm_mmap_posix" = "yes"; then
230     AC_DEFINE(MM_SHM_MMAP_POSIX, 1, [Define if you like to use posix mmap based shared memory])
231     msg="posix mmap"
232   elif test "$mm_shm_mmap_file" = "yes"; then
233     AC_DEFINE(MM_SHM_MMAP_FILE, 1, [Define if you like to use mmap on temporary file shared memory])
234     msg="mmap"
235   else
236     msg="no"
237   fi
238   AC_MSG_RESULT([$msg])
239   if test "$msg" = "no" ; then
240     AC_MSG_WARN([eaccelerator cannot detect shared memory type, which is required])
241   fi
242
243   AC_MSG_CHECKING(for spinlock semaphores support)
244   AC_TRY_RUN([#define MM_SEM_SPINLOCK
245 #define MM_TEST_SEM
246 #include "$ext_srcdir/mm.c"
247 ],dnl
248     mm_sem_spinlock=yes
249     msg=yes,msg=no,msg=no)
250   AC_MSG_RESULT([$msg])
251
252   AC_MSG_CHECKING(for pthread semaphores support)
253   AC_TRY_RUN([#define MM_SEM_PTHREAD
254 #define MM_TEST_SEM
255 #include "$ext_srcdir/mm.c"
256 ],dnl
257     mm_sem_pthread=yes
258     msg=yes,msg=no,msg=no)
259   AC_MSG_RESULT([$msg])
260
261   AC_MSG_CHECKING(for posix semaphores support)
262   AC_TRY_RUN([#define MM_SEM_POSIX
263 #define MM_TEST_SEM
264 #include "$ext_srcdir/mm.c"
265 ],dnl
266     mm_sem_posix=yes
267     msg=yes,msg=no,msg=no)
268   AC_MSG_RESULT([$msg])
269
270   AC_MSG_CHECKING(for sysvipc semaphores support)
271   AC_TRY_RUN([#define MM_SEM_IPC
272 #define MM_TEST_SEM
273 #include "$ext_srcdir/mm.c"
274 ],dnl
275     mm_sem_ipc=yes
276     msg=yes,msg=no,msg=no)
277   AC_MSG_RESULT([$msg])
278   EA_REMOVE_IPC_TEST()
279
280   AC_MSG_CHECKING(for fcntl semaphores support)
281   AC_TRY_RUN([#define MM_SEM_FCNTL
282 #define MM_TEST_SEM
283 #include "$ext_srcdir/mm.c"
284 ],dnl
285     mm_sem_fcntl=yes
286     msg=yes,msg=no,msg=no)
287   AC_MSG_RESULT([$msg])
288
289   AC_MSG_CHECKING(for flock semaphores support)
290   AC_TRY_RUN([#define MM_SEM_FLOCK
291 #define MM_TEST_SEM
292 #include "$ext_srcdir/mm.c"
293 ],dnl
294     mm_sem_flock=yes
295     msg=yes,msg=no,msg=no)
296   AC_MSG_RESULT([$msg])
297
298   AC_MSG_CHECKING(for best semaphores type)
299   if test "$mm_sem_spinlock" = "yes"; then
300     AC_DEFINE(MM_SEM_SPINLOCK, 1, [Define if you like to use spinlock based semaphores])
301     msg="spinlock"
302   elif test "$mm_sem_ipc" = "yes"; then
303     AC_DEFINE(MM_SEM_IPC, 1, [Define if you like to use sysvipc based semaphores])
304     msg="sysvipc"
305   elif test "$mm_sem_fcntl" = "yes"; then
306     AC_DEFINE(MM_SEM_FCNTL, 1, [Define if you like to use fcntl based semaphores])
307     msg="fcntl"
308   elif test "$mm_sem_flock" = "yes"; then
309     AC_DEFINE(MM_SEM_FLOCK, 1, [Define if you like to use flock based semaphores])
310     msg="flock"
311   elif test "$mm_sem_pthread" = "yes"; then
312     AC_DEFINE(MM_SEM_PTHREAD, 1, [Define if you like to use pthread based semaphores])
313     msg="pthread"
314   elif test "$mm_sem_posix" = "yes"; then
315     AC_DEFINE(MM_SEM_POSIX, 1, [Define if you like to use posix based semaphores])
316     msg="posix"
317   else
318     msg="no"
319   fi
320   AC_MSG_RESULT([$msg])
321   if test "$msg" = "no" ; then
322     AC_MSG_WARN([eaccelerator cannot semaphores type, which is required])
323   fi
324
325   AC_CHECK_FUNC(sched_yield,[
326       AC_DEFINE(HAVE_SCHED_YIELD, 1, [Define if ou have sched_yield function])
327     ])
328
329   AC_CHECK_FUNC(mprotect,[
330       AC_DEFINE(HAVE_MPROTECT, 1, [Define if ou have mprotect function])
331     ])
332
333   old_cppflags="$CPPFLAGS"
334   CPPFLAGS="$CPPFLAGS $INCLUDES -I$abs_srcdir"
335   AC_MSG_CHECKING(for ext/session/php_session.h)
336   AC_TRY_CPP([#include "ext/session/php_session.h"],msg="yes",msg="no")
337   if test "$msg" = "yes"; then
338     AC_DEFINE(HAVE_EXT_SESSION_PHP_SESSION_H, 1, [Define if you have the <ext/session/php_session.h> header file.])
339   fi
340   AC_MSG_RESULT([$msg])
341   CPPFLAGS="$old_cppflags"
342
343 fi
Note: See TracBrowser for help on using the browser.