44GCC=" gcc-7.5.0"
55NEWLIB=" newlib-4.2.0.20211231"
66
7- if [ ! -d ${NEWLIB} ]; then
7+ if [ ! -d ${GCC} -SPU ]; then
88
99 # # Download the source code.
10+ if [ ! -f ${GCC} .tar.xz ]; then wget -q --show-progress --continue https://ftpmirror.gnu.org/gnu/gcc/${GCC} /${GCC} .tar.xz; fi
1011 if [ ! -f ${NEWLIB} .tar.gz ]; then wget -q --show-progress --continue https://sourceware.org/pub/newlib/${NEWLIB} .tar.gz; fi
1112
1213 # # Unpack the source code.
13- rm -Rf ${NEWLIB} && tar xfz ${NEWLIB} .tar.gz
14-
15- # # Patch the source code.
16- cat ../patches/${NEWLIB} -PS3.patch | patch -p1 -d ${NEWLIB}
17-
18- fi
14+ tar xfJ ${GCC} .tar.xz
15+ mv ${GCC} ${GCC} -SPU
1916
20- if [ ! -d ${GCC} ]; then
21-
22- # # Download the source code.
23- if [ ! -f ${GCC} .tar.xz ]; then wget -q --show-progress --continue https://ftpmirror.gnu.org/gnu/gcc/${GCC} /${GCC} .tar.xz; fi
24-
25- # # Unpack the source code.
26- rm -Rf ${GCC} && tar xfJ ${GCC} .tar.xz
17+ tar xfz ${NEWLIB} .tar.gz
18+ mv ${NEWLIB} ${NEWLIB} -SPU
2719
2820 # # Patch the source code.
29- cat ../patches/${GCC} -PS3.patch | patch -p1 -d ${GCC}
21+ cat ../patches/${NEWLIB} -PS3.patch | patch -p1 -d ${NEWLIB} -SPU
22+ cat ../patches/${GCC} -PS3.patch | patch -p1 -d ${GCC} -SPU
3023
3124 # # Enter the source code directory.
32- cd ${GCC}
25+ cd ${GCC} -SPU
3326
3427 # # Create the newlib symlinks.
35- if [ -f ../${NEWLIB} /newlib ]; then rm newlib; fi
36- if [ -f ../${NEWLIB} /libgloss ]; then rm libgloss; fi
37- ln -s ../${NEWLIB} /newlib newlib
38- ln -s ../${NEWLIB} /libgloss libgloss
28+ ln -s ../${NEWLIB} -SPU/newlib newlib
29+ ln -s ../${NEWLIB} -SPU/libgloss libgloss
3930
4031 # # Download the prerequisites.
4132 ./contrib/download_prerequisites
@@ -45,15 +36,15 @@ if [ ! -d ${GCC} ]; then
4536
4637fi
4738
48- if [ ! -d ${GCC} /build-spu ]; then
39+ if [ ! -d ${GCC} -SPU /build-spu ]; then
4940
5041 # # Create the build directory.
51- mkdir ${GCC} /build-spu
42+ mkdir ${GCC} -SPU /build-spu
5243
5344fi
5445
5546# # Enter the build directory.
56- cd ${GCC} /build-spu
47+ cd ${GCC} -SPU /build-spu
5748
5849# # Configure the build.
5950CFLAGS_FOR_TARGET=" -Os -fpic -ffast-math -ftree-vectorize -funroll-loops -fschedule-insns -mdual-nops -mwarn-reloc" \
@@ -71,6 +62,7 @@ CFLAGS_FOR_TARGET="-Os -fpic -ffast-math -ftree-vectorize -funroll-loops -fsched
7162 --with-newlib \
7263 --enable-newlib-multithread \
7364 --enable-newlib-hw-fp \
65+ --with-system-zlib \
7466 --with-pic
7567
7668# # Compile and install.
0 commit comments