root/eaccelerator/tags/0.9.5/config.m4

Revision 269, 11.5 kB (checked in by bart, 2 years ago)

Reverse changeset 205 (doc-comment exclusion) from Tom Regner

<t.regner at librics.de>.

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