#!/bin/bash

cd $BLDDIR
rm -rf gettext-$GETTEXT_VER
tar -xf $SRCDIR/gettext-$GETTEXT_VER.tar.gz
cd gettext-$GETTEXT_VER

# only build what is needed
cd gettext-tools
echo "gl_cv_func_wcwidth_works=yes" > config.cache
./configure --prefix=/tools \
    --build=${CHFS_HOST} --host=${CHFS_TARGET} \
    --disable-shared --cache-file=config.cache
make -C gnulib-lib
make -C src msgfmt
cp -v src/msgfmt /tools/bin

cd $ROOT
