summaryrefslogtreecommitdiff
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
commit793cb31099a15ea2ed783fdfc94993e21b8947a1 (patch)
tree159a7f13c50212d3e90cf999d44b46be3fb2e440 /eclass/multilib.eclass
parentadd hppa*-hpux support to get_libname (diff)
downloadhistorical-793cb31099a15ea2ed783fdfc94993e21b8947a1.tar.gz
historical-793cb31099a15ea2ed783fdfc94993e21b8947a1.tar.bz2
historical-793cb31099a15ea2ed783fdfc94993e21b8947a1.zip
add get_modname function that retrieves the shared module extension, like get_libname does for shared libraries
Diffstat (limited to 'eclass/multilib.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() {