-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
66 lines (55 loc) · 1.45 KB
/
build.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
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
#!/bin/bash
set -e
GCC_VERSION=11.2.0
mkdir -p build/$PLATFORM
cd build/$PLATFORM
if [ ! -e "gcc-$GCC_VERSION.tar.gz" ]; then
curl -L -o "gcc-$GCC_VERSION.tar.gz" "https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz"
fi
rm -rf build install
tar --totals -xf "gcc-$GCC_VERSION.tar.gz"
mkdir build install
GCC_INSTALL_PREFIX=$(pwd)/install
case $PLATFORM in
linux-ppc64le)
export CC="powerpc64le-linux-gnu-gcc -m64 -fPIC"
export CXX="powerpc64le-linux-gnu-g++ -m64 -fPIC"
cd gcc-$GCC_VERSION
./contrib/download_prerequisites
cd ../build
../gcc-$GCC_VERSION/configure \
--host=powerpc64le-linux-gnu \
--target=powerpc64le-linux-gnu \
--prefix=$GCC_INSTALL_PREFIX \
--enable-checking=release \
--enable-languages=jit \
--enable-host-shared \
--disable-bootstrap \
--disable-multilib \
--disable-nls
make -j $MAKEJ
make install
;;
linux-x86_64)
export CC="gcc -m64 -fPIC"
export CXX="g++ -m64 -fPIC"
cd gcc-$GCC_VERSION
./contrib/download_prerequisites
cd ../build
../gcc-$GCC_VERSION/configure \
--prefix=$GCC_INSTALL_PREFIX \
--enable-checking=release \
--enable-languages=jit \
--enable-host-shared \
--disable-bootstrap \
--disable-multilib \
--disable-nls
make -j $MAKEJ
make install
;;
*)
echo "Platform \"$PLATFORM\" is not supported."
exit 1
;;
esac
cd ../../..