From 94639ce75a496f0fa5499e9fe91162556891370f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 21 Jun 2020 13:34:06 +0100 Subject: 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 --- src/binutils-config | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') 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}-${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 ;; -- cgit v1.2.3-65-gdbad