-TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_dn_expand=no --with-openssl"
-TERMUX_PKG_DEPENDS="libexpat, openssl, readline, libutil"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_dn_expand=no --with-openssl --with-zlib=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr --with-expat=$TERMUX_PREFIX"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-readline=$TERMUX_PREFIX"
+TERMUX_PKG_DEPENDS="libexpat, openssl, readline, libutil, libidn"
+
+termux_step_pre_configure () {
+ # We have patched an m4 file.
+ cd $TERMUX_PKG_SRCDIR
+ aclocal
+ autoconf
+}