/[gentoo-x86]/eclass/php-common-r1.eclass
Gentoo

Diff of /eclass/php-common-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 Revision 1.15
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/php-common-r1.eclass,v 1.10 2007/08/27 11:17:32 jokey Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/php-common-r1.eclass,v 1.15 2008/05/27 10:14:34 hoffie Exp $
4 4
5# ========================================================================
6#
7# php-common-r1.eclass
8# Contains common functions which are shared between the
9# PHP4 and PHP5 packages
10#
11# USE THIS ECLASS FOR THE "CONSOLIDATED" PACKAGES
12#
13# Based on robbat2's work on the php4 sapi eclass 5# Based on robbat2's work on the php4 sapi eclass
14# Based on stuart's work on the php5 sapi eclass 6# Based on stuart's work on the php5 sapi eclass
15# 7
8# @ECLASS: php-common-r1.eclass
9# @MAINTAINER:
16# Maintained by the PHP Team <php-bugs@gentoo.org> 10# Gentoo PHP team <php-bugs@gentoo.org>
17# 11# @BLURB: Common functions which are shared between the PHP4 and PHP5 packages.
18# ======================================================================== 12# @DESCRIPTION:
13# This eclass provides common functions which are shared between the PHP4 and PHP5 packages.
14# It is only used by php*-sapi eclasses currently and the functions are not intended
15# for direct use in ebuilds.
16
19 17
20# ======================================================================== 18# ========================================================================
21# CFLAG SANITY 19# CFLAG SANITY
22# ======================================================================== 20# ========================================================================
23 21
24php_check_cflags() { 22php_check_cflags() {
25 # Filter the following from C[XX]FLAGS regardless, as apache won't be
26 # supporting LFS until 2.2 is released and in the tree. Fixes bug #24373.
27 filter-flags "-D_FILE_OFFSET_BITS=64"
28 filter-flags "-D_FILE_OFFSET_BITS=32"
29 filter-flags "-D_LARGEFILE_SOURCE=1"
30 filter-flags "-D_LARGEFILE_SOURCE"
31
32 # Fixes bug #14067. 23 # Fixes bug #14067.
33 # Changed order to run it in reverse for bug #32022 and #12021. 24 # Changed order to run it in reverse for bug #32022 and #12021.
34 replace-flags "-march=k6-3" "-march=i586" 25 replace-cpu-flags "k6*" "i586"
35 replace-flags "-march=k6-2" "-march=i586"
36 replace-flags "-march=k6" "-march=i586"
37} 26}
38 27
39# ======================================================================== 28# ========================================================================
40# IMAP SUPPORT 29# IMAP SUPPORT
41# ======================================================================== 30# ========================================================================
56 if built_with_use virtual/imap-c-client ssl ; then 45 if built_with_use virtual/imap-c-client ssl ; then
57 eerror 46 eerror
58 eerror "IMAP without SSL requested, but your IMAP C-Client libraries are built with SSL!" 47 eerror "IMAP without SSL requested, but your IMAP C-Client libraries are built with SSL!"
59 eerror 48 eerror
60 die "Please recompile the IMAP C-Client libraries with SSL support disabled" 49 die "Please recompile the IMAP C-Client libraries with SSL support disabled"
50 fi
51 fi
52
53 if use "kolab" || phpconfutils_usecheck "kolab" ; then
54 if ! built_with_use net-libs/c-client kolab ; then
55 eerror
56 eerror "IMAP with annotations support requested, but net-libs/c-client is built without it!"
57 eerror
58 die "Please recompile net-libs/c-client with USE=kolab."
61 fi 59 fi
62 fi 60 fi
63} 61}
64 62
65# ======================================================================== 63# ========================================================================
72php_check_java() { 70php_check_java() {
73 if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then 71 if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then
74 return 72 return
75 fi 73 fi
76 74
77 JDKHOME="`java-config --jdk-home`" 75 JDKHOME="$(java-config --jdk-home)"
78 NOJDKERROR="You need to use the 'java-config' utility to set your JVM to a JDK!" 76 NOJDKERROR="You need to use the 'java-config' utility to set your JVM to a JDK!"
79 if [[ -z "${JDKHOME}" ]] || [[ ! -d "${JDKHOME}" ]] ; then 77 if [[ -z "${JDKHOME}" ]] || [[ ! -d "${JDKHOME}" ]] ; then
80 eerror "${NOJDKERROR}" 78 eerror "${NOJDKERROR}"
81 die "${NOJDKERROR}" 79 die "${NOJDKERROR}"
82 fi 80 fi
132php_install_java_inifile() { 130php_install_java_inifile() {
133 if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then 131 if ! use "java-internal" && ! phpconfutils_usecheck "java-internal" ; then
134 return 132 return
135 fi 133 fi
136 134
137 JAVA_LIBRARY="`grep -- '-DJAVALIB' Makefile | sed -e 's,.\+-DJAVALIB=\"\([^"]*\)\".*$,\1,g;' | sort -u`" 135 JAVA_LIBRARY="$(grep -- '-DJAVALIB' Makefile | sed -e 's,.\+-DJAVALIB=\"\([^"]*\)\".*$,\1,g;' | sort -u)"
138 136
139 echo "extension = java.so" >> "${D}/${PHP_EXT_INI_DIR}/java.ini" 137 echo "extension = java.so" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
140 echo "java.library = ${JAVA_LIBRARY}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini" 138 echo "java.library = ${JAVA_LIBRARY}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
141 echo "java.class.path = ${PHPEXTDIR}/php_java.jar" >> "${D}/${PHP_EXT_INI_DIR}/java.ini" 139 echo "java.class.path = ${PHPEXTDIR}/php_java.jar" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
142 echo "java.library.path = ${PHPEXTDIR}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini" 140 echo "java.library.path = ${PHPEXTDIR}" >> "${D}/${PHP_EXT_INI_DIR}/java.ini"
209# ======================================================================== 207# ========================================================================
210# POSTGRESQL SUPPORT 208# POSTGRESQL SUPPORT
211# ======================================================================== 209# ========================================================================
212 210
213php_check_pgsql() { 211php_check_pgsql() {
214 if use "postgres" \ 212 if use "postgres" && use "apache2" && use "threads" ; then
215 && use "apache2" && use "threads" \
216 && has_version ">=dev-db/libpq-8.1.3-r1" \ 213 if has_version ">=dev-db/libpq-8.1.3-r1" ; then
217 && ! built_with_use ">=dev-db/libpq-8.1.3-r1" "threads" ; then 214 if ! built_with_use ">=dev-db/libpq-8.1.3-r1" "threads" ; then
218 eerror 215 eerror
219 eerror "You must build dev-db/libpq with the 'threads' USE flag" 216 eerror "You must build dev-db/libpq with USE=threads"
220 eerror "turned on if you want to build PHP with threads support!" 217 eerror "if you want to build PHP with threads support!"
221 eerror 218 eerror
222 die "Rebuild dev-db/libpq with 'threads' USE flag enabled" 219 die "Rebuild dev-db/libpq with USE=threads"
220 fi
221 else
222 local pgsql_ver=$(eselect postgresql show)
223 if ! built_with_use "=dev-db/postgresql-base-${pgsql_ver}*" threads ; then
224 eerror
225 eerror "You must build =dev-db/postgresql-base-${pgsql_ver} with USE=threads"
226 eerror "if you want to build PHP with threads support!"
227 eerror
228 die "Rebuild =dev-db/postgresql-base-${pgsql_ver} with USE=threads"
229 fi
230 fi
223 fi 231 fi
224} 232}
225 233
226# ======================================================================== 234# ========================================================================
227# MYSQL CHARSET DETECTION SUPPORT ## Thanks to hoffie 235# MYSQL CHARSET DETECTION SUPPORT ## Thanks to hoffie

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20