#!/bin/sh

. config/options

# build for host
  setup_toolchain host


  cd $BUILD/$1*
  mkdir -p .objdir-host
  cd .objdir-host
  ../configure --host=$HOST_NAME \
               --build=$HOST_NAME \
               --target=$TARGET_NAME \
               --prefix=$ROOT/$TOOLCHAIN \
               --enable-shared \
               --disable-static \

  make
  make install

  cd $ROOT

# build for target
  setup_toolchain target

  cd $BUILD/$1*
  mkdir -p .objdir-target
  cd .objdir-target
  ../configure --host=$TARGET_NAME \
               --build=$HOST_NAME \
               --prefix=$SYSROOT_PREFIX/usr \
               --enable-shared \
               --disable-static \

  make
  make install
