From 9776f792a2cdff75acd833096997986920203b0a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= <benoit.burnichon@airtag.com>
Date: Tue, 6 Dec 2011 12:24:02 +0100
Subject: [PATCH] php5: add some functionalities (curl, xmlrpc, zlib)
To: ptxdist@pengutronix.de

---
 rules/php5.in   |   33 +++++++++++++++++++++++++++------
 rules/php5.make |   22 +++++++++++++++++++++-
 2 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/rules/php5.in b/rules/php5.in
index 8f77492..4b8a301 100644
--- a/rules/php5.in
+++ b/rules/php5.in
@@ -5,10 +5,13 @@ menuconfig PHP5
 	tristate
 	prompt "php5                          "
 	select APACHE2	if PHP5_SAPI_APXS2
+	select LIBCURL  if PHP5_EXT_CURL
 	select LIBXML2	if PHP5_XML_LIBXML2
 	select LIBXSLT	if PHP5_XML_LIBXML2_XSLT
 	select MYSQL	if PHP5_EXT_MYSQL
 	select PHP5_XML	if PHP5_EXT_SOAP
+	select XMLRPC_C if PHP5_XML_LIBXML2_XMLRPC
+	select ZLIB     if PHP5_EXT_ZLIB
 
 if PHP5
 
@@ -213,6 +216,16 @@ config PHP5_XML_LIBXML2_SIMPLEXML
 	help
 	  simple xml support
 
+#  --with-xmlrpc[=DIR]     Include XMLRPC-EPI support
+#  --with-libexpat-dir=DIR   XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)
+#  --with-iconv-dir=DIR      XMLRPC-EPI: iconv dir for XMLRPC-EPI
+
+config PHP5_XML_LIBXML2_XMLRPC
+	bool
+	prompt "xmlrpc support"
+	help
+	  xmlrpc support
+
 endif	# PHP5_XML_LIBXML2
 
 endif	# PHP5_XML
@@ -272,12 +285,16 @@ menu "Extensions                  "
 #                          support. Use --with-pcre-regex=DIR to specify DIR
 #                          where PCRE's include and library files are located,
 #                          if not using bundled library.
-#  --with-zlib[=DIR]       Include ZLIB support (requires zlib >= 1.0.9)
-#  --with-zlib-dir=<DIR>   Define the location of zlib install directory
 #  --enable-bcmath         Enable bc style precision math functions
 #  --with-bz2[=DIR]        Include BZip2 support
 #  --enable-calendar       Enable support for calendar conversion
 #  --disable-ctype         Disable ctype functions
+config PHP5_EXT_CURL
+	bool
+	prompt "curl"
+	help
+	  Enable CURL support for PHP.
+
 #  --with-curl[=DIR]       Include CURL support
 #  --with-curlwrappers     Use CURL for url streams
 #  --enable-dba            Build DBA with builtin modules. To build shared DBA
@@ -473,6 +490,14 @@ config PHP5_EXT_SQLITE3
 	help
 	  Enable sqlite3 support for PHP.
 
+#  --with-zlib[=DIR]       Include ZLIB support (requires zlib >= 1.0.9)
+#  --with-zlib-dir=<DIR>   Define the location of zlib install directory
+config PHP5_EXT_ZLIB
+	bool
+	prompt "zlib"
+	help
+	  Enable zlib support for PHP.
+
 #  --disable-spl           Disable Standard PHP Library
 #  --without-sqlite        Do not include sqlite support.
 #                          Use --with-sqlite=DIR to specify DIR where
@@ -493,10 +518,6 @@ config PHP5_EXT_SQLITE3
 #  --enable-wddx           Enable WDDX support
 #  --with-libexpat-dir=DIR   XML: libexpat install prefix (deprecated)
 
-#  --with-xmlrpc[=DIR]     Include XMLRPC-EPI support
-#  --with-libexpat-dir=DIR   XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)
-#  --with-iconv-dir=DIR      XMLRPC-EPI: iconv dir for XMLRPC-EPI
-
 #PEAR:
 #
 #  --with-pear=DIR         Install PEAR in DIR [PREFIX/lib/php]
diff --git a/rules/php5.make b/rules/php5.make
index 31b8672..04976a5 100644
--- a/rules/php5.make
+++ b/rules/php5.make
@@ -86,7 +86,7 @@ else
 endif
 
 ifdef PTXCONF_PHP5_SAPI_APXS2
-PHP5_AUTOCONF += --with-apxs2=$(SYSROOT)/usr/bin/apxs
+PHP5_AUTOCONF += --with-apxs2=$(PTXDIST_SYSROOT_TARGET)/usr/bin/apxs
 else
 # PHP5_AUTOCONF += --without-apxs2
 endif
@@ -223,6 +223,26 @@ else
 PHP5_AUTOCONF += --disable-simplexml
 endif
 
+ifdef PTXCONF_PHP5_XML_LIBXML2_XMLRPC
+PHP5_AUTOCONF += --with-xmlrpc
+else
+PHP5_AUTOCONF += --without-xmlrpc
+endif
+
+ifdef PTXCONF_PHP5_EXT_ZLIB
+PHP5_AUTOCONF += --with-zlib=$(SYSROOT)/usr
+else
+PHP5_AUTOCONF += --without-zlib
+endif
+
+ifdef PTXCONF_PHP5_EXT_CURL
+PHP5_AUTOCONF += \
+	--with-curl=$(SYSROOT)/usr \
+	--with-curl-wrappers
+else
+PHP5_AUTOCONF += --without-curl
+endif
+
 ifdef PTXCONF_PHP5_EXT_MYSQL
 PHP5_AUTOCONF += \
 	--with-mysql=$(SYSROOT)/usr \
-- 
1.7.2.5

