-
Notifications
You must be signed in to change notification settings - Fork 29
/
002-pspsdk.sh
executable file
·38 lines (33 loc) · 1.78 KB
/
002-pspsdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# pspsdk.sh by fjtrujy
## Download the source code.
REPO_URL="https://github.com/pspdev/pspsdk"
REPO_FOLDER="pspsdk"
BRANCH_NAME="master"
if test ! -d "$REPO_FOLDER"; then
git clone --depth 1 -b $BRANCH_NAME $REPO_URL && cd $REPO_FOLDER || { exit 1; }
else
cd $REPO_FOLDER && git fetch origin && git reset --hard origin/${BRANCH_NAME} || { exit 1; }
fi
## Determine the maximum number of processes that Make can work with.
PROC_NR=$(getconf _NPROCESSORS_ONLN)
## Boostrap and config
./bootstrap || { exit 1; }
./configure --quiet || { exit 1; }
## Compile and install.
make --quiet -j $PROC_NR clean || { exit 1; }
make --quiet -j $PROC_NR all || { exit 1; }
make --quiet -j $PROC_NR install || { exit 1; }
make --quiet -j $PROC_NR clean || { exit 1; }
## gcc needs to include libcglue libpthreadglue libpsputility libpsprtc libpspnet_inet libpspnet_resolver libpspsdk libpspmodinfo libpspuser libpspkernel
## from pspsdk to be able to build executables, because they are part of the standard libraries
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libcglue.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpthreadglue.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpsputility.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpsprtc.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspnet_inet.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspnet_resolver.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspsdk.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspmodinfo.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspuser.a .) || { exit 1; }
(cd "$PSPDEV/psp/lib" && ln -sf ../sdk/lib/libpspkernel.a .) || { exit 1; }