• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3set -e
4
5: ${N_JOBS:=2}
6
7if [ "$STL" != "" ]
8then
9  STLARG="-stdlib=$STL"
10fi
11
12case $OS in
13linux*)
14    case $OS in
15    linux)     DOCKER_IMAGE="polettimarco/fruit-basesystem:ubuntu-$UBUNTU" ;;
16    linux-arm) docker run --rm --privileged multiarch/qemu-user-static:register --reset
17               DOCKER_IMAGE="polettimarco/fruit-basesystem:ubuntu_arm-$UBUNTU" ;;
18    esac
19    docker rm -f fruit &>/dev/null || true
20    docker run -d -it --name fruit --privileged "${DOCKER_IMAGE}"
21    docker exec fruit mkdir fruit
22    docker cp . fruit:/fruit
23
24    docker exec fruit bash -c "
25        export COMPILER=$COMPILER;
26        export N_JOBS=$N_JOBS;
27        export STLARG=$STLARG;
28        export ASAN_OPTIONS=$ASAN_OPTIONS;
29        export OS=$OS;
30        cd fruit; extras/scripts/postsubmit-helper.sh $1"
31    exit $?
32    ;;
33
34osx)
35    export COMPILER
36    export N_JOBS
37    export STLARG
38    export ASAN_OPTIONS
39    export OS
40    extras/scripts/postsubmit-helper.sh "$@"
41    exit $?
42    ;;
43
44*)
45    echo "Unsupported OS: $OS"
46    exit 1
47esac
48