261 lines
6.5 KiB
Plaintext
261 lines
6.5 KiB
Plaintext
|
# Copyright 1999-2011 Gentoo Foundation
|
||
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v3.eblit,v 1.5 2011/09/16 07:02:57 olemarkus Exp $
|
||
|
|
||
|
eblit-php-src_configure() {
|
||
|
addpredict /usr/share/snmp/mibs/.index
|
||
|
|
||
|
PHP_DESTDIR="/usr/$(get_libdir)/php${SLOT}"
|
||
|
|
||
|
# This is a global variable and should be in caps. It isn't because the
|
||
|
# phpconfutils eclass relies on exactly this name...
|
||
|
# for --with-libdir see bug #327025
|
||
|
my_conf="
|
||
|
--prefix="${PHP_DESTDIR}"
|
||
|
--mandir="${PHP_DESTDIR}"/man
|
||
|
--infodir="${PHP_DESTDIR}"/info
|
||
|
--libdir="${PHP_DESTDIR}"/lib
|
||
|
--with-libdir=$(get_libdir)
|
||
|
--without-pear
|
||
|
$(use_enable threads maintainer-zts)"
|
||
|
|
||
|
# extension USE flag shared
|
||
|
my_conf+="
|
||
|
$(use_enable bcmath bcmath )
|
||
|
$(use_with bzip2 bz2 )
|
||
|
$(use_enable calendar calendar )
|
||
|
$(use_enable ctype ctype )
|
||
|
$(use_with curl curl )
|
||
|
$(use_with curlwrappers curlwrappers )
|
||
|
$(use_enable xml dom )
|
||
|
$(use_with enchant enchant /usr)
|
||
|
$(use_enable exif exif )
|
||
|
$(use_enable fileinfo fileinfo )
|
||
|
$(use_enable filter filter )
|
||
|
$(use_enable ftp ftp )
|
||
|
$(use_with nls gettext )
|
||
|
$(use_with gmp gmp )
|
||
|
$(use_enable hash hash )
|
||
|
$(use_with mhash mhash )
|
||
|
$(use_with iconv iconv )
|
||
|
$(use_enable intl intl )
|
||
|
$(use_enable ipv6 ipv6 )
|
||
|
$(use_enable json json )
|
||
|
$(use_with kerberos kerberos /usr)
|
||
|
$(use_enable xml libxml )
|
||
|
$(use_enable unicode mbstring )
|
||
|
$(use_with crypt mcrypt )
|
||
|
$(use_with mssql mssql )
|
||
|
$(use_with unicode onig /usr)
|
||
|
$(use_with ssl openssl )
|
||
|
$(use_with ssl openssl-dir /usr)
|
||
|
$(use_enable pcntl pcntl )
|
||
|
$(use_enable phar phar )
|
||
|
$(use_enable pdo pdo )
|
||
|
$(use_with postgres pgsql )
|
||
|
$(use_enable posix posix )
|
||
|
$(use_with spell pspell )
|
||
|
$(use_with recode recode )
|
||
|
$(use_enable simplexml simplexml )
|
||
|
$(use_enable sharedmem shmop )
|
||
|
$(use_with snmp snmp )
|
||
|
$(use_enable soap soap )
|
||
|
$(use_enable sockets sockets )
|
||
|
$(use_with sqlite3 sqlite3 /usr)
|
||
|
$(use_with sybase-ct sybase-ct /usr)
|
||
|
$(use_enable sysvipc sysvmsg )
|
||
|
$(use_enable sysvipc sysvsem )
|
||
|
$(use_enable sysvipc sysvshm )
|
||
|
$(use_with tidy tidy )
|
||
|
$(use_enable tokenizer tokenizer )
|
||
|
$(use_enable wddx wddx )
|
||
|
$(use_enable xml xml )
|
||
|
$(use_enable xmlreader xmlreader )
|
||
|
$(use_enable xmlwriter xmlwriter )
|
||
|
$(use_with xmlrpc xmlrpc )
|
||
|
$(use_with xsl xsl )
|
||
|
$(use_enable zip zip )
|
||
|
$(use_with zlib zlib )
|
||
|
$(use_enable debug debug )"
|
||
|
|
||
|
# DBA support
|
||
|
if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
|
||
|
|| use qdbm ; then
|
||
|
my_conf="${my_conf} --enable-dba${shared}"
|
||
|
fi
|
||
|
|
||
|
# DBA drivers support
|
||
|
my_conf+="
|
||
|
$(use_with cdb cdb )
|
||
|
$(use_with berkdb db4 )
|
||
|
$(use_enable flatfile flatfile )
|
||
|
$(use_with gdbm gdbm )
|
||
|
$(use_enable inifile inifile )
|
||
|
$(use_with qdbm qdbm )"
|
||
|
|
||
|
# Support for the GD graphics library
|
||
|
my_conf+="
|
||
|
$(use_with truetype freetype-dir /usr)
|
||
|
$(use_with truetype t1lib /usr)
|
||
|
$(use_enable cjk gd-jis-conv )
|
||
|
$(use_with gd jpeg-dir /usr)
|
||
|
$(use_with gd png-dir /usr)
|
||
|
$(use_with xpm xpm-dir /usr)"
|
||
|
# enable gd last, so configure can pick up the previous settings
|
||
|
my_conf+="
|
||
|
$(use_with gd gd )"
|
||
|
|
||
|
# IMAP support
|
||
|
if use imap ; then
|
||
|
my_conf+="
|
||
|
$(use_with imap imap )
|
||
|
$(use_with ssl imap-ssl )"
|
||
|
fi
|
||
|
|
||
|
# Interbase/firebird support
|
||
|
|
||
|
if use firebird ; then
|
||
|
my_conf+="
|
||
|
$(use_with firebird interbase /usr)"
|
||
|
fi
|
||
|
|
||
|
# LDAP support
|
||
|
if use ldap ; then
|
||
|
my_conf+="
|
||
|
$(use_with ldap ldap )
|
||
|
$(use_with ldap-sasl ldap-sasl )"
|
||
|
fi
|
||
|
|
||
|
# MySQL support
|
||
|
if use mysql ; then
|
||
|
if use mysqlnd ; then
|
||
|
my_conf+="
|
||
|
$(use_with mysql mysql mysqlnd)"
|
||
|
else
|
||
|
my_conf+="
|
||
|
$(use_with mysql mysql /usr)"
|
||
|
fi
|
||
|
my_conf+="
|
||
|
$(use_with mysql mysql-sock /var/run/mysqld/mysqld.sock)"
|
||
|
fi
|
||
|
|
||
|
# MySQLi support
|
||
|
if use mysqlnd ; then
|
||
|
my_conf+="
|
||
|
$(use_with mysqli mysqli mysqlnd)"
|
||
|
else
|
||
|
my_conf+="
|
||
|
$(use_with mysqli mysqli /usr/bin/mysql_config)"
|
||
|
fi
|
||
|
|
||
|
# ODBC support
|
||
|
if use odbc ; then
|
||
|
my_conf+="
|
||
|
$(use_with odbc unixODBC /usr)"
|
||
|
fi
|
||
|
|
||
|
if use iodbc ; then
|
||
|
my_conf+="
|
||
|
$(use_with iodbc iodbc /usr)"
|
||
|
fi
|
||
|
|
||
|
# Oracle support
|
||
|
if use oci8-instant-client ; then
|
||
|
OCI8IC_PKG="$(best_version dev-db/oracle-instantclient-basic | \
|
||
|
sed -e 's|dev-db/oracle-instantclient-basic-||g' | \
|
||
|
sed -e 's|-r.*||g')"
|
||
|
|
||
|
my_conf+="
|
||
|
$(use_with oci8-instant-client oci8 "instantclient,/usr/lib/oracle/${OCI8IC_PKG}/client/lib")"
|
||
|
fi
|
||
|
|
||
|
# PDO support
|
||
|
if use pdo ; then
|
||
|
my_conf+="
|
||
|
$(use_with mssql pdo-dblib )"
|
||
|
if use mysqlnd ; then
|
||
|
my_conf+="
|
||
|
$(use_with mysql pdo-mysql mysqlnd)"
|
||
|
else
|
||
|
my_conf+="
|
||
|
$(use_with mysql pdo-mysql /usr)"
|
||
|
fi
|
||
|
my_conf+="
|
||
|
$(use_with postgres pdo-pgsql )
|
||
|
$(use_with sqlite3 pdo-sqlite /usr)
|
||
|
$(use_with odbc pdo-odbc unixODBC,/usr)"
|
||
|
if use oci8-instant-client ; then
|
||
|
my_conf+="
|
||
|
$(use_with oci8-instant-client pdo-oci "instantclient,/usr,${OCI8IC_PKG}" )"
|
||
|
fi
|
||
|
fi
|
||
|
|
||
|
# readline/libedit support
|
||
|
my_conf+="
|
||
|
$(use_with readline readline )
|
||
|
$(use_with libedit libedit )"
|
||
|
|
||
|
# Session support
|
||
|
if use session ; then
|
||
|
my_conf+="
|
||
|
$(use_with sharedmem mm )"
|
||
|
else
|
||
|
my_conf+="
|
||
|
$(use_enable session session )"
|
||
|
fi
|
||
|
|
||
|
if use pic ; then
|
||
|
my_conf="${my_conf} --with-pic"
|
||
|
fi
|
||
|
|
||
|
# we use the system copy of pcre
|
||
|
# --with-pcre-regex affects ext/pcre
|
||
|
# --with-pcre-dir affects ext/filter and ext/zip
|
||
|
my_conf="${my_conf} --with-pcre-regex=/usr --with-pcre-dir=/usr"
|
||
|
|
||
|
# Catch CFLAGS problems
|
||
|
# Fixes bug #14067.
|
||
|
# Changed order to run it in reverse for bug #32022 and #12021.
|
||
|
replace-cpu-flags "k6*" "i586"
|
||
|
|
||
|
# Support user-passed configuration parameters
|
||
|
my_conf="${my_conf} ${EXTRA_ECONF:-}"
|
||
|
|
||
|
# Support the Apache2 extras, they must be set globally for all
|
||
|
# SAPIs to work correctly, especially for external PHP extensions
|
||
|
|
||
|
mkdir -p "${WORKDIR}/sapis-build"
|
||
|
for one_sapi in $SAPIS ; do
|
||
|
use "${one_sapi}" || continue
|
||
|
php_set_ini_dir "${one_sapi}"
|
||
|
|
||
|
cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}"
|
||
|
cd "${WORKDIR}/sapis-build/${one_sapi}"
|
||
|
|
||
|
sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
|
||
|
--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
|
||
|
|
||
|
for sapi in $SAPIS ; do
|
||
|
case "$sapi" in
|
||
|
cli|cgi|embed|fpm)
|
||
|
if [[ "${one_sapi}" == "${sapi}" ]] ; then
|
||
|
sapi_conf="${sapi_conf} --enable-${sapi}"
|
||
|
else
|
||
|
sapi_conf="${sapi_conf} --disable-${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}
|
||
|
done
|
||
|
}
|