summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKito Danya Dietrich <kito@gentoo.org>2005-08-08 20:07:43 +0000
committerKito Danya Dietrich <kito@gentoo.org>2005-08-08 20:07:43 +0000
commitb62016e0333d8f66df8be56ff83e7f52579f7bb4 (patch)
tree5d30bab52c40bd12d38fd633a209cfbca268d907 /eclass/multilib.eclass
parentAdd ~sparc keyword to a reasonable set of drivers for testing Modular X on sp... (diff)
downloadhistorical-b62016e0333d8f66df8be56ff83e7f52579f7bb4.tar.gz
historical-b62016e0333d8f66df8be56ff83e7f52579f7bb4.tar.bz2
historical-b62016e0333d8f66df8be56ff83e7f52579f7bb4.zip
add get_libname function re: bug 58931
Diffstat (limited to 'eclass/multilib.eclass')
-rw-r--r--eclass/multilib.eclass28
1 files changed, 27 insertions, 1 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 284f3ce7b4ae..6f815cdfae7f 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.30 2005/07/11 15:08:06 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.31 2005/08/08 20:07:43 kito Exp $
#
# Author: Jeremy Huddleston <eradicator@gentoo.org>
#
@@ -84,6 +84,14 @@ DESCRIPTION="Based on the ${ECLASS} eclass"
# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64
# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64
+# get_libname [version]
+# returns libname with proper suffix {.so,.dylib} and optionally supplied version
+# for ELF/MACH-O shared objects
+#
+# Example:
+# get_libname libfoo ${PV}
+# Returns: libfoo.so.${PV} (ELF) || libfoo.${PV}.dylib (MACH)
+
### END DOCUMENTATION ###
# Defaults:
@@ -523,3 +531,21 @@ create_ml_includes-sym_for_dir() {
# exit because we'll likely be called from a subshell
exit 1
}
+
+get_libname() {
+ local ver=$1
+ if use userland_Darwin ; then
+ if [ -z ${ver} ] ; then
+ echo ".dylib"
+ else
+ echo ".${ver}.dylib"
+ fi
+ else
+ if [ -z ${ver} ] ; then
+ echo ".so"
+ else
+ echo ".so.${ver}"
+ fi
+ fi
+}
+