@@ -41,6 +41,13 @@ config BR2_PACKAGE_PHP_SAPI_FPM
help
PHP-FPM (FastCGI Process Manager)
+config BR2_PACKAGE_PHP_ENABLE_EMBED
+ bool "SAPI API library"
+ help
+ Enable building of embedded SAPI library. The name of the
+ library on the target is libphp7.so and is approximately
+ 3.5MB in size.
+
source "package/php/Config.ext"
endif
@@ -82,6 +82,14 @@ PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CLI),--enable-cli,--disable-cli)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CGI),--enable-cgi,--disable-cgi)
PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_FPM),--enable-fpm,--disable-fpm)
+ifeq ($(BR2_PACKAGE_PHP_ENABLE_EMBED),y)
+ifeq ($(BR2_STATIC_LIBS),)
+PHP_CONF_OPTS += --enable-embed=shared
+else
+PHP_CONF_OPTS += --enable-embed=static
+endif
+endif
+
ifeq ($(BR2_PACKAGE_PHP_SAPI_APACHE),y)
PHP_DEPENDENCIES += apache
PHP_CONF_OPTS += --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
This option forces PHP to build libphp7.so. The size of the library is around 3.5MB, which is why this is a configuration option and not something that is enabled or disabled automatically. Signed-off-by: Adam Duskett <aduskett@gmail.com> --- Changes v1 -> v2: - Changed BR2_PACKAGE_PHP_EMBED_SAPI to BR2_PACKAGE_PHP_ENABLE_EMBED to reflect the configure option name change in PHP 7.2. - Updated approximate library size from 4MB to 3.5MB. - Changed --embed-sapi to --enable-embed to reflect the configure option name change in PHP 7.2. - Added a check for static libs as the SAPI API library can be built either static or shared. - Updated wording in the help section of Config.in package/php/Config.in | 7 +++++++ package/php/php.mk | 8 ++++++++ 2 files changed, 15 insertions(+)