From patchwork Sat Feb 7 10:41:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Kuhls X-Patchwork-Id: 437544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 9E54514017B for ; Sat, 7 Feb 2015 21:41:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EC11594C95; Sat, 7 Feb 2015 10:41:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u8vPRGtH07Xb; Sat, 7 Feb 2015 10:41:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1671694C6C; Sat, 7 Feb 2015 10:41:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 852031C231F for ; Sat, 7 Feb 2015 10:41:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7F1F48BDC6 for ; Sat, 7 Feb 2015 10:41:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0hFuuxYYIFQi for ; Sat, 7 Feb 2015 10:41:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout08.t-online.de (mailout08.t-online.de [194.25.134.20]) by whitealder.osuosl.org (Postfix) with ESMTPS id A17828BD2B for ; Sat, 7 Feb 2015 10:41:15 +0000 (UTC) Received: from fwd40.aul.t-online.de (fwd40.aul.t-online.de [172.20.26.139]) by mailout08.t-online.de (Postfix) with SMTP id 52B18DE8D0 for ; Sat, 7 Feb 2015 11:41:13 +0100 (CET) Received: from fli4l.lan.fli4l (rIX0diZYohxe9xXWWkU6ZyPJBkVbOVRjNLfeiRHobv6xDYue8V66BbfkIIApOxNgGf@[79.247.187.244]) by fwd40.t-online.de with (TLSv1:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1YK2p4-3NGle40; Sat, 7 Feb 2015 11:41:10 +0100 Received: from fli4lbuild64.lan.fli4l ([192.168.1.51]:38959) by fli4l.lan.fli4l with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85) (envelope-from ) id 1YK2p3-00013u-9M; Sat, 07 Feb 2015 11:41:10 +0100 From: Bernd Kuhls To: buildroot@buildroot.org Date: Sat, 7 Feb 2015 11:41:04 +0100 Message-Id: <1423305664-29877-2-git-send-email-bernd.kuhls@t-online.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423305664-29877-1-git-send-email-bernd.kuhls@t-online.de> References: <1423305664-29877-1-git-send-email-bernd.kuhls@t-online.de> X-ID: rIX0diZYohxe9xXWWkU6ZyPJBkVbOVRjNLfeiRHobv6xDYue8V66BbfkIIApOxNgGf X-TOI-MSGID: a4e9c60f-6d38-4328-9c14-b185ae5b365d Cc: Bernd Kuhls Subject: [Buildroot] [PATCH v2 2/2] package/php: Add Apache support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Bernd Kuhls --- v2: - rebased package/php/Config.in | 17 +++++++++++ package/php/php-04-apache.patch | 63 +++++++++++++++++++++++++++++++++++++++ package/php/php.mk | 19 ++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 package/php/php-04-apache.patch diff --git a/package/php/Config.in b/package/php/Config.in index 32faa32..f254213 100644 --- a/package/php/Config.in +++ b/package/php/Config.in @@ -11,6 +11,9 @@ if BR2_PACKAGE_PHP source "package/php/Config.ext" +config BR2_PACKAGE_PHP_APACHE + bool + config BR2_PACKAGE_PHP_CLI bool @@ -26,6 +29,20 @@ choice help Select the PHP interface(s). +config BR2_PACKAGE_PHP_SAPI_APACHE + bool "Apache" + select BR2_PACKAGE_APACHE + select BR2_PACKAGE_PHP_APACHE + depends on !BR2_STATIC_LIBS # apache + depends on BR2_TOOLCHAIN_HAS_THREADS # apache + depends on BR2_USE_MMU # apr + help + Apache module + +comment "apache module needs a toolchain w/ dynamic library, threads" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS + config BR2_PACKAGE_PHP_SAPI_CGI bool "CGI" # CGI uses fork() diff --git a/package/php/php-04-apache.patch b/package/php/php-04-apache.patch new file mode 100644 index 0000000..aa0dc16 --- /dev/null +++ b/package/php/php-04-apache.patch @@ -0,0 +1,63 @@ +Fix cross-compilation when used as Apache module. + +Avoid calling the Apache httpd target binary to check for its presence. + +Signed-off-by: Bernd Kuhls + +diff -uNr php-5.5.17.org/configure php-5.5.17/configure +--- php-5.5.17.org/configure 2014-09-16 14:53:57.000000000 +0200 ++++ php-5.5.17/configure 2014-10-05 15:06:12.162625672 +0200 +@@ -6342,7 +6342,7 @@ + + # Test that we're trying to configure with apache 1.x + +- ac_output=`$APXS_HTTPD -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` ++ ac_output='Server version: Apache/2.4.10 (Unix)' + ac_IFS=$IFS + IFS="- /. + " +@@ -7626,7 +7626,7 @@ + + # Test that we're trying to configure with apache 2.x + +- ac_output=`$APXS_HTTPD -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` ++ ac_output='Server version: Apache/2.4.10 (Unix)' + ac_IFS=$IFS + IFS="- /. + " +@@ -8332,7 +8332,7 @@ + + fi + else +- APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'` ++ APACHE_THREADED_MPM="threaded: yes (fixed thread count)" + if test -n "$APACHE_THREADED_MPM"; then + + enable_maintainer_zts=yes +@@ -8450,7 +8450,7 @@ + + # Test that we're trying to configure with apache 2.x + +- ac_output=`$APXS_HTTPD -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` ++ ac_output='Server version: Apache/2.4.10 (Unix)' + ac_IFS=$IFS + IFS="- /. + " +@@ -9156,7 +9156,7 @@ + + fi + else +- APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'` ++ APACHE_THREADED_MPM="threaded: yes (fixed thread count)" + if test -n "$APACHE_THREADED_MPM"; then + + enable_maintainer_zts=yes +@@ -9255,7 +9255,7 @@ + + # Test that we're trying to configure with apache 1.x + +- ac_output=`$APXS_HTTPD -v 2>&1 | grep version | $SED -e 's/Oracle-HTTP-//'` ++ ac_output='Server version: Apache/2.4.10 (Unix)' + ac_IFS=$IFS + IFS="- /. + " diff --git a/package/php/php.mk b/package/php/php.mk index 4bcbe18..62c0af4 100644 --- a/package/php/php.mk +++ b/package/php/php.mk @@ -50,6 +50,25 @@ 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) +ifeq ($(BR2_PACKAGE_PHP_APACHE),y) +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) +define PHP_FIX_THREADS_DETECTION + $(SED) 's/pthreads_working\=no/pthreads_working\=yes/' $(@D)/configure +endef +# PHP assumes pthreads are not working when cross-compiling, +# needed for Apache-MPM worker +PHP_POST_PATCH_HOOKS += PHP_FIX_THREADS_DETECTION +endif +PHP_CONF_OPTS += \ + --with-apxs2=$(STAGING_DIR)/usr/bin/apxs \ + --with-config-file-path=/etc/apache2 \ + --with-config-file-scan-dir=/etc/apache2/php \ + --oldincludedir=$(STAGING_DIR)/usr/include \ + --enable-pthreads \ + --localstatedir=/var +PHP_DEPENDENCIES += apache +endif + ### Extensions PHP_CONF_OPTS += \ $(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \