| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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/portability.eclass,v 1.14 2009/10/31 15:34:59 grobian Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.15 2010/02/26 18:09:43 grobian Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Diego Pettenò <flameeyes@gentoo.org> |
5 | # Author: Diego Pettenò <flameeyes@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass is created to avoid using non-portable GNUisms inside ebuilds |
7 | # This eclass is created to avoid using non-portable GNUisms inside ebuilds |
| 8 | # |
8 | # |
| … | |
… | |
| 52 | fi |
52 | fi |
| 53 | } |
53 | } |
| 54 | |
54 | |
| 55 | # Gets the linker flag to link to dlopen() function |
55 | # Gets the linker flag to link to dlopen() function |
| 56 | dlopen_lib() { |
56 | dlopen_lib() { |
| 57 | # this might need a proper case statement, so far this seems to work as is |
|
|
| 58 | # - Solaris needs nothing |
57 | # - Solaris needs nothing |
| 59 | # - Darwin needs nothing |
58 | # - Darwin needs nothing |
| 60 | # - *BSD needs nothing |
59 | # - *BSD needs nothing |
| 61 | # - Linux needs -ldl (glibc and uclibc) |
60 | # - Linux needs -ldl (glibc and uclibc) |
| 62 | if [[ ${CHOST} == *-linux-gnu* || ${CHOST} == *-linux-uclibc ]]; then |
61 | # - Interix needs -ldl |
|
|
62 | case "${CHOST}" in |
|
|
63 | *-linux-gnu*|*-linux-uclibc|*-interix*) |
| 63 | echo "-ldl" |
64 | echo "-ldl" |
| 64 | fi |
65 | ;; |
|
|
66 | esac |
| 65 | } |
67 | } |
| 66 | |
68 | |
| 67 | # Gets the home directory for the specified user |
69 | # Gets the home directory for the specified user |
| 68 | # it's a wrap around egetent as the position of the home directory in the line |
70 | # it's a wrap around egetent as the position of the home directory in the line |
| 69 | # varies depending on the os used. |
71 | # varies depending on the os used. |