name=libiconv
version=1.17
revision=1
tarball_url="https://ftp.gnu.org/gnu/libiconv/libiconv-${version}.tar.gz"
tarball_blake2b="1d317dd0655c680a2082c38561cdff51ac1a9181d4734a8bb1e86861dfd66f1a6c0846a90b5b88f3b38b1fa9983d9e563551f27e95a8e329896b71becceae52b"
source_hostdeps="automake autoconf libtool pkg-config"
imagedeps="binutils"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="mlibc libgcc libstdc++"

regenerate() {
    cp /usr/local/share/aclocal/libtool.m4 ./m4/
    cp /usr/local/share/aclocal/libtool.m4 ./libcharset/m4/
    cp /usr/local/share/libtool/build-aux/ltmain.sh ./build-aux/
    cp /usr/local/share/libtool/build-aux/ltmain.sh ./libcharset/build-aux/
    cp /usr/local/share/aclocal/ltversion.m4 ./m4/
    cp /usr/local/share/aclocal/ltversion.m4 ./libcharset/m4/

    autotools_recursive_regen -I"${source_dir}"/m4 -I"${source_dir}"/srcm4
}

build() {
    autotools_configure

    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
