Skip to content

Commit 53db1c3

Browse files
committed
Resolve $PREFIX to an absolute path at the start of shell scripts
This fixes building/installing into a relative path.
1 parent ecdbfaa commit 53db1c3

File tree

7 files changed

+20
-0
lines changed

7 files changed

+20
-0
lines changed

build-compiler-rt.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ if [ -z "$PREFIX" ]; then
1919
echo $0 [--build-sanitizers] dest
2020
exit 1
2121
fi
22+
23+
mkdir -p "$PREFIX"
24+
PREFIX="$(cd "$PREFIX" && pwd)"
2225
export PATH=$PREFIX/bin:$PATH
2326

2427
: ${CORES:=$(nproc 2>/dev/null)}

build-libcxx.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ if [ -z "$PREFIX" ]; then
2323
echo $0 [--disable-shared] [--disable-static] dest
2424
exit 1
2525
fi
26+
27+
mkdir -p "$PREFIX"
28+
PREFIX="$(cd "$PREFIX" && pwd)"
29+
2630
export PATH=$PREFIX/bin:$PATH
2731

2832
: ${CORES:=$(nproc 2>/dev/null)}

build-libssp.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
77
exit 1
88
fi
99
PREFIX="$1"
10+
mkdir -p "$PREFIX"
11+
PREFIX="$(cd "$PREFIX" && pwd)"
1012
export PATH=$PREFIX/bin:$PATH
1113

1214
: ${CORES:=$(nproc 2>/dev/null)}

build-llvm.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [ -z "$PREFIX" ]; then
2222
exit 1
2323
fi
2424

25+
mkdir -p "$PREFIX"
26+
PREFIX="$(cd "$PREFIX" && pwd)"
27+
2528
: ${CORES:=$(nproc 2>/dev/null)}
2629
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
2730
: ${CORES:=4}

build-mingw-w64-libraries.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
77
exit 1
88
fi
99
PREFIX="$1"
10+
mkdir -p "$PREFIX"
11+
PREFIX="$(cd "$PREFIX" && pwd)"
1012
export PATH=$PREFIX/bin:$PATH
1113

1214
: ${CORES:=$(nproc 2>/dev/null)}

build-mingw-w64.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ if [ -z "$PREFIX" ]; then
1414
echo $0 [--skip-include-triplet-prefix] dest
1515
exit 1
1616
fi
17+
18+
mkdir -p "$PREFIX"
19+
PREFIX="$(cd "$PREFIX" && pwd)"
20+
1721
if [ -z "$HOST" ]; then
1822
# The newly built toolchain isn't crosscompiled; add it to the path.
1923
export PATH=$PREFIX/bin:$PATH

install-wrappers.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if [ $# -lt 1 ]; then
77
exit 1
88
fi
99
PREFIX="$1"
10+
mkdir -p "$PREFIX"
11+
PREFIX="$(cd "$PREFIX" && pwd)"
1012

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

0 commit comments

Comments
 (0)