aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2017-12-16 00:37:20 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2017-12-16 00:37:20 +0100
commita1400fe19c0742910a02e6074be025cc784fb444 (patch)
treef3b3d5feca99dfe7dc142a2f45f85c6d8d67580a
parentVersion 1.4 (diff)
downloadbinutils-config-a1400fe19c0742910a02e6074be025cc784fb444.tar.gz
binutils-config-a1400fe19c0742910a02e6074be025cc784fb444.tar.bz2
binutils-config-a1400fe19c0742910a02e6074be025cc784fb444.zip
Version 1.5
https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/binutils-config/files/binutils-config-1.5?revision=1.2
-rw-r--r--binutils-config26
1 files changed, 16 insertions, 10 deletions
diff --git a/binutils-config b/binutils-config
index 14ee703..8491fde 100644
--- a/binutils-config
+++ b/binutils-config
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/Attic/binutils-config-1.4,v 1.1 2004/12/26 08:30:13 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/Attic/binutils-config-1.5,v 1.2 2004/12/31 10:24:58 eradicator Exp $
# Format of /etc/env.d/binutils/:
# config-TARGET: CURRENT=version for TARGET
@@ -33,7 +33,7 @@ USAGE_END
[[ $# -lt 1 ]] && usage && exit 1
switch_profile() {
- unset TARGET VER LIBPATH
+ unset TARGET VER LIBPATH FAKE_TARGETS
source "${ENV_D}/${PROFILE}"
if [[ -z ${TARGET} ]] ; then
eerror "${PROFILE} is invalid (no \$TARGET defined) :("
@@ -48,6 +48,8 @@ switch_profile() {
#
# Generate binary symlinks
+ # On systems that do 32bit/64bit, we need to fake an
+ # extra set of binary names (${FAKE_TARGETS})
#
BINPATH="/usr/${TARGET}/binutils-bin/${VER}"
cd "${ROOT}/${BINPATH}" || exit 1
@@ -55,8 +57,12 @@ switch_profile() {
for x in * ; do
ln -sf "${BINPATH}/${x}" "${ROOT}"/usr/${TARGET}/bin/${x}
ln -sf ../${TARGET}/bin/${x} "${ROOT}"/usr/bin/${TARGET}-${x}
- if [[ ${TARGET} == ${HOST} ]] ; then
+ if [[ ${TARGET} = "${HOST}" ]] ; then
ln -sf ${TARGET}-${x} "${ROOT}"/usr/bin/${x}
+
+ for fake in ${FAKE_TARGETS} ; do
+ ln -sf ../${TARGET}/bin/${x} "${ROOT}"/usr/bin/${fake}-${x}
+ done
fi
done
@@ -73,7 +79,7 @@ switch_profile() {
rm -f "${ROOT}"/usr/${TARGET}/lib/ldscripts
fi
ln -sf "${LIBPATH}/ldscripts" "${ROOT}"/usr/${TARGET}/lib/ldscripts
- if [[ ${TARGET} = ${HOST} ]] ; then
+ if [[ ${TARGET} = "${HOST}" ]] ; then
dstlib="${ROOT}"/usr/${HOST}/lib
else
dstlib="${ROOT}"/usr/${HOST}/${TARGET}/lib
@@ -88,7 +94,7 @@ switch_profile() {
#
INCPATH="${LIBPATH}/include"
cd "${ROOT}/${INCPATH}" || exit 1
- if [[ ${TARGET} = ${HOST} ]] ; then
+ if [[ ${TARGET} = "${HOST}" ]] ; then
dstinc="${ROOT}"/usr/include
else
dstinc="${ROOT}"/usr/${TARGET}/include
@@ -101,7 +107,7 @@ switch_profile() {
#
# Make sure proper paths get updated
#
- if [[ ${TARGET} = ${HOST} ]] ; then
+ if [[ ${TARGET} = "${HOST}" ]] ; then
DATAPATH="/usr/share/binutils-data/${TARGET}/${VER}"
echo "MANPATH=${DATAPATH}/man" > "${ROOT}"/etc/env.d/05binutils
echo "INFOPATH=${DATAPATH}/info" >> "${ROOT}"/etc/env.d/05binutils
@@ -115,7 +121,7 @@ switch_profile() {
#
# Regen env.d if need/can be
#
- if [[ ${ROOT} = "/" ]] && [[ ${TARGET} = ${HOST} ]] ; then
+ if [[ ${ROOT} = "/" ]] && [[ ${TARGET} = "${HOST}" ]] ; then
env-update
echo
ewarn "Please remember to run:"
@@ -128,7 +134,7 @@ switch_profile() {
}
uninstall_target() {
- if [[ ${TARGET} = ${HOST} ]] ; then
+ if [[ ${TARGET} = "${HOST}" ]] ; then
eerror "$0: Refusing to uninstall native binutils"
exit 1
fi
@@ -184,7 +190,7 @@ list_profiles() {
fi
target=
for x in "${ENV_D}"/* ; do
- if [[ -f ${x} ]] && [[ ${x/\/config-} = ${x} ]] ; then
+ if [[ -f ${x} ]] && [[ ${x/\/config-} = "${x}" ]] ; then
source "${x}"
if [[ ${target} != ${TARGET} ]] ; then
[[ -n ${target} ]] && echo
@@ -194,7 +200,7 @@ list_profiles() {
x="${x##*/}"
if [[ -e ${ENV_D}/config-${TARGET} ]] ; then
source "${ENV_D}/config-${TARGET}"
- [ "${VER}" == "${CURRENT}" ] && x="${x} *"
+ [[ ${VER} = "${CURRENT}" ]] && x="${x} *"
fi
echo " [${i}] ${x}"
i=$((i + 1))