2012-05-17 07:03:17 +04:00
|
|
|
#!/bin/bash
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
. $DIR/config.sh
|
2012-10-08 11:17:32 +04:00
|
|
|
. $DIR/util.sh
|
2012-05-17 20:18:16 +04:00
|
|
|
|
2012-05-17 07:03:17 +04:00
|
|
|
pushd build
|
|
|
|
if [ ! -d binutils ]; then
|
|
|
|
mkdir binutils
|
|
|
|
fi
|
2012-05-17 07:12:11 +04:00
|
|
|
pushd binutils
|
2014-05-10 11:59:00 +04:00
|
|
|
$DIR/tarballs/binutils-2.22/configure --target=$TARGET --prefix=$PREFIX --disable-werror || bail
|
2012-05-17 20:18:16 +04:00
|
|
|
make || bail
|
|
|
|
make install || bail
|
2012-05-17 07:12:11 +04:00
|
|
|
popd
|
2012-05-17 07:03:17 +04:00
|
|
|
export PATH=$PATH:$PREFIX/bin
|
|
|
|
if [ ! -d gcc ]; then
|
|
|
|
mkdir gcc
|
|
|
|
fi
|
2012-05-17 07:12:11 +04:00
|
|
|
pushd gcc
|
2013-06-09 06:44:28 +04:00
|
|
|
$DIR/tarballs/gcc-4.6.4/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
|
2012-05-17 07:03:17 +04:00
|
|
|
if [ ! -d newlib ]; then
|
|
|
|
mkdir newlib
|
2013-05-30 11:57:17 +04:00
|
|
|
else
|
|
|
|
# Newlib is touchy about reconfigures
|
|
|
|
rm -r newlib
|
|
|
|
mkdir newlib
|
2012-05-17 07:03:17 +04:00
|
|
|
fi
|
2014-01-11 05:47:48 +04:00
|
|
|
pushd $DIR/tarballs/newlib-1.19.0
|
|
|
|
find -type f -exec sed 's|--cygnus||g;s|cygnus||g' -i {} + || bail
|
|
|
|
popd
|
2012-05-17 07:03:17 +04:00
|
|
|
pushd $DIR/tarballs/newlib-1.19.0/newlib/libc/sys
|
2012-05-17 20:18:16 +04:00
|
|
|
autoconf || bail
|
2012-05-17 07:03:17 +04:00
|
|
|
pushd toaru
|
2014-01-11 05:47:48 +04:00
|
|
|
touch INSTALL NEWS README AUTHORS ChangeLog COPYING || bail
|
2012-05-17 20:18:16 +04:00
|
|
|
autoreconf || bail
|
|
|
|
yasm -f elf -o crt0.o crt0.s || bail
|
2013-01-26 03:59:33 +04:00
|
|
|
yasm -f elf -o crti.o crti.s || bail
|
|
|
|
yasm -f elf -o crtn.o crtn.s || bail
|
2012-05-17 07:03:17 +04:00
|
|
|
cp crt0.o ../
|
|
|
|
cp crt0.o /tmp/__toaru_crt0.o
|
2013-01-26 03:59:33 +04:00
|
|
|
cp crti.o ../
|
|
|
|
cp crti.o /tmp/__toaru_crti.o
|
|
|
|
cp crtn.o ../
|
|
|
|
cp crtn.o /tmp/__toaru_crtn.o
|
2012-05-17 07:03:17 +04:00
|
|
|
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
|
2013-01-26 03:59:33 +04:00
|
|
|
cp /tmp/__toaru_crti.o $TARGET/newlib/libc/sys/crti.o
|
|
|
|
rm /tmp/__toaru_crti.o
|
|
|
|
cp /tmp/__toaru_crtn.o $TARGET/newlib/libc/sys/crtn.o
|
|
|
|
rm /tmp/__toaru_crtn.o
|
2013-04-09 12:31:11 +04:00
|
|
|
echo "" > $DIR/tarballs/newlib-1.19.0/newlib/libc/stdlib/malign.c
|
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
|
2012-10-10 08:02:43 +04:00
|
|
|
cp -r $DIR/patches/newlib/include/* $PREFIX/$TARGET/include/
|
2013-01-26 03:59:33 +04:00
|
|
|
cp $TARGET/newlib/libc/sys/crt*.o $PREFIX/$TARGET/lib/
|
2012-05-17 07:03:17 +04:00
|
|
|
popd
|
2012-11-21 07:28:22 +04:00
|
|
|
pushd gcc
|
|
|
|
# build libstdc++
|
2013-04-21 02:43:19 +04:00
|
|
|
make all-target-libstdc++-v3 || bail
|
|
|
|
make install-target-libstdc++-v3 || bail
|
2012-11-21 07:28:22 +04:00
|
|
|
popd
|
2013-01-28 05:17:52 +04:00
|
|
|
# Source the activate script, which will enable pkg-config stuff
|
|
|
|
. $DIR/activate.sh
|
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
|
2012-09-13 07:06:22 +04:00
|
|
|
# XXX zlib can not be built in a separate directory
|
2013-04-13 08:20:08 +04:00
|
|
|
pushd $DIR/tarballs/zlib*
|
2013-02-03 03:10:52 +04:00
|
|
|
CC=i686-pc-toaru-gcc ./configure --static --prefix=$PREFIX/$TARGET || bail
|
2012-09-13 07:06:22 +04:00
|
|
|
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
|
2012-09-13 07:06:22 +04:00
|
|
|
make || bail
|
|
|
|
make install || bail
|
|
|
|
popd
|
2013-01-28 04:27:18 +04:00
|
|
|
if [ ! -d pixman ]; then
|
|
|
|
mkdir pixman
|
|
|
|
fi
|
|
|
|
pushd pixman
|
|
|
|
$DIR/tarballs/pixman-0.26.2/configure --host=$TARGET --prefix=$PREFIX/$TARGET || bail
|
|
|
|
make || bail
|
|
|
|
make install || bail
|
|
|
|
popd
|
|
|
|
if [ ! -d cairo ]; then
|
|
|
|
mkdir cairo
|
|
|
|
fi
|
|
|
|
pushd cairo
|
2013-07-22 05:22:35 +04:00
|
|
|
$DIR/tarballs/cairo-1.12.2/configure --host=$TARGET --prefix=$PREFIX/$TARGET --enable-ps=no --enable-pdf=no --enable-interpreter=no --enable-xlib=no || bail
|
2013-01-28 04:27:18 +04:00
|
|
|
cp $DIR/patches/cairo-Makefile test/Makefile
|
|
|
|
cp $DIR/patches/cairo-Makefile perf/Makefile
|
|
|
|
echo -e "\n\n#define CAIRO_NO_MUTEX 1" >> config.h
|
|
|
|
make || bail
|
|
|
|
make install || bail
|
|
|
|
popd
|
2013-04-13 08:20:08 +04:00
|
|
|
# XXX Mesa can not be built from a separate directory (configure script doesn't provide a Makefile)
|
|
|
|
pushd $DIR/tarballs/Mesa-*
|
|
|
|
./configure --enable-32-bit --host=$TARGET --prefix=$PREFIX/$TARGET --with-osmesa-bits=8 --with-driver=osmesa --disable-egl --disable-shared --without-x --disable-glw --disable-glut --disable-driglx-direct --disable-gallium || bail
|
|
|
|
make || bail
|
|
|
|
make install || bail
|
|
|
|
popd
|
2013-04-13 10:53:21 +04:00
|
|
|
if [ ! -d ncurses ]; then
|
|
|
|
mkdir ncurses
|
|
|
|
fi
|
|
|
|
pushd ncurses
|
|
|
|
$DIR/tarballs/ncurses-5.9/configure --prefix=$PREFIX/$TARGET --host=$TARGET --with-terminfo-dirs=/usr/share/terminfo --with-default-terminfo-dir=/usr/share/terminfo --without-tests || bail
|
|
|
|
make || bail
|
|
|
|
make install || bail
|
|
|
|
popd
|
2012-05-17 07:03:17 +04:00
|
|
|
popd
|