#!/bin/sh

. config/options

$SCRIPTS/build toolchain

cd $PKG_BUILD
ac_cv_file__dev_random=yes \
ac_cv_file__dev_urandom=no \
ac_cv_file__dev_srandom=no \
ac_cv_file__dev_arandom=no \
CPPFLAGS="-I$SYSROOT_PREFIX/usr/include" \
./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --exec-prefix=/usr \
            --sysconfdir=/etc \
            --datadir=/usr/share \
            --enable-shared \
            --disable-static \

make CC="$HOST_CC" \
     CPPFLAGS="$HOST_CPPFLAGS" \
     CFLAGS="$HOST_CFLAGS" \
     LDFLAGS="$HOST_LDFLAGS" \
     -C tools

make

$MAKEINSTALL -C lib

mkdir -p $SYSROOT_PREFIX/usr/lib/pkgconfig
  cp enca.pc $SYSROOT_PREFIX/usr/lib/pkgconfig
