root/eaccelerator/tags/0.9.5-beta2/config.m4

Revision 178, 10.9 kB (checked in by bart, 3 years ago)

Removed the old webui and made a new controlpanel en disassembler

more information in the README file

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