diff options
Diffstat (limited to 'src/binutils-config')
-rwxr-xr-x | src/binutils-config | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/binutils-config b/src/binutils-config index 69ca530..e6819a8 100755 --- a/src/binutils-config +++ b/src/binutils-config @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Format of /etc/env.d/binutils/: @@ -130,8 +130,17 @@ switch_profile() { for x in * ; do atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}" atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" "${TARGET}-${x}" - if [[ ${TARGET} == ${HOST} ]] ; then + if [[ ${TARGET} == ${HOST} -a ${USE_NATIVE_LINKS} == yes ]] ; then atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}" + else + # Remove native links if exist from previous + # installations or set by user manually. binutils-config + # owns these symlinks. + # + # TODO: cleanup symlinks not just known to this + # release/configuration of binutils, but also list + # all possible ones. + rm -f "${EROOT}/usr/bin/${x}" fi done @@ -357,6 +366,7 @@ DOIT="switch_profile" PROFILE="current" HOST="" TARGET="" +USE_NATIVE_LINKS="@USE_NATIVE_LINKS@" unset UARG select_action() { @@ -377,6 +387,8 @@ while [[ $# -gt 0 ]] ; do -u|--uninstall) select_action uninstall_target ;; -d|--debug) DEBUG="yes" ;; -h|--help) usage 0 ;; + --enable-native-links) USE_NATIVE_LINKS="yes" ;; + --disable-native-links) USE_NATIVE_LINKS="no" ;; -V|--version) ver="@PV@" echo "binutils-config-${ver/@'PV'@/git}" |