diff options
Diffstat (limited to 'dist/buildtest.sh')
-rw-r--r-- | dist/buildtest.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/dist/buildtest.sh b/dist/buildtest.sh new file mode 100644 index 000000000..5d011e50a --- /dev/null +++ b/dist/buildtest.sh @@ -0,0 +1,65 @@ +#! /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-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" + ;; + + *) + 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 .. |