aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-06-21 13:34:06 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2020-06-21 13:34:06 +0100
commit94639ce75a496f0fa5499e9fe91162556891370f (patch)
tree17f702d0542b24d8ab24e828fb5eb5b9b00082e1 /src
parentbinutils-config: fix native link removal by cross-compilers, bug #724454 (diff)
downloadbinutils-config-94639ce75a496f0fa5499e9fe91162556891370f.tar.gz
binutils-config-94639ce75a496f0fa5499e9fe91162556891370f.tar.bz2
binutils-config-94639ce75a496f0fa5499e9fe91162556891370f.zip
src/binutils-config: add --get-bin-path / --get-lib-path
The options are symmetric to gcc-config's --get-bin-path / --get-lib-path. Useful to quickly get unprefixed tools into $PATH as: export PATH="$(gcc-config -B):$(binutils-config -B):$PATH" Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/binutils-config17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/binutils-config b/src/binutils-config
index da99021..625c1b8 100755
--- a/src/binutils-config
+++ b/src/binutils-config
@@ -42,6 +42,11 @@ ${HILITE}General Options:${NORMAL}
${GOOD}-u, --uninstall${NORMAL} Remove all signs of specified target
${GOOD}-d, --debug${NORMAL} Execute with debug output
+ ${GOOD}-B, --get-bin-path${NORMAL} Print path where binaries of the given/current
+ profile are located.
+ ${GOOD}-L, --get-lib-path${NORMAL} Print path where libraries of the given/current
+ profile are located.
+
Profile names are of the form: ${BRACKET}<CTARGET>-<binutils version>${NORMAL}
For example: ${BRACKET}i686-pc-linux-gnu-2.15.92.0.2${NORMAL}
@@ -321,6 +326,16 @@ set_current_profile() {
}
get_current_profile() { echo "${PROFILE}" ; }
+get_bin_path() {
+ setup_env || return 1
+ echo "${BINPATH}"
+}
+
+get_lib_path() {
+ setup_env || return 1
+ echo "${LIBPATH}"
+}
+
list_profiles() {
local x i target
@@ -397,6 +412,8 @@ while [[ $# -gt 0 ]] ; do
x=$1
shift
case ${x} in
+ -B|--get-bin-path) select_action get_bin_path ;;
+ -L|--get-lib-path) select_action get_lib_path ;;
-c|--get-current-profile) select_action get_current_profile ;;
-l|--list|--list-profiles) select_action list_profiles ;;
-u|--uninstall) select_action uninstall_target ;;