forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_stage0.sh
executable file
·49 lines (42 loc) · 906 Bytes
/
local_stage0.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/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}/