Skip to contentSkip to conversation

modphp: enable mysql option in PACKAGECONFIG

PATCH Applied [email protected] 3 participants 6 messages Apr 9, 2013 – Apr 15, 2013

lore
Share & tools
lore
#0 lore raw

cover modphp: enable mysql option in PACKAGECONFIG

From: Jackie Huang <[email protected]>

The patches are for the LAMP feature in our layer, to enable mysql option in PACKAGECONFIG works but the old libtool used by modphp doesn't support "--with-libtool-sysroot" which causes a host contamination issue. So this work also includes fixes to support autoconf 2.59+ to avoid the libtool issue.

I think not all people want to enale mysql as default, if so, I think we can only add the fixes, and I will only enable mysql option in our layer.

---
The following changes since commit b07f0a239e7ee2b81157399b6befa811a5009813:

gd: Add mirror for when libgd.org is down (2013-04-08 14:12:24 +0200)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jhuang0/d_modphp_lamp_0409_0
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/d_modphp_lamp_0409_0

Jackie Huang (2):
modphp: revert pthread-check.patch and add one against threads.m4
modphp: enable mysql option in PACKAGECONFIG

 .../modphp/files/php-5.3.14-aconf259.patch         |  209 ++++++++++++++++++++
 .../modphp/files/pthread-check-threads-m4.patch    |   30 +++
 .../recipes-php/modphp/files/pthread-check.patch   |   64 ------
 meta-webserver/recipes-php/modphp/modphp5.inc      |   26 ++--
 4 files changed, 252 insertions(+), 77 deletions(-)
 create mode 100644 meta-webserver/recipes-php/modphp/files/php-5.3.14-aconf259.patch
 create mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check-threads-m4.patch
 delete mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check.patch
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 modphp: revert pthread-check.patch and add one against threads.m4

From: Jackie Huang <[email protected]>

revert pthread-check.patch which hacks the old configure, instead, add one against threads.m4 to enable pthread support when cross-compiling.

---
 .../modphp/files/pthread-check-threads-m4.patch    |   30 +++++++++
 .../recipes-php/modphp/files/pthread-check.patch   |   64 --------------------
 meta-webserver/recipes-php/modphp/modphp5.inc      |    2 +-
 3 files changed, 31 insertions(+), 65 deletions(-)
 create mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check-threads-m4.patch
 delete mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check.patch
meta-webserver/recipes-php/modphp/files/pthread-check-threads-m4.patch new file +30 -0
new file mode 100644
index 0000000..0c564cd
@@ -0,0 +1,30 @@
+From d8067ceacbf54e79c9c6b68675332c09eaa0b55d Mon Sep 17 00:00:00 2001
+From: Jackie Huang <[email protected]>
+Date: Mon, 8 Apr 2013 14:29:51 +0800
+Subject: [PATCH] pthread-check
+
+Enable pthreads support when cross-compiling
+
+Upstream-Status: Inapproprate [config]
+
+Signed-off-by: Jackie Huang <[email protected]>
+---
+ TSRM/threads.m4 |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/TSRM/threads.m4 b/TSRM/threads.m4
+index 38494ce..15d9454 100644
+--- a/TSRM/threads.m4
++++ b/TSRM/threads.m4
+@@ -86,7 +86,7 @@ int main() {
+   pthreads_working=no
+   ], [
+   dnl For cross compiling running this test is of no use. NetWare supports pthreads
+-  pthreads_working=no
++  pthreads_working=yes
+   case $host_alias in
+   *netware*)
+     pthreads_working=yes
+-- 
+1.7.4.1
+
meta-webserver/recipes-php/modphp/files/pthread-check.patch deleted +0 -64

64 lines not on this page · raw message

meta-webserver/recipes-php/modphp/modphp5.inc +1 -1
index 33dbe89..0d84ba4 100644
@@ -5,7 +5,7 @@ DEPENDS = "apache2-native apache2 zlib bzip2"
 
 SRC_URI = "http://www.php.net/distributions/php-${PV}.tar.bz2 \
            file://configure.patch \
-           file://pthread-check.patch \
+           file://pthread-check-threads-m4.patch \
            file://70_mod_php5.conf \
            "
 
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/2 modphp: enable mysql option in PACKAGECONFIG

In reply to [email protected]

From: Jackie Huang <[email protected]>

* enable mysql option in PACKAGECONFIG
* add patch to support autoconf 2.59+ so we can use autotools do_configure to fix a libtool cross-compile issue

---
 .../modphp/files/php-5.3.14-aconf259.patch         |  209 ++++++++++++++++++++
 meta-webserver/recipes-php/modphp/modphp5.inc      |   24 ++--
 2 files changed, 221 insertions(+), 12 deletions(-)
 create mode 100644 meta-webserver/recipes-php/modphp/files/php-5.3.14-aconf259.patch
meta-webserver/recipes-php/modphp/files/php-5.3.14-aconf259.patch new file +209 -0
new file mode 100644
index 0000000..bda0aef
@@ -0,0 +1,209 @@
+Patch from fedora to support autoconf 2.59+
+
+referrence to:
+https://bugs.php.net/bug.php?id=50291
+http://lists.fedoraproject.org/pipermail/scm-commits/2012-June/807312.html
+
+Signed-off-by: Jackie Huang <[email protected]>
+---
+diff --git a/build/buildcheck.sh b/build/buildcheck.sh
+index de16264..4b05c28 100755
+--- a/build/buildcheck.sh
++++ b/build/buildcheck.sh
+@@ -28,33 +28,23 @@ if test -z "$PHP_AUTOCONF"; then
+   PHP_AUTOCONF='autoconf'
+ fi
+ 
+-# autoconf 2.13 or newer
++# autoconf 2.59 or newer
+ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
+ if test -z "$ac_version"; then
+ echo "buildconf: autoconf not found."
+-echo "           You need autoconf version 2.13 or newer installed"
++echo "           You need autoconf version 2.59 or newer installed"
+ echo "           to build PHP from SVN."
+ exit 1
+ fi
+ IFS=.; set $ac_version; IFS=' '
+-if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
++if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
+ echo "buildconf: autoconf version $ac_version found."
+-echo "           You need autoconf version 2.13 or newer installed"
++echo "           You need autoconf version 2.59 or newer installed"
+ echo "           to build PHP from SVN."
+ exit 1
+ fi
+ 
+-if test "$1" = "2" -a "$2" -gt "59"; then
+-  echo "buildconf: You need autoconf 2.59 or lower to build this version of PHP."
+-  echo "           You are currently trying to use $ac_version"
+-  echo "           Most distros have separate autoconf 2.13 or 2.59 packages."
+-  echo "           On Debian/Ubuntu both autoconf2.13 and autoconf2.59 packages exist."
+-  echo "           Install autoconf2.13 and set the PHP_AUTOCONF env var to "
+-  echo "           autoconf2.13 and try again."
+-  exit 1
+-else
+-  echo "buildconf: autoconf version $ac_version (ok)"
+-fi
++echo "buildconf: autoconf version $ac_version (ok)"
+ 
+ if test "$1" = "2" -a "$2" -ge "50"; then
+   ./vcsclean
+diff --git a/configure.in b/configure.in
+index f48ce4f..6851512 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1,28 +1,6 @@
+ ## $Id$ -*- autoconf -*-
+ dnl ## Process this file with autoconf to produce a configure script.
+ 
+-divert(1)
+-
+-dnl ## Diversion 1 is the autoconf + automake setup phase. We also
+-dnl ## set the PHP version, deal with platform-specific compile
+-dnl ## options and check for the basic compile tools.
+-
+-dnl ## Diversion 2 is the initial checking of OS features, programs,
+-dnl ## libraries and so on.
+-
+-dnl ## In diversion 3 we check for compile-time options to the PHP
+-dnl ## core and how to deal with different system dependencies. 
+-dnl ## This includes whether debugging or short tags are enabled
+-dnl ## and the default behaviour of php.ini options.
+-dnl ## This is also where an SAPI interface is selected (choosing between
+-dnl ## Apache module, CGI etc.)
+-
+-dnl ## In diversion 4 we check user-configurable general settings.
+-
+-dnl ## In diversion 5 we check which extensions should be compiled.
+-dnl ## All of these are normally in the extension directories.
+-dnl ## Diversion 5 is the last one.  Here we generate files and clean up.
+-
+ dnl include Zend specific macro definitions first
+ dnl -------------------------------------------------------------------------
+ sinclude(Zend/acinclude.m4)
+@@ -30,8 +8,10 @@ sinclude(Zend/acinclude.m4)
+ dnl Basic autoconf + automake initialization, generation of config.nice.
+ dnl -------------------------------------------------------------------------
+ 
+-AC_PREREQ(2.13)
++AC_PREREQ(2.59)
+ AC_INIT(README.GIT-RULES)
++ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
++
+ 
+ PHP_CONFIG_NICE(config.nice)
+ 
+@@ -290,14 +270,6 @@ sinclude(TSRM/threads.m4)
+ sinclude(TSRM/tsrm.m4)
+ 
+ 
+-divert(2)
+-
+-dnl ## Diversion 2 is where we set PHP-specific options and come up
+-dnl ## with reasonable default values for them. We check for pthreads here
+-dnl ## because the information is needed by the SAPI configuration.
+-dnl ## This is also where an SAPI interface is selected (choosing between
+-dnl ## Apache module, CGI etc.)
+-
+ dnl .
+ dnl -------------------------------------------------------------------------
+ 
+@@ -329,13 +301,6 @@ if test "$enable_maintainer_zts" = "yes"; then
+   PTHREADS_FLAGS
+ fi
+ 
+-divert(3)
+-
+-dnl ## In diversion 3 we check for compile-time options to the PHP
+-dnl ## core and how to deal with different system dependencies. 
+-dnl ## This includes whether debugging or short tags are enabled
+-dnl ## and the default behaviour of php.ini options.
+-
+ dnl Starting system checks.
+ dnl -------------------------------------------------------------------------
+ 
+@@ -683,10 +648,6 @@ if test "x$php_crypt_r" = "x1"; then
+   PHP_CRYPT_R_STYLE
+ fi
+ 
+-divert(4)
+-
+-dnl ## In diversion 4 we check user-configurable general settings.
+-
+ dnl General settings.
+ dnl -------------------------------------------------------------------------
+ PHP_CONFIGURE_PART(General settings)
+@@ -924,11 +885,6 @@ else
+   AC_MSG_RESULT([using system default])
+ fi
+ 
+-divert(5)
+-
+-dnl ## In diversion 5 we check which extensions should be compiled.
+-dnl ## All of these are normally in the extension directories.
+-
+ dnl Extension configuration.
+ dnl -------------------------------------------------------------------------
+ 
+diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
+index e28c351..c33ae1e 100644
+--- a/ext/standard/config.m4
++++ b/ext/standard/config.m4
+@@ -1,7 +1,5 @@
+ dnl $Id$ -*- autoconf -*-
+ 
+-divert(3)dnl
+-
+ dnl
+ dnl Check if flush should be called explicitly after buffered io
+ dnl
+@@ -342,8 +340,6 @@ dnl
+ AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy)
+ AC_FUNC_FNMATCH	
+ 
+-divert(5)dnl
+-
+ dnl
+ dnl Check if there is a support means of creating a new process
+ dnl and defining which handles it receives
+diff --git a/scripts/php-config.in b/scripts/php-config.in
+index 13c25f2..d6c62cc 100644
+--- a/scripts/php-config.in
++++ b/scripts/php-config.in
+@@ -2,6 +2,7 @@
+ 
+ SED="@SED@"
+ prefix="@prefix@"
++datarootdir="@datarootdir@"
+ exec_prefix="@exec_prefix@"
+ version="@PHP_VERSION@"
+ vernum="@PHP_VERSION_ID@"
+diff --git a/scripts/phpize.in b/scripts/phpize.in
+index 40ccc77..43cd8d3 100644
+--- a/scripts/phpize.in
++++ b/scripts/phpize.in
+@@ -2,6 +2,7 @@
+ 
+ # Variable declaration
+ prefix='@prefix@'
++datarootdir='@datarootdir@'
+ exec_prefix="`eval echo @exec_prefix@`"
+ phpdir="`eval echo @libdir@`/build"
+ includedir="`eval echo @includedir@`/php"
+diff --git a/scripts/phpize.m4 b/scripts/phpize.m4
+index e3a30a5..d745ca7 100644
+--- a/scripts/phpize.m4
++++ b/scripts/phpize.m4
+@@ -1,9 +1,8 @@
+ dnl This file becomes configure.in for self-contained extensions.
+ 
+-divert(1)
+-
+-AC_PREREQ(2.13)
++AC_PREREQ(2.59)
+ AC_INIT(config.m4)
++ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
+ 
+ PHP_CONFIG_NICE(config.nice)
+ 
meta-webserver/recipes-php/modphp/modphp5.inc +12 -12
index 0d84ba4..fdf7b18 100644
@@ -2,11 +2,13 @@ SECTION = "console/network"
 DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the apache php module."
 LICENSE = "PHP-3.0"
 DEPENDS = "apache2-native apache2 zlib bzip2"
+INC_PR = "r1"
 
 SRC_URI = "http://www.php.net/distributions/php-${PV}.tar.bz2 \
            file://configure.patch \
            file://pthread-check-threads-m4.patch \
            file://70_mod_php5.conf \
+           file://php-5.3.14-aconf259.patch \
            "
 
 S = "${WORKDIR}/php-${PV}"
@@ -41,25 +43,21 @@ EXTRA_OECONF = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs \
                 --enable-mbstring \
                 --with-config-file-path=${sysconfdir}/php/apache2-php5"
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "mysql"
 PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config,--without-mysqli,mysql5"
 PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,mysql5"
 
 acpaths = ""
 
-#
-# override the autotools do_configure, which runs autoconf,
-# which breaks everything...
-#
-do_configure() {
-	gnu-configize --force
-	find . -name config.m4 -o -name configure | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
-	export PHP_LIBXML_DIR=${STAGING_DIR_NATIVE}${layout_exec_prefix} 
-	oe_runconf
+do_configure_prepend () {
+        rm -f build/libtool.m4 ltmain.sh aclocal.m4
+        find . -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_BINDIR_NATIVE}/httpd!'
+}
 
+do_configure_append() {
 	# No libtool, we really don't want rpath set...
-	sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-	sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+	sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_SYS}-libtool
+	sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_SYS}-libtool
 }
 
 do_install  () {
@@ -76,6 +74,8 @@ do_install  () {
 	install -d ${D}${bindir}
 	install -m 755 scripts/phpize ${D}${bindir}
 	install -m 755 scripts/php-config ${D}${bindir}
+	cat aclocal-copy/libtool.m4 aclocal-copy/lt~obsolete.m4 aclocal-copy/ltoptions.m4 \
+		aclocal-copy/ltsugar.m4 aclocal-copy/ltversion.m4 > build/libtool.m4
 
 	oe_runmake install-build install-headers INSTALL_ROOT=${D}
 }
Signature · 1 line
1.7.4.1
#3 lore raw
Quoted 9 lines · On Tuesday 09 April 2013 15:11:05 [email protected] wrote:

From: Jackie Huang <[email protected]>

* enable mysql option in PACKAGECONFIG
...

meta-webserver/recipes-php/modphp/modphp5.inc +1 -1
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "mysql"
 PACKAGECONFIG[mysql] =

"--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config,--without-mysqli,mysql5

So, I'm not entirely sure about this. RFC: what do other people think about enabling this by default?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 12-04-13 11:06, Paul Eggleton schreef:

Quoted 5 lines · On Tuesday 09 April 2013 15:11:05 [email protected] wrote:
Quoted 4 lines

From: Jackie Huang <[email protected]>

* enable mysql option in PACKAGECONFIG ...

Quoted 7 lines
Quoted 5 lines

-PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "mysql" PACKAGECONFIG[mysql] = "--with-mysqli=${STAGING_BINDIR_CROSS}/mysql_config,--without-mysqli,mysql5

So, I'm not entirely sure about this. RFC: what do other people think about enabling this by default?

It makes sense to make LAMP as easy as possible. And this is the 'M'.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD8DBQFRZ9InMkyGM64RGpERAixUAJ9wy6qMMiecrXKa2cvx2Zj2sxNZDACdEfMK /Gj9a0weV+ugccDy7bkJV1U=
=tyWQ
-----END PGP SIGNATURE-----

#5 lore raw
In reply to [email protected]
Quoted 33 lines · On Tuesday 09 April 2013 15:11:03 [email protected] wrote:

From: Jackie Huang <[email protected]>

The patches are for the LAMP feature in our layer, to enable mysql option in PACKAGECONFIG works but the old libtool used by modphp doesn't support "--with-libtool-sysroot" which causes a host contamination issue. So this work also includes fixes to support autoconf 2.59+ to avoid the libtool issue.

I think not all people want to enale mysql as default, if so, I think we can only add the fixes, and I will only enable mysql option in our layer.

---
The following changes since commit b07f0a239e7ee2b81157399b6befa811a5009813:

gd: Add mirror for when libgd.org is down (2013-04-08 14:12:24 +0200)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jhuang0/d_modphp_lamp_0409_0

http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/d_modphp_lamp
_0409_0

Jackie Huang (2):
modphp: revert pthread-check.patch and add one against threads.m4
modphp: enable mysql option in PACKAGECONFIG

 .../modphp/files/php-5.3.14-aconf259.patch         |  209
++++++++++++++++++++ .../modphp/files/pthread-check-threads-m4.patch    |  
30 +++
 .../recipes-php/modphp/files/pthread-check.patch   |   64 ------
 meta-webserver/recipes-php/modphp/modphp5.inc      |   26 ++--
 4 files changed, 252 insertions(+), 77 deletions(-)
 create mode 100644
Quoted 5 lines

meta-webserver/recipes-php/modphp/files/php-5.3.14-aconf259.patch create mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check-threads-m4.patch delete mode 100644 meta-webserver/recipes-php/modphp/files/pthread-check.patch

Merged, thanks!

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre