diff options
Diffstat (limited to 'dist/linux')
-rw-r--r-- | dist/linux/buildtest.sh | 71 | ||||
-rw-r--r-- | dist/linux/docker-buildtest.sh | 22 | ||||
-rw-r--r-- | dist/linux/envs/fedora_llvm.sh | 2 | ||||
-rw-r--r-- | dist/linux/envs/fedora_mcode.sh | 2 | ||||
-rw-r--r-- | dist/linux/envs/ubuntu1204_llvm38.sh | 2 | ||||
-rw-r--r-- | dist/linux/envs/ubuntu1404_llvm35.sh | 2 | ||||
-rw-r--r-- | dist/linux/envs/ubuntu_mcode.sh | 2 | ||||
-rwxr-xr-x | dist/linux/travis-ci.sh | 12 |
8 files changed, 115 insertions, 0 deletions
diff --git a/dist/linux/buildtest.sh b/dist/linux/buildtest.sh new file mode 100644 index 000000000..884a30cb8 --- /dev/null +++ b/dist/linux/buildtest.sh @@ -0,0 +1,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 ..
\ No newline at end of file diff --git a/dist/linux/docker-buildtest.sh b/dist/linux/docker-buildtest.sh new file mode 100644 index 000000000..5c921b18e --- /dev/null +++ b/dist/linux/docker-buildtest.sh @@ -0,0 +1,22 @@ +set -ev + +docker pull "$DOCKER_IMG" + +if [ -z "$DONTGRAB_SRCS" ]; then + + p="mkdir /work && cd /work" + p="$p && curl -L https://github.com/tgingold/ghdl/archive/master.tar.gz | tar xz" + p="$p && mv ghdl-master/* ./ && rm -rf ghdl-master" + + docker run --name ghdl_cmp -it "$DOCKER_IMG" sh -c "$p && sh ./dist/linux/buildtest.sh -b $DBLD -f $PKG_FILE" + docker cp "ghdl_cmp:/work/$PKG_FILE" ./ + +else + + docker run --name ghdl_cmp -itv $(pwd):/work:Z "$DOCKER_IMG" sh -c "cd /work && sh ./dist/linux/buildtest.sh -b $DBLD -f $PKG_FILE" + +fi + +docker rm ghdl_cmp + + diff --git a/dist/linux/envs/fedora_llvm.sh b/dist/linux/envs/fedora_llvm.sh new file mode 100644 index 000000000..c44857c51 --- /dev/null +++ b/dist/linux/envs/fedora_llvm.sh @@ -0,0 +1,2 @@ +BLD=fed+llvm +DOCKER_IMG="ghdl/ghdl-tools:fedora-llvm-mcode"
\ No newline at end of file diff --git a/dist/linux/envs/fedora_mcode.sh b/dist/linux/envs/fedora_mcode.sh new file mode 100644 index 000000000..3ddb515bf --- /dev/null +++ b/dist/linux/envs/fedora_mcode.sh @@ -0,0 +1,2 @@ +BLD=fed+mcode +DOCKER_IMG="ghdl/ghdl-tools:fedora-llvm-mcode"
\ No newline at end of file diff --git a/dist/linux/envs/ubuntu1204_llvm38.sh b/dist/linux/envs/ubuntu1204_llvm38.sh new file mode 100644 index 000000000..5f68d2ab0 --- /dev/null +++ b/dist/linux/envs/ubuntu1204_llvm38.sh @@ -0,0 +1,2 @@ +BLD=ubu1204+llvm-3.8 +DOCKER_IMG="ghdl/ghdl-tools:ubuntu1204-llvm"
\ No newline at end of file diff --git a/dist/linux/envs/ubuntu1404_llvm35.sh b/dist/linux/envs/ubuntu1404_llvm35.sh new file mode 100644 index 000000000..bf4baf236 --- /dev/null +++ b/dist/linux/envs/ubuntu1404_llvm35.sh @@ -0,0 +1,2 @@ +BLD=ubu1404+llvm-3.5 +DOCKER_IMG="ghdl/ghdl-tools:ubuntu1404-llvm"
\ No newline at end of file diff --git a/dist/linux/envs/ubuntu_mcode.sh b/dist/linux/envs/ubuntu_mcode.sh new file mode 100644 index 000000000..e6f7c3232 --- /dev/null +++ b/dist/linux/envs/ubuntu_mcode.sh @@ -0,0 +1,2 @@ +BLD=ubu+mcode +DOCKER_IMG="ghdl/ghdl-tools:ubuntu-mcode"
\ No newline at end of file diff --git a/dist/linux/travis-ci.sh b/dist/linux/travis-ci.sh new file mode 100755 index 000000000..1b683833c --- /dev/null +++ b/dist/linux/travis-ci.sh @@ -0,0 +1,12 @@ +IFS='+' read -ra REFS <<< "$BLD" + +DBLD=${REFS[1]} +PKG_DTAG=${REFS[0]} +PKG_SHORTCOMMIT="$(echo $TRAVIS_COMMIT | cut -c1-10)" +PKG_VER=`grep Ghdl_Ver src/version.in | sed -e 's/.*"\(.*\)";/\1/'` +PKG_TAG="$TRAVIS_TAG" + +if [ -z "$BUILDTHIS" ]; then BUILDTHIS=$(echo "$TRAVIS_TAG"); fi +if [ -z "$TRAVIS_TAG" ]; then PKG_TAG=`date -u +%Y%m%d`; fi + +export PKG_FILE="ghdl-$PKG_VER-$DBLD-$PKG_TAG-$PKG_DTAG-$PKG_SHORTCOMMIT.tgz"
\ No newline at end of file |