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