| Alex Crichton | 32dc227 | 2015-09-18 17:54:12 -0700 | [diff] [blame] | 1 | # This is **not** meant to be run on CI, but rather locally instead. If you're |
| 2 | # on a Linux machine you'll be able to run most of these, but otherwise this'll |
| 3 | # just attempt to run as many platforms as possible! |
| 4 | |
| 5 | run() { |
| 6 | _target=$1 |
| 7 | _cc=$2 |
| 8 | if [ "$_cc" != "" ]; then |
| 9 | which $_cc > /dev/null |
| 10 | if [ $? -ne 0 ]; then |
| 11 | echo "$_cc not installed, skipping $_target" |
| 12 | return |
| 13 | fi |
| 14 | export CC=$_cc |
| 15 | fi |
| 16 | if [ ! -d .cargo ]; then |
| 17 | mkdir .cargo |
| 18 | cp ci/cargo-config .cargo/config |
| 19 | fi |
| 20 | sh ci/run.sh $_target |
| Alex Crichton | f0c68f3 | 2015-11-02 15:25:18 -0800 | [diff] [blame] | 21 | if [ "$?" != "0" ]; then |
| 22 | exit 1 |
| 23 | fi |
| Alex Crichton | 32dc227 | 2015-09-18 17:54:12 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | OS=`uname` |
| 27 | if [ "$OS" = "Linux" ]; then |
| 28 | # For more info on where to get all these cross compilers see |
| 29 | # ci/run-travis.sh and what packages are needed on ubuntu |
| 30 | run x86_64-unknown-linux-gnu clang |
| 31 | run i686-unknown-linux-gnu clang |
| 32 | run x86_64-unknown-linux-musl musl-gcc |
| 33 | run mips-unknown-linux-gnu mips-linux-gnu-gcc |
| 34 | run aarch64-unknown-linux-gnu aarch64-linux-gnueabihf-gcc |
| 35 | run arm-unknown-linux-gnueabihf arm-linux-gnueabihf-gcc-4.7 |
| 36 | |
| 37 | # Prep for this by running `vagrant up freebsd` in the `ci` directory |
| 38 | (cd ci && vagrant ssh freebsd -c \ |
| 39 | "cd /vagrant && sh ci/run.sh x86_64-unknown-freebsd") |
| 40 | |
| 41 | # Make sure you've run `docker pull alexcrichton/rust-libc-test` to get |
| 42 | # this image ahead of time. |
| 43 | docker run -itv `pwd`:/clone alexcrichton/rust-libc-test \ |
| 44 | sh ci/run.sh arm-linux-androideabi |
| 45 | elif [ "$OS" = "Darwin" ]; then |
| 46 | cargo run --target x86_64-unknown-linux-gnu |
| 47 | cargo run --target i686-unknown-linux-gnu |
| 48 | fi |