Skip to content

Commit e2eccd2

Browse files
committed
Improve musl compilation
1 parent 24db261 commit e2eccd2

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

stage1-musl.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,25 @@ set -e
44
ROOT=${PWD}
55
PS4SDK=$ROOT/toolchain
66
PROC_NR=$(getconf _NPROCESSORS_ONLN)
7-
GIT_REFERENCE=${1:-master}
87

9-
rm -rf musl
10-
mkdir musl
11-
cd musl
8+
## Download the source code.
9+
REPO_URL="https://github.com/orbisdev/musl"
10+
REPO_FOLDER="musl"
11+
BRANCH_NAME="master"
12+
if test ! -d "$REPO_FOLDER"; then
13+
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || exit 1
14+
else
15+
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || exit 1
16+
fi
1217

13-
git init
14-
git remote add origin https://github.com/orbisdev/musl
15-
git fetch --depth 1 origin ${GIT_REFERENCE}
16-
git checkout FETCH_HEAD
18+
# Print latest commits
1719
git log
1820

21+
## Configure
1922
CC=clang CFLAGS=--target=x86_64-scei-ps4 ./configure --disable-shared --prefix=$PS4SDK/usr --target=orbis
20-
make -j $PROC_NR
21-
make install
23+
24+
## Compile and install.
25+
make --quiet -j $PROC_NR clean || { exit 1; }
26+
make --quiet -j $PROC_NR || { exit 1; }
27+
make --quiet -j $PROC_NR install || { exit 1; }
28+
make --quiet -j $PROC_NR clean || { exit 1; }

0 commit comments

Comments
 (0)