aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binutils-config13
1 files changed, 11 insertions, 2 deletions
diff --git a/binutils-config b/binutils-config
index e9ab57b..bd80b06 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.2,v 1.1 2004/12/15 17:00:30 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/Attic/binutils-config-1.3,v 1.1 2004/12/16 02:30:56 vapier Exp $
# Format of /etc/env.d/binutils/:
# config-TARGET: CURRENT=version for TARGET
@@ -33,7 +33,16 @@ USAGE_END
[[ $# -lt 1 ]] && usage && exit 1
switch_profile() {
+ unset TARGET VER LIBPATH
source "${ENV_D}/${PROFILE}"
+ if [[ -z ${TARGET} ]] ; then
+ eerror "${PROFILE} is invalid (no \$TARGET defined) :("
+ return 1
+ fi
+ if [[ -z ${VER} ]] ; then
+ eerror "${PROFILE} is invalid (no \$VER defined) :("
+ return 1
+ fi
ebegin "Switching to ${PROFILE}"
@@ -54,7 +63,7 @@ switch_profile() {
#
# Generate library / ldscripts symlinks
#
- LIBPATH="/usr/lib/binutils/${TARGET}/${VER}"
+ LIBPATH="${LIBPATH:-/usr/lib/binutils/${TARGET}/${VER}}"
cd "${ROOT}/${LIBPATH}" || exit 1
mkdir -p "${ROOT}"/usr/${TARGET}/lib
if [[ -d ${ROOT}/usr/${TARGET}/lib/ldscripts ]] ; then