#!/bin/sh

. config/options

$SCRIPTS/build autoconf

PKG_DIR=`find $ROOT/$PACKAGES -type d -name $1`

# 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 \

  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 \

  make
  make install

  mkdir -p $SYSROOT_PREFIX/usr/share/aclocal
    cp $PKG_DIR/files/gtk-doc.m4 $SYSROOT_PREFIX/usr/share/aclocal
