diff options
author | Luca Longinotti <chtekk@gentoo.org> | 2007-03-05 01:50:47 +0000 |
---|---|---|
committer | Luca Longinotti <chtekk@gentoo.org> | 2007-03-05 01:50:47 +0000 |
commit | 3866af48f35422b30b80deefcf0de589c569ddf7 (patch) | |
tree | b543212474a6c4d3d0c296fcc01716ecd5e14711 /eclass/php-ext-source-r1.eclass | |
parent | Fix compile on 5.2. (diff) | |
download | gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.tar.gz gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.tar.bz2 gentoo-2-3866af48f35422b30b80deefcf0de589c569ddf7.zip |
New updated PHP eclasses, fix lots of bugs, introduce PHP 5.2 support.
Diffstat (limited to 'eclass/php-ext-source-r1.eclass')
-rw-r--r-- | eclass/php-ext-source-r1.eclass | 79 |
1 files changed, 35 insertions, 44 deletions
diff --git a/eclass/php-ext-source-r1.eclass b/eclass/php-ext-source-r1.eclass index b9cc9b3d4f33..547583e4d450 100644 --- a/eclass/php-ext-source-r1.eclass +++ b/eclass/php-ext-source-r1.eclass @@ -1,10 +1,11 @@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.5 2006/07/14 16:02:36 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.6 2007/03/05 01:50:47 chtekk Exp $ # # Author: Tal Peer <coredumb@gentoo.org> # Author: Stuart Herbert <stuart@gentoo.org> -# Maintained by the PHP Herd <php-bugs@gentoo.org> +# Author: Luca Longinotti <chtekk@gentoo.org> +# Maintained by the PHP Team <php-bugs@gentoo.org> # # The php-ext-source-r1 eclass provides a unified interface for compiling and # installing standalone PHP extensions ('modules') from source code. @@ -13,78 +14,68 @@ # # inherit php-ext-source-r1 -inherit php-ext-base-r1 flag-o-matic +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="latest" -EXPORT_FUNCTIONS src_compile src_install - -# ---begin ebuild configurable settings +inherit php-ext-base-r1 flag-o-matic autotools depend.php -# Wether or not to add a line in the php.ini for the extension -# (defaults to "yes" and shouldn't be changed in most cases) -[ -z "${PHP_EXT_INI}" ] && PHP_EXT_INI="yes" +EXPORT_FUNCTIONS src_compile src_install -# ---end ebuild configurable settings +# The extension name, this must be set, otherwise we die +[[ -z "${PHP_EXT_NAME}" ]] && die "No module name specified for the php-ext-source-r1 eclass" DEPEND=">=sys-devel/m4-1.4.3 - >=sys-devel/libtool-1.5.18 - >=sys-devel/automake-1.9.6 - sys-devel/automake-wrapper - >=sys-devel/autoconf-2.59 - sys-devel/autoconf-wrapper" + >=sys-devel/libtool-1.5.18" +RDEPEND="" php-ext-source-r1_src_compile() { # Pull in the PHP settings has_php - cd "${S}" - my_conf="${my_conf} --prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG}" addpredict /usr/share/snmp/mibs/.index + # Set the correct config options + my_conf="--prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG} ${my_conf}" + # Create configure out of config.m4 ${PHPIZE} - # Set needed automake/autoconf versions - export WANT_AUTOMAKE=1.9 WANT_AUTOCONF=2.5 - # Concurrent PHP Apache2 modules support - if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then - if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then - append-ldflags "-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs" - fi + if has_concurrentmodphp ; then + append-ldflags "-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs" fi - # First compile run: the default - ./configure ${my_conf} || die "Unable to configure code to compile" + # First compile run: the default one + econf ${my_conf} || die "Unable to configure code to compile" emake || die "Unable to make code" mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-default.so" || die "Unable to move extension" # Concurrent PHP Apache2 modules support - if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then - if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then - # First let's clean up - make distclean || die "Unable to clean build environment" - - # Second compile run: the versioned one - append-ldflags "-Wl,--allow-shlib-undefined -L/usr/$(get_libdir)/apache2/modules/ -lphp${PHP_VERSION}" - ./configure ${my_conf} || die "Unable to configure code to compile" - emake || die "Unable to make code" - mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" || die "Unable to move extension" - fi + if has_concurrentmodphp ; then + # First let's clean up + make distclean || die "Unable to clean build environment" + + # Second compile run: the versioned one + econf ${my_conf} || die "Unable to configure versioned code to compile" + sed -e "s|-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs|-Wl,--version-script=${ROOT}/var/lib/php-pkg/${PHP_PKG}/php${PHP_VERSION}-ldvs -Wl,--allow-shlib-undefined -L/usr/$(get_libdir)/apache2/modules/ -lphp${PHP_VERSION}|g" -i Makefile + append-ldflags "-Wl,--allow-shlib-undefined -L/usr/$(get_libdir)/apache2/modules/ -lphp${PHP_VERSION}" + emake || die "Unable to make versioned code" + mv -f "modules/${PHP_EXT_NAME}.so" "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" || die "Unable to move versioned extension" fi } php-ext-source-r1_src_install() { + # Pull in the PHP settings has_php + addpredict /usr/share/snmp/mibs/.index # Let's put the default module away insinto "${EXT_DIR}" newins "${WORKDIR}/${PHP_EXT_NAME}-default.so" "${PHP_EXT_NAME}.so" - # And now the versioned one - if built_with_use =${PHP_PKG} apache2 || phpconfutils_built_with_use =${PHP_PKG} apache2 ; then - if built_with_use =${PHP_PKG} concurrentmodphp || phpconfutils_built_with_use =${PHP_PKG} concurrentmodphp ; then - insinto "${EXT_DIR}-versioned" - newins "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" "${PHP_EXT_NAME}.so" - fi + # And now the versioned one, if it exists + if has_concurrentmodphp ; then + insinto "${EXT_DIR}-versioned" + newins "${WORKDIR}/${PHP_EXT_NAME}-versioned.so" "${PHP_EXT_NAME}.so" fi php-ext-base-r1_src_install |