aboutsummaryrefslogtreecommitdiffstats
path: root/dist/travis-ci.sh
blob: d2ca5787e1d351d95f048c707631ef3c93713608 (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
#! /bin/sh
# This script is executed in the travis-ci environment.

# Stop in case of error
set -e

CDIR=$PWD
BLD=$1

# 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" ;;

  llvm)
    ../configure --prefix="$prefix" --with-llvm-config=llvm-config-3.5 ;;

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

# Build
make
make install
cd ..

# Package
PKG_VER=`grep Ghdl_Ver src/version.ads | sed -e 's/.*"\(.*\)";/\1/'`

if [ "$TRAVIS_TAG" = "" ]; then
    PKG_TAG=`date -u +%Y%m%d`
else
    PKG_TAG=$TRAVIS_TAG
fi
PKG_FILE=ghdl-$PKG_VER-$BLD-$PKG_TAG.tgz
echo "creating $PKG_FILE"
tar -zcvf $PKG_FILE -C $prefix .

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