-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy path002-gcc-newlib-PPU.sh
More file actions
executable file
·68 lines (52 loc) · 1.7 KB
/
002-gcc-newlib-PPU.sh
File metadata and controls
executable file
·68 lines (52 loc) · 1.7 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh -e
# gcc-newlib-PPU.sh by Naomi Peori (naomi@peori.ca)
GCC="gcc-7.2.0"
NEWLIB="newlib-1.20.0"
if [ ! -d ${GCC} ]; then
## Download the source code.
if [ ! -f ${GCC}.tar.xz ]; then wget --continue https://ftpmirror.gnu.org/gnu/gcc/${GCC}/${GCC}.tar.xz; fi
if [ ! -f ${NEWLIB}.tar.gz ]; then wget --continue https://sourceware.org/pub/newlib/${NEWLIB}.tar.gz; fi
## Unpack the source code.
rm -Rf ${GCC} && tar xfvJ ${GCC}.tar.xz
rm -Rf ${NEWLIB} && tar xfvz ${NEWLIB}.tar.gz
## Patch the source code.
cat ../patches/${GCC}-PS3.patch | patch -p1 -d ${GCC}
cat ../patches/${NEWLIB}-PS3.patch | patch -p1 -d ${NEWLIB}
## Enter the source code directory.
cd ${GCC}
## Create the newlib symlinks.
ln -s ../${NEWLIB}/newlib newlib
ln -s ../${NEWLIB}/libgloss libgloss
## Download the prerequisites.
./contrib/download_prerequisites
## Leave the source code directory.
cd ..
fi
if [ ! -d ${GCC}/build-ppu ]; then
## Create the build directory.
mkdir ${GCC}/build-ppu
fi
## Enter the build directory.
cd ${GCC}/build-ppu
## Configure the build.
../configure --prefix="$PS3DEV/ppu" --target="powerpc64-ps3-elf" \
--disable-dependency-tracking \
--disable-libcc1 \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
--disable-shared \
--disable-win32-registry \
--enable-languages="c,c++" \
--enable-long-double-128 \
--enable-lto \
--enable-threads \
--with-cpu="cell" \
--with-newlib \
--enable-newlib-multithread \
--enable-newlib-hw-fp \
--with-system-zlib
## Compile and install.
PROCS="$(nproc --all 2>&1)" || ret=$?
if [ ! -z $ret ]; then PROCS=4; fi
${MAKE:-make} -j $PROCS all && ${MAKE:-make} install