summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2009-10-08 19:56:14 +0000
committerFabian Groffen <grobian@gentoo.org>2009-10-08 19:56:14 +0000
commit8a5eb6b34800914afdbe18d3f0ef08affa49ac7c (patch)
tree1940fb7e079fe1c3c51052751c18b5326a873a83 /eclass
parentadd hppa*-hpux support to get_libname (diff)
downloadgentoo-2-8a5eb6b34800914afdbe18d3f0ef08affa49ac7c.tar.gz
gentoo-2-8a5eb6b34800914afdbe18d3f0ef08affa49ac7c.tar.bz2
gentoo-2-8a5eb6b34800914afdbe18d3f0ef08affa49ac7c.zip
add get_modname function that retrieves the shared module extension, like get_libname does for shared libraries
Diffstat (limited to 'eclass')
-rw-r--r--eclass/multilib.eclass22
1 files changed, 21 insertions, 1 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 23c6d09f3060..87a0cfc8b4ed 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.75 2009/10/08 19:54:40 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.76 2009/10/08 19:56:14 grobian Exp $
# @ECLASS: multilib.eclass
# @MAINTAINER:
@@ -550,6 +550,26 @@ get_libname() {
fi
}
+# @FUNCTION: get_modname
+# @USAGE:
+# @DESCRIPTION:
+# Returns modulename with proper suffix {.so,.bundle,etc} for the current
+# platform identified by CHOST.
+#
+# Example:
+# libfoo$(get_modname)
+# Returns: libfoo.so (ELF) || libfoo.bundle (MACH) || ...
+get_modname() {
+ local modname
+ local ver=$1
+ case ${CHOST} in
+ *-darwin*) modname="bundle";;
+ *) modname="so";;
+ esac
+
+ echo ".${modname}"
+}
+
# This is for the toolchain to setup profile variables when pulling in
# a crosscompiler (and thus they aren't set in the profile)
multilib_env() {