-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstage4-dragonfly.sh
51 lines (38 loc) · 1.05 KB
/
stage4-dragonfly.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
50
51
#!/bin/sh
. ./config.sh
assert_dragonfly
if [ -e "/usr/local/bin/rustc" ]; then
echo "Does not work when rustc installed! Please remove rustc:"
echo " rm /usr/local/bin/{rustc,rust-gdb,rustdoc}"
echo " rm -rf /usr/local/lib/lib*-????????.so"
echo " rm -rf /usr/local/lib/rustlib"
exit 1
fi
TOP=`pwd`
PREFIX=/usr/local
DST_DIR=${TOP}/stage4-dragonfly
RUST_SRC=${TOP}/stage4-dragonfly/rust
LOCAL_RUST_ROOT=${TOP}/stage3-dragonfly
LLVM_ROOT=${TOP}/stage1-dragonfly/llvm-install
if [ ! -e "stage3-dragonfly/bin/rustc" ]; then
echo "stage3-dragonfly/bin/rustc does not exist!"
exit 1
fi
mkdir -p ${DST_DIR}
if [ ! -e ${RUST_SRC} ]; then
cd ${DST_DIR}
extract_source_into rust
patch_source_all
fi
cd ${RUST_SRC}
#export RUST_BACKTRACE=1
# --enable-rpath ??
if [ " ${USE_CACHED_LLVM}" = "YES" ]; then
add="--llvm-root=${LLVM_ROOT}"
fi
./configure ${add} --enable-local-rust --local-rust-root=${LOCAL_RUST_ROOT} --prefix=$PREFIX --disable-docs
gmake
gmake snap-stage3
#p=`pwd`
#gmake snap-stage3
#echo "To install to $PREFIX: cd $p && gmake install"