diff options
author | 2017-12-16 00:43:28 +0100 | |
---|---|---|
committer | 2017-12-16 00:43:28 +0100 | |
commit | 22d405a097ad50a7009a796586b550a1454be450 (patch) | |
tree | d0afb195b0752e3f5b14332bc86bd03ea5dd3c9e | |
parent | Version 3 (diff) | |
download | binutils-config-22d405a097ad50a7009a796586b550a1454be450.tar.gz binutils-config-22d405a097ad50a7009a796586b550a1454be450.tar.bz2 binutils-config-22d405a097ad50a7009a796586b550a1454be450.zip |
Version 4
https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/binutils-config/files/binutils-config-4?revision=1.4
-rw-r--r-- | binutils-config | 66 |
1 files changed, 11 insertions, 55 deletions
diff --git a/binutils-config b/binutils-config index 5f21878..7309d9c 100644 --- a/binutils-config +++ b/binutils-config @@ -1,7 +1,7 @@ #!/bin/bash -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-3,v 1.11 2013/05/05 05:20:42 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-4,v 1.4 2015/05/25 06:07:20 vapier Exp $ # Format of /etc/env.d/binutils/: # config-TARGET: CURRENT=version for TARGET @@ -16,8 +16,9 @@ cd / trap ":" INT QUIT TSTP argv0=${0##*/} -source /etc/init.d/functions.sh || { - echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2 +FUNCTIONS_SH="/lib/gentoo/functions.sh" +source ${FUNCTIONS_SH} || { + echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2 exit 1 } esyslog() { :; } @@ -37,12 +38,6 @@ ${HILITE}General Options:${NORMAL} ${HILITE}General Cruft:${NORMAL} ${GOOD}--linker${NORMAL} <linker> Switch to specified linker (if supported) -${HILITE}Arch Specific Cruft:${NORMAL} - ${GOOD}--amd64${NORMAL} Install extra amd64 links (x86_64) - ${GOOD}--arm${NORMAL} Install extra arm links (arm/armeb) - ${GOOD}--mips${NORMAL} Install extra mips links (mips/mipsel) - ${GOOD}--x86${NORMAL} Install extra x86 links (i[3-6]86) - Profile names are of the form: ${BRACKET}<CTARGET>-<binutils version>${NORMAL} For example: ${BRACKET}i686-pc-linux-gnu-2.15.92.0.2${NORMAL} @@ -81,7 +76,7 @@ atomic_ln() { } setup_env() { - unset TARGET VER LIBPATH FAKE_TARGETS + unset TARGET VER LIBPATH source "${ENV_D}/${PROFILE}" if [[ -z ${TARGET} ]] ; then eerror "${PROFILE} is invalid (no \$TARGET defined) :(" @@ -93,28 +88,7 @@ setup_env() { fi # - # Older installs don't have 'FAKE_TARGETS' defined, so lets - # update these env.d entries so that we don't force the poor - # user to re-emerge their binutils just for 1 envvar :/ - # - if [[ ${FAKE_TARGETS-poor user} == "poor user" ]] ; then - local targ=${TARGET/-*} - local FAKE_TARGETS=${TARGET} - case ${targ} in - mips|powerpc|sparc) - FAKE_TARGETS="${FAKE_TARGETS} ${TARGET/-/64-}";; - mips64|powerpc64|sparc64) - FAKE_TARGETS="${FAKE_TARGETS} ${TARGET/64-/-}";; - esac - echo "FAKE_TARGETS=\"${FAKE_TARGETS}\"" >> "${ENV_D}/${PROFILE}" - fi - local fake_targ_append="${TARGET#*-}" - FAKE_TARGETS="${FAKE_TARGETS} ${FAKE_TARGETS_USER// /-${fake_targ_append} }" - - # # Generate binary symlinks - # On systems that do 32bit/64bit, we need to fake an - # extra set of binary names (${FAKE_TARGETS}) # BINPATH="" BINPATH_LINKS="" @@ -143,11 +117,7 @@ switch_profile() { mkdir -p "${ROOT}/${BINPATH_LINKS}" "${ROOT}/usr/bin" for x in * ; do atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}" - atomic_ln "${BINPATH_LINKS}/${x}" "${ROOT}/usr/bin/" "${TARGET}-${x}" - for fake in ${FAKE_TARGETS} ; do - [[ -f ${ENV_D}/config-${fake} ]] && continue - atomic_ln "${BINPATH_LINKS}/${x}" "${ROOT}/usr/bin" "${fake}-${x}" - done + atomic_ln "${BINPATH_LINKS}/${x}" "${ROOT}/usr/bin" "${TARGET}-${x}" if [[ ${TARGET} == ${HOST} ]] ; then atomic_ln "${TARGET}-${x}" "${ROOT}/usr/bin" "${x}" fi @@ -200,8 +170,8 @@ switch_profile() { local e="${ROOT}"/etc/env.d/05binutils local ee="${e}.tmp" rm -f "${ee}" - [[ -d ${DATAPATH}/man ]] && echo "MANPATH=${DATAPATH}/man" >> "${ee}" - [[ -d ${DATAPATH}/info ]] && echo "INFOPATH=${DATAPATH}/info" >> "${ee}" + [[ -d ${ROOT}/${DATAPATH}/man ]] && echo "MANPATH=${DATAPATH}/man" >> "${ee}" + [[ -d ${ROOT}/${DATAPATH}/info ]] && echo "INFOPATH=${DATAPATH}/info" >> "${ee}" # hmm, `ld` has this in SEARCH_DIR(), but ld.so does not ... if [[ -d ${ROOT}/etc/ld.so.conf.d ]] ; then local l="${ROOT}"/etc/ld.so.conf.d/05binutils.conf @@ -254,9 +224,8 @@ uninstall_target() { die "no profiles exist for '${TARGET}'" fi - rm -f "${ENV_D}"/config-${TARGET} "${ROOT}"/etc/ld.so.conf.d/05binutils.conf + rm -f "${ENV_D}"/config-${TARGET} - # XXX: we still leave behind FAKE_TARGETS in /usr/bin ... local x for x in \ addr2line ar as c++filt elf2flt elfedit flthdr gprof \ @@ -390,7 +359,6 @@ DEBUG="no" NEED_ACTION="yes" DOIT="switch_profile" PROFILE="current" -FAKE_TARGETS_USER="" HOST="" TARGET="" unset UARG @@ -416,25 +384,13 @@ while [[ $# -gt 0 ]] ; do -h|--help) usage 0 ;; -V|--version) unset Header - cvsver="$Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-3,v 1.11 2013/05/05 05:20:42 vapier Exp $" + cvsver="$Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-4,v 1.4 2015/05/25 06:07:20 vapier Exp $" cvsver=${cvsver##*binutils-config-} bver=${cvsver%%,v *} cvsver=${cvsver#* } echo "binutils-config-${bver} (r${cvsver%% *})" exit 0 ;; - --amd64|--arm|--mips|--x86) - if [[ ${NEED_ACTION} == "yes" ]] ; then - # Make sure we have a space after each target - NEED_ACTION="no" - case ${x} in - --amd64) FAKE_TARGETS_USER="x86_64 ";; - --arm) FAKE_TARGETS_USER="arm armeb ";; - --x86) FAKE_TARGETS_USER="i386 i486 i586 i686 ";; - --mips) FAKE_TARGETS_USER="mips mips64 mipsel mipsel64 ";; - esac - fi - ;; -*) die "invalid switch! Try '--help'." ;; |