toaruos/toolchain/rebuild-newlib.sh
Kevin Lange a60a78d157 Updated toolchain stuff with some new headers.
I'm working on termios support... it's stubs for now, though.
2012-10-09 21:02:43 -07:00

37 lines
998 B
Bash
Executable File

#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/config.sh
. $DIR/util.sh
pushd tarballs > /dev/null
rm -rf "newlib-1.19.0"
deco "newlib" "newlib-1.19.0.tar.gz"
patc "newlib" "newlib-1.19.0"
installNewlibStuff "newlib-1.19.0"
popd > /dev/null
pushd build
if [ ! -d newlib ]; then
mkdir newlib
fi
pushd $DIR/tarballs/newlib-1.19.0/newlib/libc/sys
autoconf || bail
pushd toaru
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
$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
popd