name=mpfr
version=4.2.1
revision=1
tarball_url="https://ftp.gnu.org/gnu/mpfr/mpfr-${version}.tar.xz"
tarball_blake2b="ad69f53bc910294647523e7613b18a683f1d0f3dd994168ab2a46b66d0371ffa9b8e7cb59495f898470aea69d343e83fc722f11babe4af7b3a12665a1e65860c"
source_hostdeps="automake autoconf libtool pkg-config"
source_deps="autoconf-archive"
imagedeps="gcc"
hostdeps="gcc autoconf automake libtool pkg-config"
deps="core-libs gmp"

regenerate() {
    autotools_recursive_regen
}

build() {
    cp -rp "${source_dir}"/. ./

        configure_script_path=./configure \
    autotools_configure \
        --enable-static=no \
        --enable-shared=yes \
        --enable-thread-safe \
        --with-pic

    make -j${parallelism}
}

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

    post_package_strip
}
