aboutsummaryrefslogtreecommitdiffstats
path: root/dist/linux/buildtest.sh
blob: 884a30cb870696678117aed8e3437a6811050f20 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh
# This script is executed in the travis-ci environment.

# Stop in case of error
set -e

while getopts ":b:f:" opt; do
  case $opt in
    b) BLD=$OPTARG ;;
	f) PKG_FILE=$OPTARG;;
    \?) echo "Invalid option: -$OPTARG" >&2; exit 1 ;;
    :)  echo "Option -$OPTARG requires an argument." >&2; exit 1 ;;
  esac
done

CDIR=$(pwd)

# Display environment
echo "Environment:"
env

# Prepare
prefix="$CDIR/install-$BLD"
mkdir "$prefix"
mkdir "build-$BLD"
cd "build-$BLD"

# Configure
case "$BLD" in
  mcode)
      ../configure --prefix="$prefix"
      MAKEOPTS=""
      ;;
	  
  llvm)
      ../configure --prefix="$prefix$" --with-llvm-config
      ;;
	  
  llvm-3.5)
      ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.5
      MAKEOPTS="CXX=clang++"
      ;;

  llvm-3.8)
      ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.8
      MAKEOPTS="CXX=clang++-3.8"
      ;;
	  
  docker) echo "Check docker container!"; exit 0;;

  *)
      echo "unknown build $BLD"
      exit 1
      ;;
esac

# Build
make $MAKEOPTS
make install
cd ..

# Package
echo "creating $PKG_FILE"
tar -zcvf "$PKG_FILE" -C "$prefix" .

# Test
export GHDL="$CDIR/install-$BLD/bin/ghdl"
cd testsuite
gnatmake get_entities
./testsuite.sh
cd ..