#!/bin/sh

TARG_DIR=$1
PREFIX=$2

BINDIR=bin
LIBDIR=lib

OS=`uname -s`
case $OS in
    ("Linux"|"FreeBSD")
	BIN_SUF=
	LIB_SUF=.so
	break
	;;
    ("Darwin")
	BIN_SUF=
	LIB_SUF=.dylib
	break
	;;
    (*)
	BIN_SUF=.exe
	LIB_SUF=.dll
	LIBDIR=bin
	break
	;;
esac

if [ -z $PREFIX ]; then
    echo "No local rust specified."
    exit 1
fi

if [ ! -e ${PREFIX}/bin/rustc ]; then
    echo "No local rust installed at ${PREFIX}"
    exit 1
fi

if [ -z $TARG_DIR ]; then
    echo "No target directory specified."
    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/librust*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
cp ${PREFIX}/lib/libcore*${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}/

#!/bin/sh

TARG_DIR=$1
PREFIX=$2

BINDIR=bin
LIBDIR=lib

OS=`uname -s`
case $OS in
    ("Linux"|"FreeBSD")
	BIN_SUF=
	LIB_SUF=.so
	break
	;;
    ("Darwin")
	BIN_SUF=
	LIB_SUF=.dylib
	break
	;;
    (*)
	BIN_SUF=.exe
	LIB_SUF=.dll
	LIBDIR=bin
	break
	;;
esac

if [ -z $PREFIX ]; then
    echo "No local rust specified."
    exit 1
fi

if [ ! -e ${PREFIX}/bin/rustc ]; then
    echo "No local rust installed at ${PREFIX}"
    exit 1
fi

if [ -z $TARG_DIR ]; then
    echo "No target directory specified."
    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}/

Copy the correct libs when using local-rust-root
Copy the correct libs when using local-rust-root

This fixes a segfault when configuring rust to use local-rust-root. The
libraries were renamed in the 0.6-0.7 transition, and the script was not copying
them all. I also removed the line referencing libcore (now libstd).
