#!/bin/sh

. config/options

cd $BUILD/$1*
./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --with-build-cc=$HOST_CC \
            --with-build-cppflags="$HOST_CPPFLAGS -I../include" \
            --with-build-cflags="$HOST_CFLAGS" \
            --with-build-ldflags="$HOST_LDFLAGS" \
            --without-cxx \
            --without-cxx-binding \
            --without-ada \
            --without-progs \
            --with-shared \
            --without-normal \
            --without-debug \
            --without-profile \
            --disable-rpath \
            --enable-overwrite \
            --enable-const \
            --enable-echo \
            --enable-widec \
            --enable-ext-colors \
            --disable-warnings \
            --disable-assertions \

make
make_install
mkdir .install/usr/include/ncursesw
mv .install/usr/include/*.h .install/usr/include/ncursesw
sed -i "s%^prefix=.*%prefix=$LIB_PREFIX%" .install/usr/bin/ncursesw6-config
sed -i 's%-I${prefix}/include%-I${prefix}/include/ncursesw%g' .install/usr/bin/ncursesw6-config