void-packages/srcpkgs/ghdl/files/ghdl

21 lines
410 B
Bash
Executable file

#!/bin/sh
# Source: Debian
set -e
backend="$GHDL_BACKEND"
bindir=$(dirname $0)
if [ ! -x "${bindir}/ghdl-$backend" ]; then
if [ -x ${bindir}/ghdl-mcode ]; then
backend=mcode
elif [ -x ${bindir}/ghdl-gcc ]; then
backend=gcc
elif [ -x ${bindir}/ghdl-llvm ]; then
backend=llvm
else
echo >&2 "Error: No installed ghdl backend found. Terminating!"
exit 2
fi
fi
exec "${bindir}/ghdl-$backend" "$@"