summaryrefslogtreecommitdiffstats
path: root/package/php/php.mk
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2015-04-08 12:39:29 -0300
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-04-08 21:24:46 +0200
commite05476491720f96fcbeb926b4599d111efb598a6 (patch)
tree9379994eb5587c3b779f8e58d6a66f3526acc5d8 /package/php/php.mk
parent4959dabe7dfbe851e1848ff783f1b37a9fb0c0f2 (diff)
downloadbuildroot-e05476491720f96fcbeb926b4599d111efb598a6.tar.gz
buildroot-e05476491720f96fcbeb926b4599d111efb598a6.zip
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 <gustavo@zacarias.com.ar> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/php/php.mk')
-rw-r--r--package/php/php.mk13
1 files changed, 13 insertions, 0 deletions
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
OpenPOWER on IntegriCloud