aboutsummaryrefslogtreecommitdiffstats
path: root/dist/travis-ci.sh
blob: 3a8194cdc2bc4c5438710c5ff46b84a553677be6 (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
#! /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-*)
    llvm_ver=`echo $BLD | sed -e 's/llvm-//'`
    ../configure --prefix="$prefix" --with-llvm-config=llvm-config-$llvm_ver
    ;;

  *)
    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 ..