diff options
Diffstat (limited to 'dev-lang/php/files/eblits/src_compile-v2.eblit')
-rw-r--r-- | dev-lang/php/files/eblits/src_compile-v2.eblit | 82 |
1 files changed, 76 insertions, 6 deletions
diff --git a/dev-lang/php/files/eblits/src_compile-v2.eblit b/dev-lang/php/files/eblits/src_compile-v2.eblit index 6e3d277..40423e1 100644 --- a/dev-lang/php/files/eblits/src_compile-v2.eblit +++ b/dev-lang/php/files/eblits/src_compile-v2.eblit @@ -1,17 +1,87 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v2.eblit,v 1.3 2011/10/31 16:18:04 mabi Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v2.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $ eblit-php-src_compile() { - # snmp seems to run during src_compile, too (bug #324739) - addpredict /usr/share/snmp/mibs/.index + SAPI_DIR="${WORKDIR}/sapis" + local is_first_sapi=1 for sapi in ${SAPIS} ; do - use "${sapi}" && php_sapi_build "${sapi}" + use "${sapi}" || continue + if [[ ${is_first_sapi} == 1 ]]; then + is_first_sapi=0 + else + emake clean + fi + + php_sapi_build "${sapi}" + php_sapi_copy "${sapi}" done } php_sapi_build() { - cd "${WORKDIR}/sapis-build/$1" + local sapi="$1" + php_set_ini_dir "${sapi}" + + mkdir -p "${SAPI_DIR}/${sapi}" + + sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} + --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" + + for one_sapi in $SAPIS ; do + case "$one_sapi" in + cli|cgi|embed) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --enable-${available_sapi}" + else + sapi_conf="${sapi_conf} --disable-${available_sapi}" + fi + ;; + + apache2) + if [[ "${one_sapi}" == "${sapi}" ]] ; then + sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs" + else + sapi_conf="${sapi_conf} --without-apxs2" + fi + ;; + + esac + done + + econf ${sapi_conf} emake || die "emake failed" } + +php_sapi_copy() { + local sapi="$1" + local source="" + + case "$sapi" in + cli) + source="sapi/cli/php" + ;; + cgi) + source="sapi/cgi/php-cgi" + ;; + embed) + source="libs/libphp${PHP_MV}.so" + ;; + + apache2) + # apache2 is a special case; the necessary files + # (yes, multiple) are copied by make install, not + # by the ebuild; that's the reason, why apache2 has + # to be the last sapi + emake INSTALL_ROOT="${SAPI_DIR}/${sapi}/" install-sapi + ;; + + *) + die "unhandled sapi in php_sapi_copy" + ;; + esac + + if [[ "${source}" ]] ; then + cp "$source" "${SAPI_DIR}/$sapi" || die "Unable to copy ${sapi} SAPI" + fi +} |