summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2013-12-27 21:39:36 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2013-12-27 21:39:36 +0000
commit98605b5a389c1ae643866fb0b0b67812a419c156 (patch)
tree40ff0eb7089a2fd70f54fbe8bb3efada4d061ab1 /eclass/flag-o-matic.eclass
parentVersion bump (and synchronize with -9999) (diff)
downloadhistorical-98605b5a389c1ae643866fb0b0b67812a419c156.tar.gz
historical-98605b5a389c1ae643866fb0b0b67812a419c156.tar.bz2
historical-98605b5a389c1ae643866fb0b0b67812a419c156.zip
Per discussion with Flameeyes, make -l and -L always valid, and only warn about other arguments to append-libs. Also document expected arguments to append-libs.
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass24
1 files changed, 15 insertions, 9 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 7a44adf652b6..be05937b92f9 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 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.193 2013/12/27 21:27:38 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.194 2013/12/27 21:39:36 robbat2 Exp $
# @ECLASS: flag-o-matic.eclass
# @MAINTAINER:
@@ -599,18 +599,24 @@ replace-sparc64-flags() {
# @FUNCTION: append-libs
# @USAGE: <libs>
# @DESCRIPTION:
-# Add extra <libs> to the current LIBS.
+# Add extra <libs> to the current LIBS. All arguments should prefixed with
+# either -l or -L. For compatability, if arguments are not prefixed as
+# options, they are given a -l prefix automatically.
append-libs() {
[[ $# -eq 0 ]] && return 0
local flag
for flag in "$@"; do
- [[ ${flag} == -l* ]] && flag=${flag#-l}
- if [[ ${flag} == -* ]]; then
- eqawarn "Appending non-library to LIBS (${flag}); Other linker flags should be passed via LDFLAGS"
- export LIBS="${LIBS} ${flag}"
- else
- export LIBS="${LIBS} -l${flag}"
- fi
+ case $flag in
+ -[lL]*)
+ export LIBS="${LIBS} ${flag}"
+ ;;
+ -*)
+ eqawarn "Appending non-library to LIBS (${flag}); Other linker flags should be passed via LDFLAGS"
+ export LIBS="${LIBS} ${flag}"
+ ;;
+ *)
+ export LIBS="${LIBS} -l${flag}"
+ esac
done
return 0