YARISIM: Simulate a framebuffer
[yari.git] / xtools / BUILD-newlib.sh
blob1ec8e3f87157ab237e29ebbe1e3437e0d8b3f464
1 #!/bin/bash
3 . BUILD-config
5 download ftp://sources.redhat.com/pub/newlib $newlibdist.tar.gz
6 rm -rf $builddir-newlib
7 mkdir -p $builddir-newlib
8 cd $builddir-newlib
10 # Untar the files
11 tar -xzf $GNUsrc/$newlibdist.tar.gz
13 # Copy over our changes
14 tar -C $srcroot/newlib -cvf - .|tar -C $newlibdist -xvf -
16 # Build newlib-1.16.0, available from RedHat:
17 # http://sourceware.org/newlib/
19 # As for now, yari does not support floating point operations as well as the
20 # special lw{l,r}, sw{l,r} instructions. Therefore some additional configure
21 # options are required for newlib to work correctly.
23 # Dynamic execution count with different newlib options
24 # tictactoe: 6588425 (enable-target-optspace)
25 # tictactoe: 6498234 (disable-newlib-io-float enable-target-optspace)
26 # tictactoe: 4959017 ()
27 # tictactoe: 4899002 (disable-newlib-io-float)
28 # Clearly we're paying dearly at execution time for saving space
30 # Configure and make the static C lib
31 mkdir -p build-newlib
32 cd build-newlib
33 ../$newlibdist/configure \
34 --prefix=$install_prefix \
35 --target=mips-elf \
36 --enable-target-optspace
37 make $make_option
38 $sudo make install
39 cd ..
43 # Demo
44 cat > hw.c <<EOF
45 #include <stdio.h>
46 int main(int c, char**v)
48 printf("%s: Hi, I'm YARI.\n", *v);
50 EOF
51 $target-gcc -O -Tyari.ld hw.c -o hw
57 # // now the tricky bit building the c++ compiler
58 # // if you try
59 # cd ../build-gcc
60 # ../gcc3.3/configure --enable-languages=c++
61 # --enable-multilib=no
62 # --with-cpu=mips32
63 # --with-newlib
64 # --target=mips-mips-elf
65 # --prefix=$prefix --with-gnu-as
66 # --with-gnu-ar
68 # make