package/php: add FFI extension support
authorTom Marcuzzi <tom.marcuzzi@orolia.com>
Tue, 28 Jul 2020 16:31:25 +0000 (18:31 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 5 Aug 2020 21:02:54 +0000 (23:02 +0200)
Signed-off-by: Tom Marcuzzi <tom.marcuzzi@orolia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/php/Config.ext
package/php/php.mk

index b0ab2c9ec75dbcfacce5c61b5e3faf116daf5085..b628291f7895c5c36245d2f1467fda10b082d6d3 100644 (file)
@@ -427,4 +427,14 @@ config BR2_PACKAGE_PHP_EXT_XSL
        help
          XSL transformation support
 
+config BR2_PACKAGE_PHP_EXT_FFI
+       bool "FFI"
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       select BR2_PACKAGE_LIBFFI
+       help
+         Foreign Function Interface support
+
+comment "PHP FFI extension needs a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
+
 endmenu
index 48af0f6fdcf9ecc7e4b424a02f04ebbaf17fe477..1296c50c6d4e648d9453dd5da76dd5f766ae2787 100644 (file)
@@ -333,6 +333,11 @@ PHP_CONF_OPTS += \
 PHP_DEPENDENCIES += jpeg libpng freetype zlib
 endif
 
+ifeq ($(BR2_PACKAGE_PHP_EXT_FFI),y)
+PHP_CONF_OPTS += --with-ffi
+PHP_DEPENDENCIES += libffi
+endif
+
 ifeq ($(BR2_PACKAGE_PHP_SAPI_FPM),y)
 define PHP_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \