/[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.77
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.77 2009/10/08 20:10:56 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
475# Helper function for create_ml_includes 475# Helper function for create_ml_includes
476create_ml_includes-makedestdirs() { 476create_ml_includes-makedestdirs() {
477 local dest=$1 477 local dest=$1
478 shift 478 shift
479 local basedirs=$@ 479 local basedirs=$@
480 [[ -z ${ED} ]] && local ED=${D}
480 481
481 dodir ${dest} 482 dodir ${dest}
482 483
483 local basedir 484 local basedir
484 for basedir in ${basedirs}; do 485 for basedir in ${basedirs}; do
485 local dir 486 local dir
486 for dir in $(find "${D}"/${basedir} -type d); do 487 for dir in $(find "${ED}"/${basedir} -type d); do
487 dodir ${dest}/${dir/${D}\/${basedir}/} 488 dodir ${dest}/${dir/${ED}\/${basedir}/}
488 done 489 done
489 done 490 done
490} 491}
491 492
492# Helper function for create_ml_includes 493# Helper function for create_ml_includes
493create_ml_includes-allfiles() { 494create_ml_includes-allfiles() {
495 [[ -z ${ED} ]] && local ED=${D}
494 local basedir file 496 local basedir file
495 for basedir in "$@" ; do 497 for basedir in "$@" ; do
496 for file in $(find "${D}"/${basedir} -type f); do 498 for file in $(find "${ED}"/${basedir} -type f); do
497 echo ${file/${D}\/${basedir}\//} 499 echo ${file/${ED}\/${basedir}\//}
498 done 500 done
499 done | sort | uniq 501 done | sort | uniq
500} 502}
501 503
502# Helper function for create_ml_includes 504# Helper function for create_ml_includes
516} 518}
517 519
518# @FUNCTION: get_libname 520# @FUNCTION: get_libname
519# @USAGE: [version] 521# @USAGE: [version]
520# @DESCRIPTION: 522# @DESCRIPTION:
521# Returns libname with proper suffix {.so,.dylib} and optionally supplied version 523# Returns libname with proper suffix {.so,.dylib,.dll,etc} and optionally
522# for ELF/MACH-O shared objects 524# supplied version for the current platform identified by CHOST.
523# 525#
524# Example: 526# Example:
525# get_libname libfoo ${PV} 527# get_libname ${PV}
526# Returns: libfoo.so.${PV} (ELF) || libfoo.${PV}.dylib (MACH) 528# Returns: .so.${PV} (ELF) || .${PV}.dylib (MACH) || ...
527get_libname() { 529get_libname() {
528 local libname 530 local libname
529 local ver=$1 531 local ver=$1
530 case ${CHOST} in 532 case ${CHOST} in
531 *-cygwin|mingw*|*-mingw*) libname="dll";; 533 *-cygwin|mingw*|*-mingw*) libname="dll";;
532 *-darwin*) libname="dylib";; 534 *-darwin*) libname="dylib";;
535 *-aix*) libname="a";;
536 *-mint*) libname="irrelevant";;
537 hppa*-hpux*) libname="sl";;
533 *) libname="so";; 538 *) libname="so";;
534 esac 539 esac
535 540
536 if [[ -z $* ]] ; then 541 if [[ -z $* ]] ; then
537 echo ".${libname}" 542 echo ".${libname}"
538 else 543 else
539 for ver in "$@" ; do 544 for ver in "$@" ; do
540 case ${CHOST} in 545 case ${CHOST} in
541 *-darwin*) echo ".${ver}.${libname}";; 546 *-darwin*) echo ".${ver}.${libname}";;
547 *-aix*) echo ".${libname}";;
548 *-mint*) echo ".${libname}";;
542 *) echo ".${libname}.${ver}";; 549 *) echo ".${libname}.${ver}";;
543 esac 550 esac
544 done 551 done
545 fi 552 fi
553}
554
555# @FUNCTION: get_modname
556# @USAGE:
557# @DESCRIPTION:
558# Returns modulename with proper suffix {.so,.bundle,etc} for the current
559# platform identified by CHOST.
560#
561# Example:
562# libfoo$(get_modname)
563# Returns: libfoo.so (ELF) || libfoo.bundle (MACH) || ...
564get_modname() {
565 local modname
566 local ver=$1
567 case ${CHOST} in
568 *-darwin*) modname="bundle";;
569 *) modname="so";;
570 esac
571
572 echo ".${modname}"
546} 573}
547 574
548# This is for the toolchain to setup profile variables when pulling in 575# This is for the toolchain to setup profile variables when pulling in
549# a crosscompiler (and thus they aren't set in the profile) 576# a crosscompiler (and thus they aren't set in the profile)
550multilib_env() { 577multilib_env() {

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

  ViewVC Help
Powered by ViewVC 1.1.20