#!/bin/sh
#
# Configure and build gcc for host
#

###### Adapt the MY_* variables for your setup
# Installation directory
MY_INSTALL_DIR=/home/patrice/cross-tools

# Name of package to build
MY_PACKAGE=gcc-3.1

# Path to archive
MY_PACKAGE_TGZ=${MY_PACKAGE}.tar.gz

##### Let's work

# Unpack the archive
tar xvzf ${MY_PACKAGE_TGZ}

# Create a directory to build it
mkdir ${MY_PACKAGE}-linux
cd ${MY_PACKAGE}-linux

# Configure the package
../${MY_PACKAGE}/configure \
  --prefix=${MY_INSTALL_DIR} \
  --enable-languages=c++ \
  --infodir=${MY_INSTALL_DIR}/share/info \
  --mandir=${MY_INSTALL_DIR}/share/man

# Build and install it
make bootstrap
make install

# Go out
cd ..
