php-src/ext/opcache/config.m4

419 lines
8.7 KiB
Plaintext
Raw Normal View History

2013-02-13 12:26:47 +00:00
dnl
dnl $Id$
dnl
PHP_ARG_ENABLE(opcache, whether to enable Zend OPcache support,
2015-02-05 09:07:30 +00:00
[ --disable-opcache Disable Zend OPcache support], yes)
2013-02-13 12:26:47 +00:00
PHP_ARG_ENABLE(opcache-file, whether to enable file based caching,
[ --disable-opcache-file Disable file based caching], yes, no)
PHP_ARG_ENABLE(huge-code-pages, whether to enable copying PHP CODE pages into HUGE PAGES,
[ --disable-huge-code-pages
Disable copying PHP CODE pages into HUGE PAGES], yes, no)
if test "$PHP_OPCACHE" != "no"; then
2013-02-13 12:26:47 +00:00
if test "$PHP_OPCACHE_FILE" = "yes"; then
AC_DEFINE(HAVE_OPCACHE_FILE_CACHE, 1, [Define to enable file based caching (experimental)])
fi
if test "$PHP_HUGE_CODE_PAGES" = "yes"; then
AC_DEFINE(HAVE_HUGE_CODE_PAGES, 1, [Define to enable copying PHP CODE pages into HUGE PAGES (experimental)])
fi
2013-02-13 12:26:47 +00:00
AC_CHECK_FUNC(mprotect,[
AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
])
AC_CHECK_HEADERS([unistd.h sys/uio.h])
2013-02-13 12:26:47 +00:00
AC_MSG_CHECKING(for sysvipc shared memory support)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
#include <string.h>
int main() {
pid_t pid;
int status;
int ipc_id;
char *shm;
struct shmid_ds shmbuf;
ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W));
if (ipc_id == -1) {
return 1;
}
shm = shmat(ipc_id, NULL, 0);
if (shm == (void *)-1) {
shmctl(ipc_id, IPC_RMID, NULL);
return 2;
}
if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) {
shmdt(shm);
shmctl(ipc_id, IPC_RMID, NULL);
return 3;
}
shmbuf.shm_perm.uid = getuid();
shmbuf.shm_perm.gid = getgid();
shmbuf.shm_perm.mode = 0600;
if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) {
shmdt(shm);
shmctl(ipc_id, IPC_RMID, NULL);
return 4;
}
shmctl(ipc_id, IPC_RMID, NULL);
strcpy(shm, "hello");
pid = fork();
if (pid < 0) {
return 5;
} else if (pid == 0) {
strcpy(shm, "bye");
return 6;
}
if (wait(&status) != pid) {
return 7;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
return 8;
}
if (strcmp(shm, "bye") != 0) {
return 9;
}
return 0;
}
],dnl
AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <unistd.h>
#include <string.h>
#ifndef MAP_ANON
# ifdef MAP_ANONYMOUS
# define MAP_ANON MAP_ANONYMOUS
# endif
#endif
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
int main() {
pid_t pid;
int status;
char *shm;
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
if (shm == MAP_FAILED) {
return 1;
}
strcpy(shm, "hello");
pid = fork();
if (pid < 0) {
return 5;
} else if (pid == 0) {
strcpy(shm, "bye");
return 6;
}
if (wait(&status) != pid) {
return 7;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
return 8;
}
if (strcmp(shm, "bye") != 0) {
return 9;
}
return 0;
}
],dnl
AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
int main() {
pid_t pid;
int status;
int fd;
char *shm;
fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1) {
return 1;
}
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (shm == MAP_FAILED) {
return 2;
}
strcpy(shm, "hello");
pid = fork();
if (pid < 0) {
return 5;
} else if (pid == 0) {
strcpy(shm, "bye");
return 6;
}
if (wait(&status) != pid) {
return 7;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
return 8;
}
if (strcmp(shm, "bye") != 0) {
return 9;
}
return 0;
}
],dnl
AC_DEFINE(HAVE_SHM_MMAP_ZERO, 1, [Define if you have mmap("/dev/zero") SHM support])
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
int main() {
pid_t pid;
int status;
int fd;
char *shm;
char tmpname[4096];
sprintf(tmpname,"test.shm.%dXXXXXX", getpid());
if (mktemp(tmpname) == NULL) {
return 1;
}
fd = shm_open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd == -1) {
return 2;
}
if (ftruncate(fd, 4096) < 0) {
close(fd);
shm_unlink(tmpname);
return 3;
}
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (shm == MAP_FAILED) {
return 4;
}
shm_unlink(tmpname);
close(fd);
strcpy(shm, "hello");
pid = fork();
if (pid < 0) {
return 5;
} else if (pid == 0) {
strcpy(shm, "bye");
return 6;
}
if (wait(&status) != pid) {
return 7;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
return 8;
}
if (strcmp(shm, "bye") != 0) {
return 9;
}
return 0;
}
],dnl
AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
AC_MSG_CHECKING(for mmap() using regular file shared memory support)
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef MAP_FAILED
# define MAP_FAILED ((void*)-1)
#endif
int main() {
pid_t pid;
int status;
int fd;
char *shm;
char tmpname[4096];
sprintf(tmpname,"test.shm.%dXXXXXX", getpid());
if (mktemp(tmpname) == NULL) {
return 1;
}
fd = open(tmpname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd == -1) {
return 2;
}
if (ftruncate(fd, 4096) < 0) {
close(fd);
unlink(tmpname);
return 3;
}
shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (shm == MAP_FAILED) {
return 4;
}
unlink(tmpname);
close(fd);
strcpy(shm, "hello");
pid = fork();
if (pid < 0) {
return 5;
} else if (pid == 0) {
strcpy(shm, "bye");
return 6;
}
if (wait(&status) != pid) {
return 7;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
return 8;
}
if (strcmp(shm, "bye") != 0) {
return 9;
}
return 0;
}
],dnl
AC_DEFINE(HAVE_SHM_MMAP_FILE, 1, [Define if you have mmap() SHM support])
msg=yes,msg=no,msg=no)
AC_MSG_RESULT([$msg])
flock_type=unknown
AC_MSG_CHECKING("whether flock struct is linux ordered")
AC_TRY_RUN([
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
return 0;
}
return 1;
}
], [
flock_type=linux
AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
AC_MSG_RESULT("yes")
], AC_MSG_RESULT("no") )
AC_MSG_CHECKING("whether flock struct is BSD ordered")
AC_TRY_RUN([
#include <fcntl.h>
struct flock lock = { 1, 2, 3, 4, 5 };
int main() {
if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
return 0;
}
return 1;
}
], [
flock_type=bsd
AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
AC_MSG_RESULT("yes")
], AC_MSG_RESULT("no") )
if test "$flock_type" = "unknown"; then
AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
fi
PHP_NEW_EXTENSION(opcache,
2013-02-13 12:26:47 +00:00
ZendAccelerator.c \
zend_accelerator_blacklist.c \
zend_accelerator_debug.c \
zend_accelerator_hash.c \
zend_accelerator_module.c \
zend_persist.c \
zend_persist_calc.c \
zend_file_cache.c \
2013-02-13 12:26:47 +00:00
zend_shared_alloc.c \
zend_accelerator_util_funcs.c \
shared_alloc_shm.c \
shared_alloc_mmap.c \
shared_alloc_posix.c \
Optimizer/zend_optimizer.c \
Optimizer/pass1_5.c \
Optimizer/pass2.c \
Optimizer/pass3.c \
Optimizer/optimize_func_calls.c \
Optimizer/block_pass.c \
Optimizer/optimize_temp_vars_5.c \
Optimizer/nop_removal.c \
Refactored CFG based optimization using new CFG representation. Squashed commit of the following: commit 907533390678f58eac738040ef62a40788048bef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 21:25:28 2015 +0300 cleanup commit 82f7e6f5bb434f12e9fdf45f597be351527f383c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 21:22:01 2015 +0300 Update build system commit 8fd83d843fde3f486692de4e2c6b7d64d4192704 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 20:50:32 2015 +0300 Reachable blocks can't be empty commit 5822a36269833930a35cb3547222357118b11310 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 19:11:02 2015 +0300 added missing constraints commit 2d0c00b243479924de0260ae8d80d624c36994a3 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 19:03:12 2015 +0300 optimization commit 29d1e5eb210c51b052cac4d6c232aaa2c724dbbb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 18:34:11 2015 +0300 Added missing optimization patterns commit 38dd3b3f2459f5193c742633213f41d78326ea28 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 17:47:06 2015 +0300 zend_optimize_block() refactoring commit 3dc97bd1f6d433dff0617338382347b6d0c08f84 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 14:30:32 2015 +0300 We don't use CFG back-references anymore commit 2242c9e0aa741d287146ad43179650796f199f2d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 14:16:03 2015 +0300 Consistent naming commit 64f2856716069390ed7703ac88905cebf5e04023 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 13:29:32 2015 +0300 Optimization and separate building of direct CFG from predecessrs calculation commit 9389be4869b13ec45df5dbd443015d2ac539a347 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 10:44:19 2015 +0300 Use CFG without back references (incomplete, but works) commit 3d3ecd4b883959cf7b86c33622183295f913924e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 00:50:09 2015 +0300 Fixed iteration in reverse order commit 52f7fde0c3dfa4b4591519828ebdb238c2377936 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 18:35:09 2015 +0300 Separate debugging code into zend_dump.c commit 4193a039ea96bae41baf97c6e458f419e8dbf9c5 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 17:22:04 2015 +0300 Remove unused code commit 4228fdc57d8d120e1dad4e4d44045fa1a6f06fe0 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 17:21:20 2015 +0300 Remove dead live-ranges only on assembling basic blocks commit 9a4a7966edf19b92678876f85565700694205598 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 15:26:29 2015 +0300 New CFG representation (incomplete)
2015-11-20 19:06:36 +00:00
Optimizer/compact_literals.c \
Optimizer/zend_cfg.c \
Optimizer/zend_dfg.c \
Optimizer/dfa_pass.c \
Optimizer/zend_ssa.c \
Optimizer/zend_inference.c \
Optimizer/zend_func_info.c \
Optimizer/zend_call_graph.c \
Refactored CFG based optimization using new CFG representation. Squashed commit of the following: commit 907533390678f58eac738040ef62a40788048bef Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 21:25:28 2015 +0300 cleanup commit 82f7e6f5bb434f12e9fdf45f597be351527f383c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 21:22:01 2015 +0300 Update build system commit 8fd83d843fde3f486692de4e2c6b7d64d4192704 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 20:50:32 2015 +0300 Reachable blocks can't be empty commit 5822a36269833930a35cb3547222357118b11310 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 19:11:02 2015 +0300 added missing constraints commit 2d0c00b243479924de0260ae8d80d624c36994a3 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 19:03:12 2015 +0300 optimization commit 29d1e5eb210c51b052cac4d6c232aaa2c724dbbb Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 18:34:11 2015 +0300 Added missing optimization patterns commit 38dd3b3f2459f5193c742633213f41d78326ea28 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 17:47:06 2015 +0300 zend_optimize_block() refactoring commit 3dc97bd1f6d433dff0617338382347b6d0c08f84 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 14:30:32 2015 +0300 We don't use CFG back-references anymore commit 2242c9e0aa741d287146ad43179650796f199f2d Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 14:16:03 2015 +0300 Consistent naming commit 64f2856716069390ed7703ac88905cebf5e04023 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 13:29:32 2015 +0300 Optimization and separate building of direct CFG from predecessrs calculation commit 9389be4869b13ec45df5dbd443015d2ac539a347 Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 10:44:19 2015 +0300 Use CFG without back references (incomplete, but works) commit 3d3ecd4b883959cf7b86c33622183295f913924e Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 20 00:50:09 2015 +0300 Fixed iteration in reverse order commit 52f7fde0c3dfa4b4591519828ebdb238c2377936 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 18:35:09 2015 +0300 Separate debugging code into zend_dump.c commit 4193a039ea96bae41baf97c6e458f419e8dbf9c5 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 17:22:04 2015 +0300 Remove unused code commit 4228fdc57d8d120e1dad4e4d44045fa1a6f06fe0 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 17:21:20 2015 +0300 Remove dead live-ranges only on assembling basic blocks commit 9a4a7966edf19b92678876f85565700694205598 Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 19 15:26:29 2015 +0300 New CFG representation (incomplete)
2015-11-20 19:06:36 +00:00
Optimizer/zend_dump.c,
shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
2015-03-05 00:27:36 +00:00
PHP_ADD_EXTENSION_DEP(opcache, pcre)
2013-02-13 12:26:47 +00:00
fi