| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 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/phpconfutils.eclass,v 1.3 2006/04/20 12:15:35 chtekk Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/phpconfutils.eclass,v 1.5 2007/05/10 20:26:45 chtekk Exp $ |
| 4 | # |
4 | # |
| 5 | # ######################################################################## |
5 | # ######################################################################## |
| 6 | # |
6 | # |
| 7 | # eclass/phpconfutils.eclass |
7 | # eclass/phpconfutils.eclass |
| 8 | # Utility functions to help with configuring PHP |
8 | # Utility functions to help with configuring PHP |
| 9 | # |
9 | # |
| 10 | # Based on stuart's work on the original confutils eclass |
10 | # Based on Stuart's work on the original confutils eclass |
| 11 | # |
11 | # |
| 12 | # Author(s) Luca Longinotti |
12 | # Author(s) Luca Longinotti |
| 13 | # <chtekk@gentoo.org> |
13 | # <chtekk@gentoo.org> |
| 14 | # |
14 | # |
| 15 | # Maintained by the PHP Herd <php-bugs@gentoo.org> |
15 | # Maintained by the PHP Herd <php-bugs@gentoo.org> |
| 16 | # |
16 | # |
| 17 | # ======================================================================== |
17 | # ======================================================================== |
| 18 | |
18 | |
| 19 | if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] ; then |
|
|
| 20 | IUSE="sharedext" |
|
|
| 21 | fi |
|
|
| 22 | |
|
|
| 23 | # ======================================================================== |
19 | # ======================================================================== |
| 24 | # List of USE flags that need deps that aren't yet in Portage |
20 | # List of USE flags that need deps that aren't yet in Portage |
| 25 | # or that can't be (fex. certain commercial apps) |
21 | # or that can't be (fex. certain commercial apps) |
| 26 | # |
22 | # |
| 27 | # You must define CONFUTILS_MISSING_DEPS if you need this |
23 | # You must define PHPCONFUTILS_MISSING_DEPS if you need this |
| 28 | |
24 | |
| 29 | # ======================================================================== |
25 | # ======================================================================== |
| 30 | # phpconfutils_sort_flags() |
26 | # phpconfutils_sort_flags() |
| 31 | # |
27 | # |
| 32 | # Sort and remove duplicates of the auto-enabled USE flags |
28 | # Sort and remove duplicates of the auto-enabled USE flags |
| … | |
… | |
| 44 | # this eclass first |
40 | # this eclass first |
| 45 | # |
41 | # |
| 46 | |
42 | |
| 47 | phpconfutils_init() { |
43 | phpconfutils_init() { |
| 48 | # Define wheter we shall support shared extensions or not |
44 | # Define wheter we shall support shared extensions or not |
| 49 | if [[ "${EBUILD_SUPPORTS_SHAREDEXT}" == "1" ]] && useq "sharedext" ; then |
45 | if useq "sharedext" ; then |
| 50 | shared="=shared" |
46 | shared="=shared" |
| 51 | else |
47 | else |
| 52 | shared="" |
48 | shared="" |
| 53 | fi |
49 | fi |
| 54 | |
50 | |
| … | |
… | |
| 99 | while [[ -n "$1" ]] ; do |
95 | while [[ -n "$1" ]] ; do |
| 100 | if useq "$1" ; then |
96 | if useq "$1" ; then |
| 101 | einfo "${success_msg} $1" |
97 | einfo "${success_msg} $1" |
| 102 | success="1" |
98 | success="1" |
| 103 | else |
99 | else |
| 104 | ewarn "${fail_msg} $1" |
100 | einfo "${fail_msg} $1" |
| 105 | fi |
101 | fi |
| 106 | shift |
102 | shift |
| 107 | done |
103 | done |
| 108 | |
104 | |
| 109 | # Did we find what we are looking for? |
105 | # Did we find what we are looking for? |
| … | |
… | |
| 394 | phpconfutils_sort_flags |
390 | phpconfutils_sort_flags |
| 395 | |
391 | |
| 396 | local x |
392 | local x |
| 397 | local my_found="0" |
393 | local my_found="0" |
| 398 | |
394 | |
| 399 | for x in ${CONFUTILS_MISSING_DEPS} ; do |
395 | for x in ${PHPCONFUTILS_MISSING_DEPS} ; do |
| 400 | if useq "${x}" || phpconfutils_usecheck "${x}" ; then |
396 | if useq "${x}" || phpconfutils_usecheck "${x}" ; then |
| 401 | ewarn "USE flag ${x} enables support for software not present in Portage!" |
397 | ewarn "USE flag ${x} enables support for software not present in Portage!" |
| 402 | my_found="1" |
398 | my_found="1" |
| 403 | fi |
399 | fi |
| 404 | done |
400 | done |
| … | |
… | |
| 410 | ewarn "fail to compile later on." |
406 | ewarn "fail to compile later on." |
| 411 | ewarn "*DO NOT* file bugs about compile failures or issues you're having" |
407 | ewarn "*DO NOT* file bugs about compile failures or issues you're having" |
| 412 | ewarn "when using one of those flags, as we aren't able to support them." |
408 | ewarn "when using one of those flags, as we aren't able to support them." |
| 413 | ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|" |
409 | ewarn "|=|=|=|=|=|=| You are on your own if you use them! |=|=|=|=|=|=|" |
| 414 | ewarn |
410 | ewarn |
| 415 | sleep 5 |
411 | ebeep 5 |
| 416 | fi |
412 | fi |
| 417 | } |
413 | } |
| 418 | |
414 | |
| 419 | # ======================================================================== |
415 | # ======================================================================== |
| 420 | # phpconfutils_built_with_use() |
416 | # phpconfutils_built_with_use() |