[libc++] Avoid relying on `realpath` being installed on the system

It doesn't appear to be a standard utility.
This commit is contained in:
Louis Dionne 2020-10-16 12:57:30 -04:00
parent e95f9a23fa
commit 2408fc2a1e
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,9 @@ for arg in llvm_root build_dir symbols_dir install_dir sdk architectures version
done
# Allow using relative paths
function realpath() {
if [[ $1 = /* ]]; then echo "$1"; else echo "$(pwd)/${1#./}"; fi
}
for arg in llvm_root build_dir symbols_dir install_dir cache; do
path="$(realpath "${!arg}")"
eval "${arg}=\"${path}\""