aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/vendors/compile-vunit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/vendors/compile-vunit.sh')
-rwxr-xr-xlibraries/vendors/compile-vunit.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/libraries/vendors/compile-vunit.sh b/libraries/vendors/compile-vunit.sh
index 1bdace797..f5a7c64e0 100755
--- a/libraries/vendors/compile-vunit.sh
+++ b/libraries/vendors/compile-vunit.sh
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /usr/bin/env bash
# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
# vim: tabstop=2:shiftwidth=2:noexpandtab
# kate: tab-width 2; replace-tabs off; indent-width 2;
@@ -34,10 +34,13 @@
# ==============================================================================
# ---------------------------------------------
+# work around for Darwin (Mac OS)
+READLINK=readlink; if [[ $(uname) == "Darwin" ]]; then READLINK=greadlink; fi
+
# save working directory
WorkingDir=$(pwd)
ScriptDir="$(dirname $0)"
-ScriptDir="$(readlink -f $ScriptDir)"
+ScriptDir="$($READLINK -f $ScriptDir)"
# source configuration file from GHDL's 'vendors' library directory
source $ScriptDir/config.sh
@@ -88,7 +91,7 @@ while [[ $# > 0 ]]; do
shift # skip argument
;;
*) # unknown option
- echo 1>&2 -e "${COLORED_ERROR} Unknown command line option.${ANSI_RESET}"
+ echo 1>&2 -e "${COLORED_ERROR} Unknown command line option '$key'.${ANSI_NOCOLOR}"
exit -1
;;
esac
@@ -167,7 +170,7 @@ GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-c
# Cleanup directory
# ==============================================================================
if [ "$CLEAN" == "TRUE" ]; then
- echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_NOCOLOR}"
rm *.o 2> /dev/null
rm *.cf 2> /dev/null
fi