toaruos/toolchain/prepare.sh

63 lines
2.6 KiB
Bash
Raw Normal View History

2012-05-17 05:37:06 +04:00
#!/bin/bash
# Toolchain Installer for Debian-like systems. If you're running
# something else, you're pretty much on your own.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/util.sh
2012-05-17 05:37:06 +04:00
2012-05-17 06:21:37 +04:00
function deleteUnusedGCC () {
# These directories are not used and are primarily for support of unnecessarily libraries like Java and the testsuite.
2012-05-17 06:21:37 +04:00
rm -r $1/boehm-gc $1/gcc/ada $1/gcc/go $1/gcc/java $1/gcc/objc $1/gcc/objcp $1/gcc/testsuite $1/gnattools $1/libada $1/libffi $1/libgo $1/libjava $1/libobjc
}
2012-05-17 05:37:06 +04:00
pushd "$DIR" > /dev/null
if [ ! -d tarballs ]; then
mkdir tarballs
fi
pushd tarballs > /dev/null
$INFO "wget" "Pulling source packages..."
grab "gcc" "http://gcc.petsads.us/releases/gcc-4.6.0" "gcc-4.6.0.tar.gz"
grab "mpc" "http://www.multiprecision.org/mpc/download" "mpc-0.9.tar.gz"
grab "mpfr" "http://www.mpfr.org/mpfr-3.0.1" "mpfr-3.0.1.tar.gz"
grab "gmp" "ftp://ftp.gmplib.org/pub/gmp-5.0.1" "gmp-5.0.1.tar.gz"
grab "binutils" "http://ftp.gnu.org/gnu/binutils" "binutils-2.22.tar.gz"
grab "newlib" "ftp://sources.redhat.com/pub/newlib" "newlib-1.19.0.tar.gz"
grab "freetype" "http://download.savannah.gnu.org/releases/freetype" "freetype-2.4.9.tar.gz"
grab "zlib" "http://zlib.net" "zlib-1.2.7.tar.gz"
2012-09-30 02:57:41 +04:00
grab "libpng" "ftp://ftp.simplesystems.org/pub/libpng/png/src" "libpng-1.5.13.tar.gz"
2012-05-17 05:37:06 +04:00
$INFO "wget" "Pulled source packages."
2012-09-30 02:57:41 +04:00
rm -rf "binutils-2.22" "freetype-2.4.9" "gcc-4.6.0" "gmp-5.0.1" "libpng-1.5.13" "mpc-0.9" "mpfr-3.0.1" "newlib-1.19.0" "zlib-1.2.7"
2012-05-17 05:37:06 +04:00
$INFO "tar" "Decompressing..."
2012-05-17 05:56:31 +04:00
deco "gcc" "gcc-4.6.0.tar.gz"
deco "mpc" "mpc-0.9.tar.gz"
deco "mpfr" "mpfr-3.0.1.tar.gz"
deco "gmp" "gmp-5.0.1.tar.gz"
deco "binutils" "binutils-2.22.tar.gz"
2012-05-17 06:21:37 +04:00
deco "newlib" "newlib-1.19.0.tar.gz"
2012-05-17 19:50:25 +04:00
deco "freetype" "freetype-2.4.9.tar.gz"
deco "zlib" "zlib-1.2.7.tar.gz"
2012-09-30 02:57:41 +04:00
deco "libpng" "libpng-1.5.13.tar.gz"
2012-05-17 05:37:06 +04:00
$INFO "tar" "Decompressed source packages."
$INFO "patch" "Patching..."
2012-05-17 05:56:31 +04:00
patc "gcc" "gcc-4.6.0"
patc "mpc" "mpc-0.9"
patc "mpfr" "mpfr-3.0.1"
patc "gmp" "gmp-5.0.1"
patc "binutils" "binutils-2.22"
2012-05-17 06:21:37 +04:00
patc "newlib" "newlib-1.19.0"
2012-05-17 19:50:25 +04:00
patc "freetype" "freetype-2.4.9"
2012-09-30 02:57:41 +04:00
patc "libpng" "libpng-1.5.13"
2012-05-17 05:37:06 +04:00
$INFO "patch" "Patched third-party software."
2012-05-17 06:21:37 +04:00
$INFO "--" "Running additional bits..."
deleteUnusedGCC "gcc-4.6.0"
installNewlibStuff "newlib-1.19.0"
2012-05-17 05:37:06 +04:00
popd > /dev/null
mkdir build
mkdir local
2012-05-17 05:37:06 +04:00
popd > /dev/null