forked from ValveSoftware/steam-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-crosstool.sh
executable file
·46 lines (37 loc) · 1.15 KB
/
build-crosstool.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
#!/bin/bash
CROSSTOOL_REVISION="crosstool-ng-1.17.0"
set -e
echo -n \
"This will take a long time, do you want to continue? [Y/n]: "
read answer
if [ "$answer" = "n" ]; then
exit 1
fi
TOP=$(cd "${0%/*}" && echo $PWD)
cd "${TOP}/crosstool" || exit 1
if [ ! -d crosstool-ng -o "$(command -v ct-ng)" = "" ] ; then
echo "Setting up crosstool-ng..."
sudo apt-get install autoconf bison flex gcc g++ gperf gawk libtool texinfo libncurses5-dev subversion mercurial wget
if [ ! -d crosstool-ng ]; then
hg clone -u $CROSSTOOL_REVISION http://crosstool-ng.org/hg/crosstool-ng || exit 2
fi
if [ "$(command -v ct-ng)" = "" ] ; then
cd crosstool-ng
(./bootstrap && ./configure && make && sudo make install) || exit 2
cd ..
fi
fi
for arch in i386 amd64 ; do
echo "Building cross compiler for $arch ..."
cd $arch
ct-ng build || exit 2
cd ..
echo "complete"
done
HOST_ARCH=$(dpkg --print-architecture)
cd "${TOP}/x-tools" || exit 3
chmod u+w -R *
mkdir -p "${HOST_ARCH}"
mv -v *-unknown-linux-gnu "${HOST_ARCH}"
echo "Done. Your compilers are in ${TOP}/x-tools/${HOST_ARCH}"
# vi: ts=4 sw=4 expandtab