# Exit on error:
set -e

wget http://ftpmirror.gnu.org/coreutils/coreutils-8.19.tar.xz
tar xf coreutils-8.19.tar.xz
cd coreutils-8.19

cat > config.cache << EOF
fu_cv_sys_stat_statfs2_bsize=yes
gl_cv_func_mbrtowc_incomplete_state=yes
gl_cv_func_mbrtowc_nul_retval=yes
gl_cv_func_mbrtowc_null_arg=yes
gl_cv_func_mbrtowc_retval=yes
gl_cv_func_btowc_eof=yes
gl_cv_func_wcrtomb_retval=yes
gl_cv_func_wctob_works=yes
gl_cv_func_fstatat_zero_flag=yes
EOF

./configure --prefix= \
    --enable-install-program=hostname \
    --enable-no-install-program=kill,uptime \
    --cache-file=config.cache

make install
cd ..
rm -rf coreutils-8.19
rm coreutils-8.19.tar.xz

exit 0
