forked from Ogeon/rust-on-raspberry-pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcross64
executable file
·32 lines (25 loc) · 924 Bytes
/
cross64
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
#!/bin/sh
rust=$2
tools=$3
: ${rust:="$HOME/pi-rust"}
: ${tools:="$HOME/pi-tools"}
export SYSROOT="$tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot"
#Point rustc to the standard libraries
export LD_LIBRARY_PATH="$rust/lib":$LD_LIBRARY_PATH
#Include the cross copilation binaries
export PATH="$rust/bin":"$tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin":$PATH
if [ "$1" != "doc" ]
then
#Set up our tools for anyting using these variables
export CC="$tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot"
export CXX="$tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/g++-sysroot"
export AR="$tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-ar"
#Set target triple
flags="--target=arm-unknown-linux-gnueabihf"
fi
if [ "$1" != "-v" ]
then
cargo $1 $flags
else
rustc -vV
fi