[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ada results



On Tue, May 07, 2002 at 12:57:23PM +0100, Matthew Wilcox wrote:
> No problem -- I've scripted it ;-)

Here is that script, for the curious:

#!/bin/sh
# How to build a Native Ada Compiler for your architecture
# --------------------------------------------------------

FULL_ARCH=m68k-linux
ARCH=m68k
DEST=/home/willy/$ARCH
SRC=/home/willy/gcc/gcc-3.1
BUILD=/home/willy/gcc/$ARCH
BINU_DIR=/home/willy/binutils
LIBC=libc6_2.2.5-6_${ARCH}.deb # alpha & ia64 use libc6.1
LIBC_DEV=libc6-dev_2.2.5-6_${ARCH}.deb # alpha & ia64 use libc6.1

# build binutils for this architecture

mkdir $BINU_DIR
cd $BINU_DIR
apt-get source binutils
cd binutils-2*
debian/rules stampdir/patch # I hate dbs
cd build-tree/binutils-2*
mkdir $FULL_ARCH
cd $FULL_ARCH
../configure --target=$FULL_ARCH --prefix=$DEST
make
make install

# Fetch some libraries & install them
cd $DEST
wget http://http.us.debian.org/debian/pool/main/g/glibc/$LIBC
wget http://http.us.debian.org/debian/pool/main/g/glibc/$LIBC_DEV
dpkg -x $LIBC ...
dpkg -x $LIBC_DEV ...
mkdir -p lib/gcc-lib/${FULL_ARCH}/3.1/
mv .../usr/lib/*crt* lib/gcc-lib/${FULL_ARCH}/3.1/
mv .../lib/* .../usr/lib/* lib/
mv .../usr/include/* include/
# fix up libc.so to point to the right place...
vi lib/libc.so
PATH=$DEST/bin:$PATH

# now build gcc
mkdir ${BUILD}-a
cd ${BUILD}-a
${SRC}/configure --host=i386-linux --target=$FULL_ARCH \
        --prefix=$DEST --enable-languages=c,ada --disable-shared \
        --disable-nls
make
cd gcc
make gnatlib gnatmake gnatlink gnatbind
cd ..
make install

# congratulations, you now have an ada x-compiler.  so you're ready
# to x-build a native compiler.

mkdir ${BUILD}-b
cd ${BUILD}-b
${SRC}/configure --build=i386-pc-linux-gnu --host=$FULL_ARCH \
        --target=$FULL_ARCH --enable-languages=c,ada --disable-shared \
        --disable-nls --prefix=$DEST # will be there on target machine
make
# building a gnatlib fails.  *shrug*.
cd gcc
make gnatbind gnatmake gnatlink
cd ..
TEMP=$(mktemp -d)
make prefix=$TEMP install
cp -a ${DEST}/lib/gcc-lib/${FULL_ARCH}/3.1/ada* ${TEMP}/lib/gcc-lib/${FULL_ARCH}/3.1/
cd $TEMP

# change the cross_compile variable to 0
vi lib/gcc-lib/${FULL_ARCH}/3.1/specs

touch lib/gcc-lib/${FULL_ARCH}/3.1/include/syslimits.h

tar -jcf ${DEST}/gnat-${ARCH}.tar.bz2 *
# now you need to untar this on your host machine and do a make bootstrap.


-- 
Revolutions do not require corporate support.


-- 
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: