Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setup readlink resolution #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,34 @@
# Customize this file by setting variables to suit your environment
SOURCE="${BASH_SOURCE[0]}"
SOURCE_DIR=`dirname $SOURCE`
export QUICKFAST_ROOT=`readlink -f $SOURCE_DIR`
$READLINK --version >/dev/null 2>/dev/null
if (( $? != 0 )); then
echo "readlink does not exist or it does not support --version"
echo "maybe it is not GNU readlink but BSD"
echo "trying with greadlink..."
READLINK='greadlink'
fi
$READLINK --version >/dev/null 2>/dev/null
if (( $? != 0 )); then
echo "greadlink does not exist or an error occurred"
UNAME=`uname`
if [[ $UNAME == "Darwin" ]]; then
echo "You are running on a Mac OSX system."
echo "Consider installing homebrew."
echo "Then install coreutils."
echo "# brew install coreutils"
fi
else
echo "$READLINK found at `which $READLINK`."
fi
$READLINK -f $SOURCE_DIR
if (( $? != 0 )); then
echo "trying exporting QUICKFAST_ROOT by pwd."
export QUICKFAST_ROOT=`pwd`
echo "QUICKFAST_ROOT = $QUICKFAST_ROOT"
else
export QUICKFAST_ROOT=`$READLINK -f $SOURCE_DIR`
fi

if test "$MPC_ROOT" = ""
then
Expand Down