# packages/libmodbus/auxbuild
#

# download and unpack tarball
TARVERSION="2.0.3"
TARDIR="${BUILD_PACKAGE}-${TARVERSION}"
TARBALL="${TARDIR}.tar.gz"
build_download "http://mirrors.kernel.org/gentoo/distfiles/${TARBALL}"
build_unpack "${TARBALL}"
PKGDIR="${TARDIR}"

## apply patches matching pattern (repository, patch prefix)
#build_patch "${PKGDIR}" "${BUILD_PACKAGE}-ALL-"
#build_patch "${PKGDIR}" "${BUILD_PACKAGE}-${TARVERSION}-"

# Force configure to think malloc is GNU libc compatible since it has trouble
# detecting this in the cross compile for some reason
export ac_cv_func_malloc_0_nonnull=yes

# invoke configure (directory, prefix, extra arguments)
build_autoconf "${PKGDIR}"

# run make, make install (directory, extra arguments)
build_make "${PKGDIR}"
build_make "${PKGDIR}" "install"

true
# vim: ts=4:sw=4:expandtab:syntax=sh
