Skip to content

Commit

Permalink
Resolve $PREFIX to an absolute path at the start of shell scripts
Browse files Browse the repository at this point in the history
This fixes building/installing into a relative path.
  • Loading branch information
mstorsjo committed Nov 23, 2018
1 parent ecdbfaa commit 53db1c3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build-compiler-rt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ if [ -z "$PREFIX" ]; then
echo $0 [--build-sanitizers] dest
exit 1
fi

mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"
export PATH=$PREFIX/bin:$PATH

: ${CORES:=$(nproc 2>/dev/null)}
Expand Down
4 changes: 4 additions & 0 deletions build-libcxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ if [ -z "$PREFIX" ]; then
echo $0 [--disable-shared] [--disable-static] dest
exit 1
fi

mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"

export PATH=$PREFIX/bin:$PATH

: ${CORES:=$(nproc 2>/dev/null)}
Expand Down
2 changes: 2 additions & 0 deletions build-libssp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
exit 1
fi
PREFIX="$1"
mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"
export PATH=$PREFIX/bin:$PATH

: ${CORES:=$(nproc 2>/dev/null)}
Expand Down
3 changes: 3 additions & 0 deletions build-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ if [ -z "$PREFIX" ]; then
exit 1
fi

mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"

: ${CORES:=$(nproc 2>/dev/null)}
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
: ${CORES:=4}
Expand Down
2 changes: 2 additions & 0 deletions build-mingw-w64-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
exit 1
fi
PREFIX="$1"
mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"
export PATH=$PREFIX/bin:$PATH

: ${CORES:=$(nproc 2>/dev/null)}
Expand Down
4 changes: 4 additions & 0 deletions build-mingw-w64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ if [ -z "$PREFIX" ]; then
echo $0 [--skip-include-triplet-prefix] dest
exit 1
fi

mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"

if [ -z "$HOST" ]; then
# The newly built toolchain isn't crosscompiled; add it to the path.
export PATH=$PREFIX/bin:$PATH
Expand Down
2 changes: 2 additions & 0 deletions install-wrappers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
exit 1
fi
PREFIX="$1"
mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"

: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}

Expand Down

0 comments on commit 53db1c3

Please sign in to comment.