Skip to content

Commit

Permalink
auto merge of #10584 : klutzy/rust/local-rust-root, r=alexcrichton
Browse files Browse the repository at this point in the history
Fixes #8756.
  • Loading branch information
bors committed Nov 21, 2013
2 parents 85a1eff + 11b6aed commit 8464004
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
12 changes: 9 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,20 @@ then
fi
fi

BIN_SUF=
if [ $CFG_OSTYPE = "pc-mingw32" ]
then
BIN_SUF=.exe
fi

if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
then
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc ]
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
then
err "no local rust to use"
else
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: " $LRV
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
fi
fi

Expand Down
21 changes: 11 additions & 10 deletions src/etc/local_stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
TARG_DIR=$1
PREFIX=$2

BINDIR=bin
LIBDIR=lib
LIB_DIR=lib
LIB_PREFIX=lib

OS=`uname -s`
case $OS in
Expand All @@ -21,7 +21,8 @@ case $OS in
(*)
BIN_SUF=.exe
LIB_SUF=.dll
LIBDIR=bin
LIB_DIR=bin
LIB_PREFIX=
break
;;
esac
Expand All @@ -31,7 +32,7 @@ if [ -z $PREFIX ]; then
exit 1
fi

if [ ! -e ${PREFIX}/bin/rustc ]; then
if [ ! -e ${PREFIX}/bin/rustc${BIN_SUF} ]; then
echo "No local rust installed at ${PREFIX}"
exit 1
fi
Expand All @@ -41,9 +42,9 @@ if [ -z $TARG_DIR ]; then
exit 1
fi

cp ${PREFIX}/bin/rustc ${TARG_DIR}/stage0/bin/
cp ${PREFIX}/lib/rustc/${TARG_DIR}/${LIBDIR}/* ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/lib/libextra*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/lib/librust*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/lib/libstd*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/lib/libsyntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
cp ${PREFIX}/${LIB_DIR}/rustc/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/

0 comments on commit 8464004

Please sign in to comment.