#!/bin/sh

. config/options

$SCRIPTS/build toolchain
$SCRIPTS/build fontconfig
$SCRIPTS/build freetype
$SCRIPTS/build xproto
$SCRIPTS/build libXrender

cd $PKG_BUILD
./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --sysconfdir=/etc \
            --localstatedir=/var \

make

$MAKEINSTALL

$SED "s:\(['= ]\)/usr:\\1$SYSROOT_PREFIX/usr:g" \
  $SYSROOT_PREFIX/usr/bin/xft-config

mv $SYSROOT_PREFIX/usr/bin/xft-config $ROOT/$TOOLCHAIN/bin
