/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

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

Revision 1.193 Revision 1.194
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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/flag-o-matic.eclass,v 1.193 2013/12/27 21:27:38 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.194 2013/12/27 21:39:36 robbat2 Exp $
4 4
5# @ECLASS: flag-o-matic.eclass 5# @ECLASS: flag-o-matic.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# toolchain@gentoo.org 7# toolchain@gentoo.org
8# @BLURB: common functions to manipulate and query toolchain flags 8# @BLURB: common functions to manipulate and query toolchain flags
597} 597}
598 598
599# @FUNCTION: append-libs 599# @FUNCTION: append-libs
600# @USAGE: <libs> 600# @USAGE: <libs>
601# @DESCRIPTION: 601# @DESCRIPTION:
602# Add extra <libs> to the current LIBS. 602# Add extra <libs> to the current LIBS. All arguments should prefixed with
603# either -l or -L. For compatability, if arguments are not prefixed as
604# options, they are given a -l prefix automatically.
603append-libs() { 605append-libs() {
604 [[ $# -eq 0 ]] && return 0 606 [[ $# -eq 0 ]] && return 0
605 local flag 607 local flag
606 for flag in "$@"; do 608 for flag in "$@"; do
607 [[ ${flag} == -l* ]] && flag=${flag#-l} 609 case $flag in
608 if [[ ${flag} == -* ]]; then 610 -[lL]*)
611 export LIBS="${LIBS} ${flag}"
612 ;;
613 -*)
609 eqawarn "Appending non-library to LIBS (${flag}); Other linker flags should be passed via LDFLAGS" 614 eqawarn "Appending non-library to LIBS (${flag}); Other linker flags should be passed via LDFLAGS"
610 export LIBS="${LIBS} ${flag}" 615 export LIBS="${LIBS} ${flag}"
611 else 616 ;;
617 *)
612 export LIBS="${LIBS} -l${flag}" 618 export LIBS="${LIBS} -l${flag}"
613 fi 619 esac
614 done 620 done
615 621
616 return 0 622 return 0
617} 623}
618 624

Legend:
Removed from v.1.193  
changed lines
  Added in v.1.194

  ViewVC Help
Powered by ViewVC 1.1.20