From e05476491720f96fcbeb926b4599d111efb598a6 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Wed, 8 Apr 2015 12:39:29 -0300 Subject: php: add opcache option Add a Zend OPcache option and tweak the build system into being cross-compile friendly. The OPcache extension allows for a neat intermediate bytecode cache in memory to avoid reinterpreting/recompiling php scripts on multiple runs. Make it an option since this takes up valuable RAM. Signed-off-by: Gustavo Zacarias Signed-off-by: Thomas Petazzoni --- package/php/php.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'package/php/php.mk') diff --git a/package/php/php.mk b/package/php/php.mk index 12f8eaa12a..eb4f79749f 100644 --- a/package/php/php.mk +++ b/package/php/php.mk @@ -38,6 +38,19 @@ PHP_CONFIG_SCRIPTS = php-config PHP_CFLAGS = $(TARGET_CFLAGS) +# The OPcache extension isn't cross-compile friendly +# Throw some defines here to avoid patching heavily +ifeq ($(BR2_PACKAGE_PHP_EXT_OPCACHE),y) +PHP_CONF_OPTS += --enable-opcache +PHP_CONF_ENV += ac_cv_func_mprotect=yes +PHP_CFLAGS += \ + -DHAVE_SHM_IPC \ + -DHAVE_SHM_MMAP_ANON \ + -DHAVE_SHM_MMAP_ZERO \ + -DHAVE_SHM_MMAP_POSIX \ + -DHAVE_SHM_MMAP_FILE +endif + # We need to force dl "detection" ifeq ($(BR2_STATIC_LIBS),) PHP_CONF_ENV += ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes -- cgit v1.2.3