-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
target_compiler.sh
executable file
·79 lines (68 loc) · 1.67 KB
/
target_compiler.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
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
# builds compiler for Sony NSZ-GS7
# should be built on a older OS like Ferdora 14
set -e
export TARGET=arm-linux-gnueabi
export PREFIX=$PWD/cross
export PATH=$PATH:$PREFIX/bin
export TARGET_ROOT=$PWD/target
export TARGET_LIB=$TARGET_ROOT/lib
export TARGET_INC=$TARGET_ROOT/include
export TARGET_BIN=$TARGET_ROOT/bin
rm -fr $PWD/build_binutils
rm -fr $PWD/build_gcc
rm -fr $PWD/binutils-2.27
rm -fr $PWD/gcc-4.4.5
rm -fr $PWD/gmp-5.0.1
rm -fr $PWD/mpfr-3.0.0
tar xjfv $PWD/binutils-2.27.tar.bz2
tar xjfv $PWD/gcc-4.4.5.tar.bz2
tar xjfv $PWD/gmp-5.0.1.tar.bz2
tar xjfv $PWD/mpfr-3.0.0.tar.bz2
mkdir $PWD/build_binutils
mkdir $PWD/build_gcc
cd $PWD/gcc-4.4.5
ln -s ../gmp-5.0.1 gmp
ln -s ../mpfr-3.0.0 mpfr
mkdir ../build_gcc/mpfr
cp gmp/longlong.h ../build_gcc/mpfr
cp gmp/gmp-impl.h ../build_gcc/mpfr
cd ..
cd $PWD/binutils-2.27
ln -s ../gmp-5.0.1 gmp
ln -s ../mpfr-3.0.0 mpfr
mkdir ../build_binutils/mpfr
cp gmp/longlong.h ../build_binutils/mpfr
cp gmp/gmp-impl.h ../build_binutils/mpfr
cd ..
cd $PWD/build_binutils
../binutils-2.27/configure \
--target=$TARGET \
--host=$TARGET \
--build=$MARCHTYPE \
--prefix= \
--disable-nls
make -j2 all
make DESTDIR=$TARGET_ROOT install
cd ..
cd $PWD/build_gcc
../gcc-4.4.5/configure \
--target=$TARGET \
--host=$TARGET \
--build=$MARCHTYPE \
--prefix= \
--disable-multilib \
--disable-nls \
--enable-languages=c,c++
make -j2 all-gcc
make DESTDIR=$TARGET_ROOT install-gcc
make -j2 all-target-libgcc
make DESTDIR=$TARGET_ROOT install-target-libgcc
cd ..
rm -fr $PWD/build_binutils
rm -fr $PWD/build_gcc
rm -fr $PWD/binutils-2.27
rm -fr $PWD/gcc-4.4.5
rm -fr $PWD/gmp-5.0.1
rm -fr $PWD/mpfr-3.0.0
echo Done!