Raymes Khoury | b25b321 | 2011-03-22 12:43:56 -0700 | [diff] [blame] | 1 | # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | # $Header: |
| 5 | |
| 6 | # @ECLASS: binutils-funcs.eclass |
| 7 | # @MAINTAINER: |
| 8 | # Raymes Khoury <raymes@google.com> |
| 9 | # @DESCRIPTION: |
| 10 | # Functions to get the paths to binutils installations for gold and for GNU ld. |
| 11 | |
| 12 | inherit toolchain-funcs |
| 13 | |
| 14 | get_binutils_path_ld() { |
Zdenek Behan | cc60eb3 | 2012-02-23 00:21:58 +0100 | [diff] [blame] | 15 | local ld_path=$(readlink -f $(type -p $(tc-getLD ${1}))) |
| 16 | local binutils_dir=$(dirname ${ld_path}) |
Raymes Khoury | b25b321 | 2011-03-22 12:43:56 -0700 | [diff] [blame] | 17 | echo ${binutils_dir} |
| 18 | } |
| 19 | |
| 20 | get_binutils_path_gold() { |
Zdenek Behan | cc60eb3 | 2012-02-23 00:21:58 +0100 | [diff] [blame] | 21 | echo $(get_binutils_path_ld ${1})-gold |
Raymes Khoury | b25b321 | 2011-03-22 12:43:56 -0700 | [diff] [blame] | 22 | } |