Help with building cross egcs 1.1.1
Mike Gruber
grubinski@seanet.com
Fri Jan 1 12:15:00 GMT 1999
Here's the script file I forgot to attach the first time. ;-)
Mike
#!/bin/sh
# File Build.Script
#
# Mike Gruber
# September 19, 1998
#
# This script builds a complete binutils/egcs/newlib toolchain
# for a specified target, using a specified build directory,
# installing the toolchain in a specified prefix directory,
# with compressed tarfiles to be found in a specified other
# directory, with a given compiler.
#
# Must have write privileges in the install directory to install.
#
# Before invoking this script, the following environment variables
# must be set... AND exported!!! Also, check for correct values of
# the local variables below.
#
# [1] target (say, = m68k-coff) target of toolchain
# [2] prefix (say, = /home/Mike/local) installdir, use full path
# [3] builddir specify full path
# [4] srcdir specify full path
# [5] cc specify full path
# Local Variables, change when new source available
BINUTILS_ARC=binutils-2.9.1.0.7.tar.gz
EGCS_ARC=egcs-1.1b.tar.gz
NEWLIB_ARC=newlib-1.8.1.tar.gz
BINUTILS_SRC=binutils-2.9.1.0.7
EGCS_SRC=egcs-1.1b
NEWLIB_SRC=newlib-1.8.1
# Build the binutils source tree
cp $srcdir/$BINUTILS_ARC $builddir ; cd $builddir
gunzip < $BINUTILS_ARC | tar xvf - ; rm $BINUTILS_ARC
cd $builddir/$BINUTILS_SRC ; patch -p1 < $srcdir/binutils.patch.file
# Build the egcs source tree, remove unwanted targets
cp $srcdir/$EGCS_ARC $builddir ; cd $builddir
gunzip < $EGCS_ARC | tar xvf - ; rm $EGCS_ARC
cd $EGCS_SRC ; patch -p1 < $srcdir/egcs-1.1.1.diff
rm -r libf2c ; rm -r gcc/objc ; rm -r gcc/f
rm -r libio/tests* ; rm -r texinfo/tests* ; rm -r libstdc++/tests*
rm -r gcc/tests*
# Build the newlib source tree, add scanf() fix code for ColdFire
cp $srcdir/$NEWLIB_ARC $builddir ; cd $builddir
gunzip < $NEWLIB_ARC | tar xvf - ; rm $NEWLIB_ARC
cd $builddir/$NEWLIB_SRC/libgloss/m68k
cp $srcdir/ioctl.h $srcdir/readwrite.c $srcdir/Makefile.in .
# Build binutils
cd $builddir/$BINUTILS_SRC ; mkdir objdir ; cd objdir
../configure --target=$target --prefix=$prefix
make CC=$cc CFLAGS=-O0 all install
# Build egcs
cd $builddir/$EGCS_SRC ; mkdir objdir ; cd objdir
../configure --target=$target --prefix=$prefix \
--with-gnu-as --with-gnu-ld --with-newlib \
--with-headers=$builddir/$NEWLIB_SRC/newlib/libc/include
make CC=$cc LANGUAGES="c c++" all install
# Build newlib
cd $builddir/$NEWLIB_SRC ; mkdir objdir ; cd objdir
../configure --target=$target --prefix=$prefix \
--with-gnu-as --with-gnu-ld
make CC=$cc all install
# Remove the source trees
cd $builddir
rm -r $EGCS_SRC
rm -r $BINUTILS_SRC
rm -r $NEWLIB_SRC
More information about the crossgcc
mailing list