toaruos/toolchain/install.sh

78 lines
2.2 KiB
Bash
Raw Normal View History

#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/config.sh
. $DIR/util.sh
2012-05-17 20:18:16 +04:00
pushd build
if [ ! -d binutils ]; then
mkdir binutils
fi
2012-05-17 07:12:11 +04:00
pushd binutils
2012-05-17 20:18:16 +04:00
$DIR/tarballs/binutils-2.22/configure --target=$TARGET --prefix=$PREFIX || bail
make || bail
make install || bail
2012-05-17 07:12:11 +04:00
popd
export PATH=$PATH:$PREFIX/bin
if [ ! -d gcc ]; then
mkdir gcc
fi
2012-05-17 07:12:11 +04:00
pushd gcc
$DIR/tarballs/gcc-4.6.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c,c++ --disable-libssp --with-newlib || bail
2012-05-17 20:18:16 +04:00
make all-gcc || bail
make install-gcc || bail
make all-target-libgcc || bail
make install-target-libgcc || bail
2012-05-17 07:12:11 +04:00
popd
if [ ! -d newlib ]; then
mkdir newlib
fi
pushd $DIR/tarballs/newlib-1.19.0/newlib/libc/sys
2012-05-17 20:18:16 +04:00
autoconf || bail
pushd toaru
2012-05-17 20:18:16 +04:00
autoreconf || bail
yasm -f elf -o crt0.o crt0.s || bail
cp crt0.o ../
cp crt0.o /tmp/__toaru_crt0.o
popd
popd
pushd newlib
mkdir -p $TARGET/newlib/libc/sys
cp /tmp/__toaru_crt0.o $TARGET/newlib/libc/sys/crt0.o
rm /tmp/__toaru_crt0.o
2012-05-17 20:18:16 +04:00
$DIR/tarballs/newlib-1.19.0/configure --target=$TARGET --prefix=$PREFIX || bail
make || bail
make install || bail
cp -r $DIR/patches/newlib/include/* $PREFIX/$TARGET/include/
popd
pushd gcc
# build libstdc++
make || bail
make install || bail
popd
2012-05-17 19:50:25 +04:00
if [ ! -d freetype ]; then
mkdir freetype
fi
pushd freetype
2012-05-17 20:18:16 +04:00
$DIR/tarballs/freetype-2.4.9/configure --host=$TARGET --prefix=$PREFIX/$TARGET || bail
make || bail
make install || bail
2012-05-17 19:50:25 +04:00
popd
#
# XXX zlib can not be built in a separate directory
#
pushd ../tarballs/zlib*
CC=i686-pc-toaru-gcc ./configure --static --prefix=$PREFIX/$TARGET --solo || bail
make || bail
make install || bail
popd
if [ ! -d libpng ]; then
mkdir libpng
fi
pushd libpng
2012-09-30 02:57:41 +04:00
$DIR/tarballs/libpng-1.5.13/configure --host=$TARGET --prefix=$PREFIX/$TARGET || bail
make || bail
make install || bail
popd
popd