From e0f8186c7ac97c6feb1f744722f78b2fe2e00afd Mon Sep 17 00:00:00 2001 From: Jonathan Callen Date: Fri, 2 Apr 2010 02:50:29 +0000 Subject: Add append-libs() function --- eclass/flag-o-matic.eclass | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'eclass') diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index b63eca4fa2df..0a0d565e87c6 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.146 2010/02/17 18:20:49 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.147 2010/04/02 02:50:29 abcd Exp $ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: @@ -668,6 +668,21 @@ replace-sparc64-flags() { export CFLAGS CXXFLAGS } +# @FUNCTION: append-libs +# @USAGE: +# @DESCRIPTION: +# Add extra to the current LIBS. +append-libs() { + [[ -z $* ]] && return 0 + local flag + for flag in "$@"; do + [[ ${flag} == -l* ]] && flag=${flag#-l} + export LIBS="${LIBS} -l${flag}" + done + + return 0 +} + # @FUNCTION: append-ldflags # @USAGE: # @DESCRIPTION: -- cgit v1.2.3-65-gdbad