diff --git a/scripts/build b/scripts/build index 1880799218..460fddef61 100755 --- a/scripts/build +++ b/scripts/build @@ -2,7 +2,11 @@ set -e # Ensure we are in root directory -basedir="$(readlink -f `dirname $0`/..)" +if [[ $(uname) == "Darwin" ]]; then + basedir="$(perl -MCwd=abs_path -le 'print abs_path readlink(shift);' `dirname $0`/..)" +else + basedir="$(readlink -f `dirname $0`/..)" +fi cd $basedir if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then diff --git a/scripts/run-tests b/scripts/run-tests index 1930912053..a5cc969a77 100755 --- a/scripts/run-tests +++ b/scripts/run-tests @@ -2,7 +2,11 @@ set -e # Ensure we are in root directory -basedir="$(readlink -f `dirname $0`/..)" +if [[ $(uname) == "Darwin" ]]; then + basedir="$(perl -MCwd=abs_path -le 'print abs_path readlink(shift);' `dirname $0`/..)" +else + basedir="$(readlink -f `dirname $0`/..)" +fi cd $basedir/bin # Scan objects first so that does not happen within a test