| 1 | AC_ARG_WITH(eaccelerator,[],[enable_eaccelerator=$withval]) |
|---|
| 2 | |
|---|
| 3 | PHP_ARG_ENABLE(eaccelerator, whether to enable eaccelerator support, |
|---|
| 4 | [ --enable-eaccelerator Enable eaccelerator support]) |
|---|
| 5 | |
|---|
| 6 | AC_ARG_WITH(eaccelerator-crash-detection, |
|---|
| 7 | [ --without-eaccelerator-crash-detection Do not include eaccelerator crash detection],[ |
|---|
| 8 | eaccelerator_crash_detection=$withval |
|---|
| 9 | ],[ |
|---|
| 10 | eaccelerator_crash_detection=yes |
|---|
| 11 | ]) |
|---|
| 12 | |
|---|
| 13 | AC_ARG_WITH(eaccelerator-optimizer, |
|---|
| 14 | [ --without-eaccelerator-optimizer Do not include eaccelerator optimizer],[ |
|---|
| 15 | eaccelerator_optimizer=$withval |
|---|
| 16 | ],[ |
|---|
| 17 | eaccelerator_optimizer=yes |
|---|
| 18 | ]) |
|---|
| 19 | |
|---|
| 20 | AC_ARG_WITH(eaccelerator-encoder, |
|---|
| 21 | [ --without-eaccelerator-encoder Do not include eaccelerator encoder],[ |
|---|
| 22 | eaccelerator_encoder=$withval |
|---|
| 23 | ],[ |
|---|
| 24 | eaccelerator_encoder=yes |
|---|
| 25 | ]) |
|---|
| 26 | |
|---|
| 27 | AC_ARG_WITH(eaccelerator-loader, |
|---|
| 28 | [ --without-eaccelerator-loader Do not include eaccelerator loader],[ |
|---|
| 29 | eaccelerator_loader=$withval |
|---|
| 30 | ],[ |
|---|
| 31 | eaccelerator_loader=yes |
|---|
| 32 | ]) |
|---|
| 33 | |
|---|
| 34 | AC_ARG_WITH(eaccelerator-sessions, |
|---|
| 35 | [ --without-eaccelerator-sessions Do not include eaccelerator sessions],[ |
|---|
| 36 | eaccelerator_sessions=$withval |
|---|
| 37 | ],[ |
|---|
| 38 | eaccelerator_sessions=yes |
|---|
| 39 | ]) |
|---|
| 40 | |
|---|
| 41 | AC_ARG_WITH(eaccelerator-content-caching, |
|---|
| 42 | [ --without-eaccelerator-content-caching Do not include eaccelerator content caching],[ |
|---|
| 43 | eaccelerator_content_caching=$withval |
|---|
| 44 | ],[ |
|---|
| 45 | eaccelerator_content_caching=yes |
|---|
| 46 | ]) |
|---|
| 47 | |
|---|
| 48 | AC_ARG_WITH(eaccelerator-disassembler, |
|---|
| 49 | [ --with-eaccelerator-disassembler Include disassembler],[ |
|---|
| 50 | eaccelerator_disassembler=$withval |
|---|
| 51 | ],[ |
|---|
| 52 | eaccelerator_disassemmbler=no |
|---|
| 53 | ]) |
|---|
| 54 | |
|---|
| 55 | AC_ARG_WITH(eaccelerator-executor, |
|---|
| 56 | [ --with-eaccelerator-executor Include optimized executor (not implemented yet)],[ |
|---|
| 57 | eaccelerator_executor=$withval |
|---|
| 58 | ],[ |
|---|
| 59 | eaccelerator_executor=no |
|---|
| 60 | ]) |
|---|
| 61 | |
|---|
| 62 | dnl PHP_BUILD_SHARED |
|---|
| 63 | if test "$PHP_EACCELERATOR" != "no"; then |
|---|
| 64 | PHP_EXTENSION(eaccelerator, $ext_shared) |
|---|
| 65 | AC_DEFINE(HAVE_EACCELERATOR, 1, [Define if you like to use eAccelerator]) |
|---|
| 66 | |
|---|
| 67 | if test "$eaccelerator_crash_detection" = "yes"; then |
|---|
| 68 | AC_DEFINE(WITH_EACCELERATOR_CRASH_DETECTION, 1, [Define if you like to release eAccelerator resources on PHP crash]) |
|---|
| 69 | fi |
|---|
| 70 | if test "$eaccelerator_optimizer" = "yes"; then |
|---|
| 71 | AC_DEFINE(WITH_EACCELERATOR_OPTIMIZER, 1, [Define if you like to use peephole opcode optimization]) |
|---|
| 72 | fi |
|---|
| 73 | if test "$eaccelerator_encoder" = "yes"; then |
|---|
| 74 | AC_DEFINE(WITH_EACCELERATOR_ENCODER, 1, [Define if you like to use eAccelerator enoder]) |
|---|
| 75 | fi |
|---|
| 76 | if test "$eaccelerator_loader" = "yes"; then |
|---|
| 77 | AC_DEFINE(WITH_EACCELERATOR_LOADER, 1, [Define if you like to load files encoded by eAccelerator encoder]) |
|---|
| 78 | fi |
|---|
| 79 | if test "$eaccelerator_sessions" = "yes"; then |
|---|
| 80 | AC_DEFINE(WITH_EACCELERATOR_SESSIONS, 1, [Define if you like to use eAccelerator session handlers to store session's information in shared memory]) |
|---|
| 81 | fi |
|---|
| 82 | if test "$eaccelerator_content_caching" = "yes"; then |
|---|
| 83 | AC_DEFINE(WITH_EACCELERATOR_CONTENT_CACHING, 1, [Define if you like to use eAccelerator content cachin API]) |
|---|
| 84 | fi |
|---|
| 85 | if test "$eaccelerator_disassembler" = "yes"; then |
|---|
| 86 | AC_DEFINE(WITH_EACCELERATOR_DISASSEMBLER, 1, [Define if you like to explore Zend bytecode]) |
|---|
| 87 | fi |
|---|
| 88 | if test "$eaccelerator_executor" = "yes"; then |
|---|
| 89 | AC_DEFINE(WITH_EACCELERATOR_EXECUTOR, 1, [Define if you like use optimized executor (not implemented yet)]) |
|---|
| 90 | fi |
|---|
| 91 | |
|---|
| 92 | AC_REQUIRE_CPP() |
|---|
| 93 | |
|---|
| 94 | AC_HAVE_HEADERS(unistd.h limits.h sys/param.h sched.h) |
|---|
| 95 | |
|---|
| 96 | AC_MSG_CHECKING(mandatory system headers) |
|---|
| 97 | AC_TRY_CPP([#include <stdio.h> |
|---|
| 98 | #include <stdlib.h> |
|---|
| 99 | #include <string.h> |
|---|
| 100 | #include <malloc.h> |
|---|
| 101 | #include <errno.h> |
|---|
| 102 | #include <fcntl.h> |
|---|
| 103 | #include <sys/stat.h> |
|---|
| 104 | #include <sys/types.h>],msg=yes,msg=no) |
|---|
| 105 | AC_MSG_RESULT([$msg]) |
|---|
| 106 | |
|---|
| 107 | AC_MSG_CHECKING(whether union semun is defined in sys/sem.h) |
|---|
| 108 | AC_TRY_COMPILE([ |
|---|
| 109 | #include <sys/types.h> |
|---|
| 110 | #include <sys/ipc.h> |
|---|
| 111 | #include <sys/sem.h> |
|---|
| 112 | ],[ |
|---|
| 113 | union semun arg; |
|---|
| 114 | semctl(0, 0, 0, arg); |
|---|
| 115 | ], |
|---|
| 116 | AC_DEFINE(HAVE_UNION_SEMUN, 1, [Define if you have semun union in sys/sem.h]) |
|---|
| 117 | msg=yes,msg=no) |
|---|
| 118 | AC_MSG_RESULT([$msg]) |
|---|
| 119 | |
|---|
| 120 | mm_shm_ipc=no |
|---|
| 121 | mm_shm_mmap_anon=no |
|---|
| 122 | mm_shm_mmap_zero=no |
|---|
| 123 | mm_shm_mmap_file=no |
|---|
| 124 | mm_shm_mmap_posix=no |
|---|
| 125 | |
|---|
| 126 | AC_MSG_CHECKING(for sysvipc shared memory support) |
|---|
| 127 | AC_TRY_RUN([#define MM_SEM_NONE |
|---|
| 128 | #define MM_SHM_IPC |
|---|
| 129 | #define MM_TEST_SHM |
|---|
| 130 | #include "mm.c" |
|---|
| 131 | ],dnl |
|---|
| 132 | mm_shm_ipc=yes |
|---|
| 133 | msg=yes,msg=no,msg=no) |
|---|
| 134 | AC_MSG_RESULT([$msg]) |
|---|
| 135 | |
|---|
| 136 | AC_MSG_CHECKING(for mmap shared memory support) |
|---|
| 137 | AC_TRY_RUN([#define MM_SEM_NONE |
|---|
| 138 | #define MM_SHM_MMAP_FILE |
|---|
| 139 | #define MM_TEST_SHM |
|---|
| 140 | #include "mm.c" |
|---|
| 141 | ],dnl |
|---|
| 142 | mm_shm_mmap_file=yes |
|---|
| 143 | msg=yes,msg=no,msg=no) |
|---|
| 144 | AC_MSG_RESULT([$msg]) |
|---|
| 145 | |
|---|
| 146 | AC_MSG_CHECKING(for mmap on /dev/zero shared memory support) |
|---|
| 147 | AC_TRY_RUN([#define MM_SEM_NONE |
|---|
| 148 | #define MM_SHM_MMAP_ZERO |
|---|
| 149 | #define MM_TEST_SHM |
|---|
| 150 | #include "mm.c" |
|---|
| 151 | ],dnl |
|---|
| 152 | mm_shm_mmap_zero=yes |
|---|
| 153 | msg=yes,msg=no,msg=no) |
|---|
| 154 | AC_MSG_RESULT([$msg]) |
|---|
| 155 | |
|---|
| 156 | AC_MSG_CHECKING(for anonymous mmap shared memory support) |
|---|
| 157 | AC_TRY_RUN([#define MM_SEM_NONE |
|---|
| 158 | #define MM_SHM_MMAP_ANON |
|---|
| 159 | #define MM_TEST_SHM |
|---|
| 160 | #include "mm.c" |
|---|
| 161 | ],dnl |
|---|
| 162 | mm_shm_mmap_anon=yes |
|---|
| 163 | msg=yes,msg=no,msg=no) |
|---|
| 164 | AC_MSG_RESULT([$msg]) |
|---|
| 165 | |
|---|
| 166 | AC_MSG_CHECKING(for posix mmap shared memory support) |
|---|
| 167 | AC_TRY_RUN([#define MM_SEM_NONE |
|---|
| 168 | #define MM_SHM_MMAP_POSIX |
|---|
| 169 | #define MM_TEST_SHM |
|---|
| 170 | #include "mm.c" |
|---|
| 171 | ],dnl |
|---|
| 172 | mm_shm_mmap_posix=yes |
|---|
| 173 | msg=yes,msg=no,msg=no) |
|---|
| 174 | AC_MSG_RESULT([$msg]) |
|---|
| 175 | |
|---|
| 176 | AC_MSG_CHECKING(for best shared memory type) |
|---|
| 177 | if test "$mm_shm_ipc" = "yes"; then |
|---|
| 178 | AC_DEFINE(MM_SHM_IPC, 1, [Define if you like to use sysvipc based shared memory]) |
|---|
| 179 | msg="sysvipc" |
|---|
| 180 | elif test "$mm_shm_mmap_anon" = "yes"; then |
|---|
| 181 | AC_DEFINE(MM_SHM_MMAP_ANON, 1, [Define if you like to use anonymous mmap based shared memory]) |
|---|
| 182 | msg="anonymous mmap" |
|---|
| 183 | elif test "$mm_shm_mmap_zero" = "yes"; then |
|---|
| 184 | AC_DEFINE(MM_SHM_MMAP_ZERO, 1, [Define if you like to use mmap on /dev/zero based shared memory]) |
|---|
| 185 | msg="mmap on /dev/zero" |
|---|
| 186 | elif test "$mm_shm_mmap_posix" = "yes"; then |
|---|
| 187 | AC_DEFINE(MM_SHM_MMAP_POSIX, 1, [Define if you like to use posix mmap based shared memory]) |
|---|
| 188 | msg="posix mmap" |
|---|
| 189 | elif test "$mm_shm_mmap_file" = "yes"; then |
|---|
| 190 | AC_DEFINE(MM_SHM_MMAP_FILE, 1, [Define if you like to use mmap on temporary file shared memory]) |
|---|
| 191 | msg="mmap" |
|---|
| 192 | fi |
|---|
| 193 | AC_MSG_RESULT([$msg]) |
|---|
| 194 | |
|---|
| 195 | AC_MSG_CHECKING(for spinlock semaphores support) |
|---|
| 196 | AC_TRY_RUN([#define MM_SEM_SPINLOCK |
|---|
| 197 | #define MM_TEST_SEM |
|---|
| 198 | #include "mm.c" |
|---|
| 199 | ],dnl |
|---|
| 200 | mm_sem_spinlock=yes |
|---|
| 201 | msg=yes,msg=no,msg=no) |
|---|
| 202 | AC_MSG_RESULT([$msg]) |
|---|
| 203 | |
|---|
| 204 | AC_MSG_CHECKING(for pthread semaphores support) |
|---|
| 205 | AC_TRY_RUN([#define MM_SEM_PTHREAD |
|---|
| 206 | #define MM_TEST_SEM |
|---|
| 207 | #include "mm.c" |
|---|
| 208 | ],dnl |
|---|
| 209 | mm_sem_pthread=yes |
|---|
| 210 | msg=yes,msg=no,msg=no) |
|---|
| 211 | AC_MSG_RESULT([$msg]) |
|---|
| 212 | |
|---|
| 213 | AC_MSG_CHECKING(for posix semaphores support) |
|---|
| 214 | AC_TRY_RUN([#define MM_SEM_POSIX |
|---|
| 215 | #define MM_TEST_SEM |
|---|
| 216 | #include "mm.c" |
|---|
| 217 | ],dnl |
|---|
| 218 | mm_sem_posix=yes |
|---|
| 219 | msg=yes,msg=no,msg=no) |
|---|
| 220 | AC_MSG_RESULT([$msg]) |
|---|
| 221 | |
|---|
| 222 | AC_MSG_CHECKING(for sysvipc semaphores support) |
|---|
| 223 | AC_TRY_RUN([#define MM_SEM_IPC |
|---|
| 224 | #define MM_TEST_SEM |
|---|
| 225 | #include "mm.c" |
|---|
| 226 | ],dnl |
|---|
| 227 | mm_sem_ipc=yes |
|---|
| 228 | msg=yes,msg=no,msg=no) |
|---|
| 229 | AC_MSG_RESULT([$msg]) |
|---|
| 230 | |
|---|
| 231 | AC_MSG_CHECKING(for fcntl semaphores support) |
|---|
| 232 | AC_TRY_RUN([#define MM_SEM_FCNTL |
|---|
| 233 | #define MM_TEST_SEM |
|---|
| 234 | #include "mm.c" |
|---|
| 235 | ],dnl |
|---|
| 236 | mm_sem_fcntl=yes |
|---|
| 237 | msg=yes,msg=no,msg=no) |
|---|
| 238 | AC_MSG_RESULT([$msg]) |
|---|
| 239 | |
|---|
| 240 | AC_MSG_CHECKING(for flock semaphores support) |
|---|
| 241 | AC_TRY_RUN([#define MM_SEM_FLOCK |
|---|
| 242 | #define MM_TEST_SEM |
|---|
| 243 | #include "mm.c" |
|---|
| 244 | ],dnl |
|---|
| 245 | mm_sem_flock=yes |
|---|
| 246 | msg=yes,msg=no,msg=no) |
|---|
| 247 | AC_MSG_RESULT([$msg]) |
|---|
| 248 | |
|---|
| 249 | AC_MSG_CHECKING(for best semaphores type) |
|---|
| 250 | if test "$mm_sem_spinlock" = "yes"; then |
|---|
| 251 | AC_DEFINE(MM_SEM_SPINLOCK, 1, [Define if you like to use spinlock based semaphores]) |
|---|
| 252 | msg="spinlock" |
|---|
| 253 | elif test "$mm_sem_ipc" = "yes"; then |
|---|
| 254 | AC_DEFINE(MM_SEM_IPC, 1, [Define if you like to use sysvipc based semaphores]) |
|---|
| 255 | msg="sysvipc" |
|---|
| 256 | elif test "$mm_sem_fcntl" = "yes"; then |
|---|
| 257 | AC_DEFINE(MM_SEM_FCNTL, 1, [Define if you like to use fcntl based semaphores]) |
|---|
| 258 | msg="fcntl" |
|---|
| 259 | elif test "$mm_sem_flock" = "yes"; then |
|---|
| 260 | AC_DEFINE(MM_SEM_FLOCK, 1, [Define if you like to use flock based semaphores]) |
|---|
| 261 | msg="flock" |
|---|
| 262 | elif test "$mm_sem_pthread" = "yes"; then |
|---|
| 263 | AC_DEFINE(MM_SEM_PTHREAD, 1, [Define if you like to use pthread based semaphores]) |
|---|
| 264 | msg="pthread" |
|---|
| 265 | elif test "$mm_sem_posix" = "yes"; then |
|---|
| 266 | AC_DEFINE(MM_SEM_POSIX, 1, [Define if you like to use posix based semaphores]) |
|---|
| 267 | msg="posix" |
|---|
| 268 | fi |
|---|
| 269 | AC_MSG_RESULT([$msg]) |
|---|
| 270 | |
|---|
| 271 | AC_CHECK_FUNC(sched_yield,[ |
|---|
| 272 | AC_DEFINE(HAVE_SCHED_YIELD, 1, [Define if ou have sched_yield function]) |
|---|
| 273 | ]) |
|---|
| 274 | |
|---|
| 275 | AC_CHECK_FUNC(mprotect,[ |
|---|
| 276 | AC_DEFINE(HAVE_MPROTECT, 1, [Define if ou have mprotect function]) |
|---|
| 277 | ]) |
|---|
| 278 | |
|---|
| 279 | old_cppflags="$CPPFLAGS" |
|---|
| 280 | CPPFLAGS="$CPPFLAGS $INCLUDES" |
|---|
| 281 | AC_MSG_CHECKING(for ext/session/php_session.h) |
|---|
| 282 | AC_TRY_CPP([#include "ext/session/php_session.h"],msg="yes",msg="no") |
|---|
| 283 | if test "$msg" = "yes"; then |
|---|
| 284 | AC_DEFINE(HAVE_EXT_SESSION_PHP_SESSION_H, 1, [Define if you have the <ext/session/php_session.h> header file.]) |
|---|
| 285 | fi |
|---|
| 286 | AC_MSG_RESULT([$msg]) |
|---|
| 287 | CPPFLAGS="$old_cppflags" |
|---|
| 288 | |
|---|
| 289 | fi |
|---|