#!/bin/sh

. config/options

$SCRIPTS/unpack opkg

cd $BUILD/opkg*

setup_toolchain host
CC="gcc" ./configure --disable-dependency-tracking \
            --enable-static \
            --disable-shared \
            --disable-curl \
            --disable-ssl-curl \
            --enable-sha256 \
            --disable-pathfinder \
            --disable-openssl \
            --disable-gpg \
            --with-opkglibdir=/var/lib

make
cp -P src/opkg-cl opkg-host
make clean

mkdir -p $ROOT/$TOOLCHAIN/bin/
cp -P opkg-host $ROOT/$TOOLCHAIN/bin/opkg
