Resolve $PREFIX to an absolute path at the start of shell scripts

This fixes building/installing into a relative path.
This commit is contained in:
Martin Storsjö committed 2018-11-23 13:51:05 +02:00
1 parent ecdbfaacc3
commit 53db1c3a4c
7 files changed
+20

No files matched your search

+3
View File
@@ -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)}
+4
View File
@@ -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)}
+2
View File
@@ -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)}
+3
View File
@@ -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}
+2
View File
@@ -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)}
+4
View File
@@ -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
+2
View File
@@ -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}}