summaryrefslogtreecommitdiff
path: root/eclass
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
commit73a8641a7bc99ccdda68556f7f06f622ef947c89 (patch)
tree9ec0bce303d120b7622ec4c3bc0bdceb75197012 /eclass
parent~alpha keyword. (diff)
downloadgentoo-2-73a8641a7bc99ccdda68556f7f06f622ef947c89.tar.gz
gentoo-2-73a8641a7bc99ccdda68556f7f06f622ef947c89.tar.bz2
gentoo-2-73a8641a7bc99ccdda68556f7f06f622ef947c89.zip
add get_libname function re: bug 58931
Diffstat (limited to '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
+}
+