-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.nmips.elf
executable file
·109 lines (96 loc) · 4.11 KB
/
build.nmips.elf
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This script uses the build script to create a newlib based bare-metal
# GCC package. Set TOPDIR and TARGET before running. TOPDIR should be
# The directory where you want to build everything (it will contain subdirs
# for sources, objects, etc) and TARGET should be nanomips-elf.
# See https://info.mips.com/display/SWWIKI/Building+GCC for more information.
TOPDIR=/directory
GITHOME=ssh://git@github.com/MIPS
TARGET=nanomips-elf
INSTALL=$TOPDIR/install-$TARGET
BUILDINSTALL=$TOPDIR/install-build
HOSTINSTALL=$TOPDIR/install-host
OBJ=$TOPDIR/obj-$TARGET
BUILDOBJ=$TOPDIR/obj-build
HOSTOBJ=$TOPDIR/obj-host
SYSROOT=$INSTALL/$TARGET
HOSTTOOLSROOT=/projects/mipssw/toolchains/
BUILDPATH=$INSTALL/bin
# Set the host. Supported hosts are:
# x86_64-pc-linux-gnu - 64-bit Linux (CentOS 5 upwards)
# i686-pc-linux-gnu - 32-bit Linux (CentOS 5 upwards)
# x86_64-w64-mingw32 - 64-bit Windows
# i686-w64-mingw32 - 32-bit Windows
#
# The Windows hosts require a canadian cross environment, i.e. a
# reference cross compiler that can execute on the current build
# machine must be in the path. It also requires a reference python
# interpreter, typically installed under python-root/bin in the
# reference cross compiler tree, to be in the path. These
# requirements are not met by this script and must be handled
# manually.
#
# Uncomment the line below and set the host as required:
#
#HOSTTRIPLE=i686-w64-mingw32
case x$HOSTTRIPLE in
xx86_64-pc-linux-gnu | xi686-pc-linux-gnu )
# We pretend the build machine is the host on Linux as we can
# execute the binaries we create.
if [ "x$HOSTVERSION" == "x" ]; then
HOSTVERSION=4.9.4-centos6
fi
HOSTOBJ="${HOSTOBJ}-$HOSTTRIPLE"
HOSTINSTALL="${HOSTINSTALL}-$HOSTTRIPLE"
BUILDPATH="${BUILDPATH}:$HOSTTOOLSROOT/$HOSTTRIPLE/$HOSTVERSION/bin"
HOSTOPTIONS="--host=$HOSTTRIPLE --build_triple=$HOSTTRIPLE"
PYTHONG="";;
xx86_64-w64-mingw32 | xi686-w64-mingw32 )
if [ "x$HOSTVERSION" == "x" ]; then
HOSTVERSION=4.9.4_v6.0.0
fi
HOSTOBJ="${HOSTOBJ}-$HOSTTRIPLE"
HOSTINSTALL="${HOSTINSTALL}-$HOSTTRIPLE"
BUILDPATH="${BUILDPATH}:$HOSTTOOLSROOT/$HOSTTRIPLE/$HOSTVERSION/bin"
HOSTOPTIONS="--host=$HOSTTRIPLE"
PYTHONG="--build_triple=x86_64-pc-linux-gnu";;
*)
;;
esac
BUILDPATH="${BUILDPATH}:$BUILDINSTALL/bin"
cd $TOPDIR
G="--path=$BUILDPATH --git_home=$GITHOME --jobs=3"
BUILDG="$G --build=$BUILDOBJ --prefix=$BUILDINSTALL"
G="$G $HOSTOPTIONS --buildlibs=$BUILDINSTALL --hostlibs=$HOSTINSTALL"
HOSTG="$G --build=$HOSTOBJ --prefix=$HOSTINSTALL"
PYTHONG="$G --build=$OBJ --prefix=$INSTALL/python-root $PYTHONG"
G="$G --build=$OBJ --prefix=$INSTALL --target=$TARGET --sysroot=$SYSROOT"
# If you want to force an update of your sources before the build.
# uncommment the next line.
# b/build_toolchain update $G texinfo
# b/build_toolchain update $G termcap ncurses expat
# b/build_toolchain update $G binutils gdb newlib gcc smallclib
# b/build_toolchain update $G zlib pixman libffi glib qemu
# If you do not want to use the system gmp, mpfr, mpc, or dejagnu.
# uncomment the next line.
# b/build_toolchain update $G gmp mpfr mpc dejagnu
b/build_toolchain build $BUILDG texinfo || exit 1
b/build_toolchain build $G binutils || exit 1
b/build_toolchain build $G gold || exit 1
b/build_toolchain build $G gcc || exit 1
#b/build_toolchain build $G smallclib || exit 1
b/build_toolchain build $HOSTG expat || exit 1
b/build_toolchain build $HOSTG termcap || exit 1
b/build_toolchain build $HOSTG ncurses || exit 1
b/build_toolchain build $G gdb || exit 1
b/build_toolchain build $HOSTG zlib || exit 1
b/build_toolchain build $HOSTG openssl || exit 1
b/build_toolchain build $PYTHONG python || exit 1
b/build_toolchain build $G gdb-py || exit 1
b/build_toolchain build $HOSTG pixman || exit 1
b/build_toolchain build $HOSTG libffi || exit 1
b/build_toolchain build $HOSTG libiconv || exit 1
b/build_toolchain build $HOSTG gettext || exit 1
b/build_toolchain build $HOSTG glib || exit 1
b/build_toolchain build $G qemu || exit 1
# This does a single run with default arch, endian, abi, and float setting.
#b/build_toolchain check $G --runtestflags="--target_board='mips-sim-mti32'" gcc