root/eaccelerator/tags/0.9.3-rc2/config.m4

Revision 73, 10.0 kB (checked in by zoeloelip, 3 years ago)

This patch fixes some stuff concerning configuration. With this patch some parts that are forgotten with the
code split are fixed. They are also needed to compile eA with VC.
The other stuff make it possible to compile eA as a static module for php.

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