All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4,4/4] php: add apache support
Date: Mon, 12 Sep 2016 00:26:08 +0200	[thread overview]
Message-ID: <1473632768-53238-4-git-send-email-fabrice.fontaine@orange.com> (raw)
In-Reply-To: <1473632768-53238-1-git-send-email-fabrice.fontaine@orange.com>

Continue work started by Bernd Kuhls in
https://patchwork.ozlabs.org/patch/437544/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
---
Changes v3 -> v4 (after review of Yann Morin):
 - Do not select apache but depends on it
 - Move pthread detection fix in a separate patch
 - Remove unneeded configuration options such as --with-config-file-path
 - Do not allow php to update apache configuration file by removing -a
   argument from apxs call

Changes v2 -> v3 (after review of Thomas Petazzoni):
 - Remove unneeded php-04-apache.patch
 - Fix pthread detection if Apache MPM is event or worker
 - Update pthread detection mechanism (--enable-pthreads does not exist
   anymore)
 - Remove unneeded --oldincludedir
 - Fix php module path

 package/php/Config.in |  7 +++++++
 package/php/php.mk    | 22 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/package/php/Config.in b/package/php/Config.in
index c90ad4f..e195fd4 100644
--- a/package/php/Config.in
+++ b/package/php/Config.in
@@ -14,6 +14,13 @@ if BR2_PACKAGE_PHP
 config BR2_PACKAGE_PHP_HAS_SAPI
 	bool
 
+config BR2_PACKAGE_PHP_SAPI_APACHE
+	bool "Apache"
+	depends on BR2_PACKAGE_APACHE
+	select BR2_PACKAGE_PHP_HAS_SAPI
+	help
+	  Apache module
+
 config BR2_PACKAGE_PHP_SAPI_CGI
 	bool "CGI"
 	# CGI uses fork()
diff --git a/package/php/php.mk b/package/php/php.mk
index c4ff249..7abd012 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -95,6 +95,28 @@ PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CLI),,--disable-cli)
 PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CGI),,--disable-cgi)
 PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_FPM),--enable-fpm,--disable-fpm)
 
+ifeq ($(BR2_PACKAGE_PHP_SAPI_APACHE),y)
+PHP_DEPENDENCIES += apache
+PHP_CONF_OPTS += --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
+
+# Enable thread safety option if Apache MPM is event or worker
+ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT)$(BR2_PACKAGE_APACHE_MPM_WORKER),y)
+PHP_CONF_OPTS += --enable-maintainer-zts
+endif
+
+# php uses apxs from staging directory to install libphp dynamic library and
+# update /etc/apache2/httpd.conf through the -a option, here is the full
+# command line: "apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/modules'
+# -S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php7
+# This does not work as apxs sets the full path of the library and not the
+# relative one so remove -a option from apxs call
+define PHP_REMOVE_APXS_UPDATE_CONF
+	$(SED) 's/-i -a -n php/-i -n php/' $(@D)/configure
+endef
+
+PHP_PRE_CONFIGURE_HOOKS += PHP_REMOVE_APXS_UPDATE_CONF
+endif
+
 ### Extensions
 PHP_CONF_OPTS += \
 	$(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \
-- 
2.5.0

  parent reply	other threads:[~2016-09-11 22:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11 22:26 [Buildroot] [PATCH v2,1/4] apache: add customization of MPM Fabrice Fontaine
2016-09-11 22:26 ` [Buildroot] [PATCH 2/4] php: rework selection of interfaces Fabrice Fontaine
2016-09-11 22:55   ` Arnout Vandecappelle
2016-09-11 22:26 ` [Buildroot] [PATCH 3/4] php: fix pthread detection Fabrice Fontaine
2016-09-11 23:21   ` Arnout Vandecappelle
2016-09-11 22:26 ` Fabrice Fontaine [this message]
2016-09-11 23:30   ` [Buildroot] [PATCH v4,4/4] php: add apache support Arnout Vandecappelle
2016-09-13 21:13     ` Fabrice Fontaine
2016-09-14  0:03       ` Arnout Vandecappelle
2016-09-11 22:39 ` [Buildroot] [PATCH v2,1/4] apache: add customization of MPM Arnout Vandecappelle
2016-09-12 21:15 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473632768-53238-4-git-send-email-fabrice.fontaine@orange.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.