/[gentoo-x86]/eclass/multilib.eclass
Gentoo

Diff of /eclass/multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.72 Revision 1.75
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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/multilib.eclass,v 1.72 2009/02/20 23:20:22 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.75 2009/10/08 19:54:40 grobian Exp $
4 4
5# @ECLASS: multilib.eclass 5# @ECLASS: multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# amd64@gentoo.org 7# amd64@gentoo.org
8# toolchain@gentoo.org 8# toolchain@gentoo.org
516} 516}
517 517
518# @FUNCTION: get_libname 518# @FUNCTION: get_libname
519# @USAGE: [version] 519# @USAGE: [version]
520# @DESCRIPTION: 520# @DESCRIPTION:
521# Returns libname with proper suffix {.so,.dylib} and optionally supplied version 521# Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
522# for ELF/MACH-O shared objects 522# supplied version for the current platform identified by CHOST.
523# 523#
524# Example: 524# Example:
525# get_libname libfoo ${PV} 525# get_libname ${PV}
526# Returns: libfoo.so.${PV} (ELF) || libfoo.${PV}.dylib (MACH) 526# Returns: .so.${PV} (ELF) || .${PV}.dylib (MACH) || ...
527get_libname() { 527get_libname() {
528 local libname 528 local libname
529 local ver=$1 529 local ver=$1
530 case ${CHOST} in 530 case ${CHOST} in
531 *-cygwin|mingw*|*-mingw*) libname="dll";; 531 *-cygwin|mingw*|*-mingw*) libname="dll";;
532 *-darwin*) libname="dylib";; 532 *-darwin*) libname="dylib";;
533 *-aix*) libname="a";;
534 *-mint*) libname="irrelevant";;
535 hppa*-hpux*) libname="sl";;
533 *) libname="so";; 536 *) libname="so";;
534 esac 537 esac
535 538
536 if [[ -z $* ]] ; then 539 if [[ -z $* ]] ; then
537 echo ".${libname}" 540 echo ".${libname}"
538 else 541 else
539 for ver in "$@" ; do 542 for ver in "$@" ; do
540 case ${CHOST} in 543 case ${CHOST} in
541 *-darwin*) echo ".${ver}.${libname}";; 544 *-darwin*) echo ".${ver}.${libname}";;
545 *-aix*) echo ".${libname}";;
546 *-mint*) echo ".${libname}";;
542 *) echo ".${libname}.${ver}";; 547 *) echo ".${libname}.${ver}";;
543 esac 548 esac
544 done 549 done
545 fi 550 fi
546} 551}

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.75

  ViewVC Help
Powered by ViewVC 1.1.20