]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
php: rework selection of interfaces
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 12 Sep 2016 21:31:07 +0000 (23:31 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 24 Oct 2016 12:46:43 +0000 (14:46 +0200)
Following suggestion of Yann Morin, rework selection of php
interfaces: use booleans instead of choice to be able to select
multiple interfaces as they are not exclusive. We make sure at least
one of the options is selected.

It should be noted that previously CGI and FPM could not be selected
at the same time. This is now possible. Bug that prevented compilation
of CGI and FPM binaries at the same time has been fixed since PHP 5.4
(https://github.com/php-build/php-build/issues/101).

Legacy handling is added for the two options that are removed, and the
appropriate new options are selected.

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Config.in.legacy
package/php/Config.in
package/php/php.mk

index f26f97f224672e6d6b702d2667a1454592ca1741..50ccedd0560176eca1118ed7e92e49e717aeacb2 100644 (file)
@@ -145,6 +145,22 @@ endif
 ###############################################################################
 comment "Legacy options removed in 2016.11"
 
+config BR2_PACKAGE_PHP_SAPI_CLI_CGI
+       bool "PHP CGI and CLI options are now seperate"
+       select BR2_PACKAGE_PHP_SAPI_CLI
+       select BR2_PACKAGE_PHP_SAPI_CGI
+       help
+         The PHP Interface options have been split up into a
+         separate option for each interface.
+
+config BR2_PACKAGE_PHP_SAPI_CLI_FPM
+       bool "PHP CLI and FPM options are now separate"
+       select BR2_PACKAGE_PHP_SAPI_CLI
+       select BR2_PACKAGE_PHP_SAPI_FPM
+       help
+         The PHP Interface options have been split up into a
+         separate option for each interface.
+
 config BR2_PACKAGE_WVSTREAMS
        bool "wvstreams removed"
        select BR2_LEGACY
index eee8d264d61086e65ca09421162bd45cb8f5127c..2e9e344339b5289dfcbff7ebf0955625dc515b38 100644 (file)
@@ -1,5 +1,8 @@
 config BR2_PACKAGE_PHP
        bool "php"
+       select BR2_PACKAGE_PHP_SAPI_CGI if \
+              !BR2_PACKAGE_PHP_SAPI_CLI && \
+              !BR2_PACKAGE_PHP_SAPI_FPM
        help
          PHP  is a widely-used general-purpose scripting
          language that is especially suited for Web development
@@ -9,61 +12,24 @@ config BR2_PACKAGE_PHP
 
 if BR2_PACKAGE_PHP
 
-config BR2_PACKAGE_PHP_CLI
-       bool
-
-config BR2_PACKAGE_PHP_CGI
-       bool
-
-config BR2_PACKAGE_PHP_FPM
-       bool
-
-choice
-       prompt "Interface"
-       default BR2_PACKAGE_PHP_SAPI_CGI
-       help
-         Select the PHP interface(s).
-
 config BR2_PACKAGE_PHP_SAPI_CGI
-       bool "CGI"
+       bool "CGI interface"
        # CGI uses fork()
        depends on BR2_USE_MMU
-       select BR2_PACKAGE_PHP_CGI
        help
          Common Gateway Interface
 
 config BR2_PACKAGE_PHP_SAPI_CLI
-       bool "CLI"
-       select BR2_PACKAGE_PHP_CLI
+       bool "CLI interface"
        help
          Command Line Interface
 
 config BR2_PACKAGE_PHP_SAPI_FPM
-       bool "FPM"
+       bool "FPM interface"
        depends on BR2_USE_MMU
-       select BR2_PACKAGE_PHP_FPM
        help
          PHP-FPM (FastCGI Process Manager)
 
-config BR2_PACKAGE_PHP_SAPI_CLI_CGI
-       bool "CGI and CLI"
-       # CGI uses fork()
-       depends on BR2_USE_MMU
-       select BR2_PACKAGE_PHP_CLI
-       select BR2_PACKAGE_PHP_CGI
-       help
-         Command line and Common gateway interfaces
-
-config BR2_PACKAGE_PHP_SAPI_CLI_FPM
-       bool "FPM and CLI"
-       depends on BR2_USE_MMU
-       select BR2_PACKAGE_PHP_CLI
-       select BR2_PACKAGE_PHP_FPM
-       help
-         Command line and PHP-FPM (FastCGI Process Manager)
-
-endchoice
-
 source "package/php/Config.ext"
 
 endif
index f925ec1eba3bbd9094a65873e55afe5075fd6cb1..f85cb371c22e3c0540b58165da9492f2c67f962b 100644 (file)
@@ -77,9 +77,9 @@ else
 PHP_CONF_ENV += ac_cv_func_dlopen=no ac_cv_lib_dl_dlopen=no
 endif
 
-PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_CLI),,--disable-cli)
-PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)
-PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm,--disable-fpm)
+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)
 
 ### Extensions
 PHP_CONF_OPTS += \
@@ -285,7 +285,7 @@ PHP_CONF_OPTS += \
 PHP_DEPENDENCIES += jpeg libpng freetype
 endif
 
-ifeq ($(BR2_PACKAGE_PHP_FPM),y)
+ifeq ($(BR2_PACKAGE_PHP_SAPI_FPM),y)
 define PHP_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \
                $(TARGET_DIR)/etc/init.d/S49php-fpm